:root {
    --bg-dark-base: #07090e;
    --bg-card-glass: rgba(14, 18, 28, 0.8);
    --border-glass: rgba(255, 255, 255, 0.05);
    --accent-glow: #6366f1; 
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --success-green: #10b981;
    --btn-green-hover: #059669;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark-base);
    color: var(--text-primary);
}

body {
    overflow-x: hidden;
    position: relative;
    background-image: linear-gradient(180deg, rgba(7,9,14,0.6) 0%, rgba(7,9,14,1) 100%), url('https://images.unsplash.com/photo-1560813962-ff3d8fcf59ac?q=80&w=1920');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(7, 9, 14, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 40px; /* reduced vertical padding so logo-area controls the height */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    height: 50px; /* adjust this to taste */
}

.server-logo {
    height: 100%;
    width: auto;
    object-fit: contain;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

nav a:hover, nav a.active {
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    gap: 15px;
}

.btn-primary, .btn-secondary, .btn-play {
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-glow);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Hero Content Graphing Area */
.hero-section {
    min-height: 85vh;
    display: flex;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 140px 40px 60px 40px;
}

.hero-content {
    max-width: 850px;
}

.badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 25px;
    text-transform: uppercase;
}

.flashy-hero-text {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 25px;
}

.gradient-text-1 {
    background: linear-gradient(45deg, #ffffff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-2 {
    background: linear-gradient(45deg, #6366f1, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 35px;
}

.hero-buttons { display: flex; gap: 20px; }

.btn-play {
    background: #ffffff;
    color: #07090e;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 700;
}

.btn-play:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

.btn-more {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Quick Status Panel Metrics */
.quick-stats-container {
    max-width: 1400px;
    margin: 0 auto 100px auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    color: var(--accent-glow);
}

.stat-info { display: flex; flex-direction: column; }
.stat-label { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.stat-value { font-size: 1.15rem; font-weight: 700; }
.text-success { color: var(--success-green); }

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success-green);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Sections Configuration Bases */
.details-section, .departments-section, .gallery-section {
    max-width: 1400px;
    margin: 0 auto 120px auto;
    padding: 0 40px;
}

.section-title h2 { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }
.section-title p { color: var(--text-muted); font-size: 1.05rem; }

.grid-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.feature-card {
    background: var(--bg-card-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 40px;
}

.icon-feature { font-size: 2rem; color: var(--accent-glow); margin-bottom: 25px; display: block; }
.feature-card h3 { margin-bottom: 15px; }
.feature-card p { color: var(--text-muted); line-height: 1.6; font-size: 0.95rem; }

/* Fixed Carousel Horizontal Sizing Rules */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.slider-controls { display: flex; gap: 12px; }

.slider-btn {
    background: var(--bg-card-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.slider-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent-glow);
    transform: scale(1.05);
}

.slider-wrapper {
    overflow: hidden;
    padding: 15px 5px;
    width: 100%;
}

.dept-slider-track, .gallery-slider-track {
    display: flex;
    gap: 24px;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    width: max-content; /* Forces horizontal expansion */
}

/* Explicit container card scaling math locks */
.dept-slide-item, .gallery-slide-item {
    width: calc((1400px - 80px - 48px) / 3); /* Lock exactly 3 columns based on core page rules */
    max-width: 415px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.dept-card {
    background: var(--bg-card-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 30px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    height: 100%;
}

.dept-icon-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 18px;
    border-radius: 10px;
    font-size: 1.5rem;
}

.rcmp-blue .dept-icon-box { color: #3b82f6; }
.pmpd-navy .dept-icon-box { color: #2563eb; }
.vpd-dark .dept-icon-box { color: #94a3b8; }
.bcas-red .dept-icon-box { color: #ef4444; }
.vfr-orange .dept-icon-box { color: #f97316; }

.dept-content h3 { font-size: 1.2rem; margin-bottom: 8px; }
.dept-content p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; margin-bottom: 20px; }

.btn-learn-more {
    display: inline-block;
    text-decoration: none;
    background: var(--success-green);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 18px;
    border-radius: 6px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-learn-more:hover {
    background: var(--btn-green-hover);
    transform: translateY(-1px);
}

/* Gallery Hover Layout Elements */
.gallery-item-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
    aspect-ratio: 16 / 10;
    cursor: pointer;
    background: rgba(0,0,0,0.2);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(7, 9, 14, 0.95) 0%, rgba(7, 9, 14, 0.1) 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-hover-overlay span {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transform: translateY(10px);
    transition: transform 0.2s ease;
}

.gallery-slide-item:hover .gallery-img { transform: scale(1.04); }
.gallery-slide-item:hover .gallery-hover-overlay { opacity: 1; }
.gallery-slide-item:hover .gallery-hover-overlay span { transform: translateY(0); }

/* Premium Lightbox Modal Overlays */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 5, 8, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content-wrapper {
    background: #0e1118;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-modal.active .modal-content-wrapper {
    transform: scale(1);
}

.modal-media img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    background: #040508;
    display: block;
}

.modal-details {
    padding: 30px;
    color: var(--text-primary);
}

.modal-details h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ffffff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-details p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 1rem;
}

.modal-close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 2.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close-btn:hover { color: #ffffff; }

/* Footers */
footer {
    background: #040508;
    padding: 40px;
    border-top: 1px solid var(--border-glass);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left p { color: #4b5563; font-size: 0.85rem; }
.social-icons { display: flex; gap: 20px; }
.social-icons a { color: var(--text-muted); font-size: 1.35rem; }

/* Responsive Media Breakpoints */
@media (max-width: 1024px) {
    .dept-slide-item, .gallery-slide-item { 
        width: calc((100vw - 80px - 24px) / 2); /* 2 Columns */
    }
}

@media (max-width: 768px) {
    nav, .nav-actions { display: none; }
    .flashy-hero-text { font-size: 2.5rem; }
    .dept-slide-item, .gallery-slide-item { 
        width: calc(100vw - 80px); /* 1 Column */
    }
    .section-header-row { flex-direction: column; align-items: flex-start; gap: 20px; }
    .modal-close-btn { top: 15px; right: 20px; }
}
/* Website account/application system */
.auth-page,
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 140px 40px 100px 40px;
    min-height: 80vh;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card,
.dash-card {
    background: var(--bg-card-glass);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 34px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.auth-card {
    width: 100%;
    max-width: 520px;
}

.auth-badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-card h1,
.dashboard-hero h1 {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.auth-muted,
.dashboard-hero p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group label {
    display: block;
    font-size: 0.84rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 13px 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(99,102,241,0.55);
    background: rgba(255,255,255,0.07);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group select option {
    background: #0e1220;
    color: var(--text-primary);
}

.form-submit {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: var(--accent-glow);
    color: white;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
}

.form-submit:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

.auth-switch {
    color: var(--text-muted);
    margin-top: 22px;
    text-align: center;
}

.auth-switch a { color: #a5b4fc; font-weight: 700; }

.flash {
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 20px 0;
    font-weight: 700;
    line-height: 1.5;
}

.flash-error {
    color: #fecaca;
    background: rgba(239,68,68,0.10);
    border: 1px solid rgba(239,68,68,0.28);
}

.flash-success {
    color: #bbf7d0;
    background: rgba(16,185,129,0.10);
    border: 1px solid rgba(16,185,129,0.28);
}

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
}

.dash-card h2 {
    font-size: 1.15rem;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border-glass);
}

.profile-row:last-child { border-bottom: none; }
.profile-row span { color: var(--text-muted); }
.profile-row strong { text-align: right; overflow-wrap: anywhere; }

.application-list { display: flex; flex-direction: column; gap: 14px; }

.application-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.025);
    border-radius: 14px;
}

.application-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.application-row h3 {
    font-size: 0.98rem;
    margin-bottom: 4px;
}

.application-row p,
.staff-note {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid var(--border-glass);
}

.status-pending { color: #fde68a; background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.28); }
.status-approved { color: #bbf7d0; background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.28); }
.status-rejected { color: #fecaca; background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.28); }
.status-waitlisted { color: #bfdbfe; background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.28); }
.status-withdrawn { color: #d1d5db; background: rgba(107,114,128,0.1); border-color: rgba(107,114,128,0.28); }
.status-active { outline: 2px solid rgba(255,255,255,0.18); }

.empty-state {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2rem;
    color: #a5b4fc;
    margin-bottom: 14px;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.admin-container { max-width: 1320px; }
.admin-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 16px 14px;
    border-bottom: 1px solid var(--border-glass);
    vertical-align: middle;
}

.admin-table th {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.admin-table td span { color: var(--text-muted); font-size: 0.86rem; }

.inline-faction {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary) !important;
    font-weight: 700;
}

.faction-icon.mini {
    width: 34px;
    height: 34px;
    font-size: 0.86rem;
    border-radius: 8px;
}

.application-review-grid {
    grid-template-columns: 1fr 380px;
    margin-bottom: 24px;
}

.answers-list { display: flex; flex-direction: column; gap: 16px; }
.answer-block {
    padding: 18px;
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.025);
    border-radius: 14px;
}
.answer-block h3 { font-size: 0.92rem; margin-bottom: 8px; color: #c7d2fe; }
.answer-block p { color: var(--text-primary); line-height: 1.65; white-space: normal; }
.review-form { margin-top: 24px; }

@media (max-width: 1000px) {
    .dashboard-grid,
    .application-review-grid { grid-template-columns: 1fr; }
    .dashboard-hero { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 768px) {
    .auth-page,
    .dashboard-container { padding: 120px 20px 80px; }
    .auth-card,
    .dash-card { padding: 24px; }
    .application-row { align-items: flex-start; flex-direction: column; }
}

/* v2 compact navigation + staff/command panels */
.nav-container { gap: 22px; }
.logo-area { text-decoration: none; flex-shrink: 0; }
.main-nav { display: flex; align-items: center; gap: 8px; padding: 4px; border: 1px solid rgba(255,255,255,0.04); background: rgba(255,255,255,0.025); border-radius: 999px; }
.main-nav .nav-link, .nav-dropbtn { color: var(--text-muted); text-decoration: none; border: 0; background: transparent; font: inherit; font-size: 0.88rem; font-weight: 700; padding: 9px 14px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.main-nav .nav-link:hover, .main-nav .nav-link.active, .nav-dropdown:hover .nav-dropbtn { color: #fff; background: rgba(99,102,241,0.12); }
.nav-dropdown, .portal-menu { position: relative; }
.nav-dropdown-menu, .portal-dropdown { position: absolute; right: 0; top: calc(100% + 12px); min-width: 210px; background: rgba(10,14,24,0.98); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 8px; box-shadow: 0 18px 60px rgba(0,0,0,0.35); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: 0.18s ease; z-index: 2000; }
.nav-dropdown:hover .nav-dropdown-menu, .portal-menu:hover .portal-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown-menu a, .portal-dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 700; }
.nav-dropdown-menu a:hover, .portal-dropdown a:hover { color: #fff; background: rgba(99,102,241,0.12); }
.nav-actions { align-items: center; gap: 10px; flex-shrink: 0; }
.nav-icon-btn { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.04); color: #fff; text-decoration: none; }
.nav-connect { padding: 10px 14px; }
.portal-trigger { min-height: 40px; padding: 9px 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); color: #fff; font-family: inherit; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-dropdown { right: 0; }

.panel-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px 0; }
.panel-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.035); color: var(--text-muted); text-decoration: none; font-weight: 800; font-size: 0.88rem; }
.panel-tab:hover, .panel-tab.active { color: #fff; border-color: rgba(99,102,241,0.35); background: rgba(99,102,241,0.13); }
.panel-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.panel-metric-card { text-decoration: none; color: #fff; background: var(--bg-card-glass); border: 1px solid var(--border-glass); border-radius: 16px; padding: 22px; }
.panel-metric-card span { display: block; font-size: 2.2rem; font-weight: 900; color: #a5b4fc; }
.panel-metric-card small { color: var(--text-muted); font-weight: 700; }
.panel-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.panel-action-card { display: block; text-decoration: none; color: inherit; transition: transform .2s ease, border-color .2s ease; }
.panel-action-card:hover { transform: translateY(-3px); border-color: rgba(99,102,241,0.35); }
.panel-action-card > i { font-size: 1.6rem; color: #a5b4fc; margin-bottom: 14px; }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-row { display: flex; align-items: center; gap: 10px; color: var(--text-muted); margin: 8px 0 16px; font-weight: 700; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.danger-btn { border-color: rgba(239,68,68,0.35) !important; color: #fecaca !important; }
.filter-divider { width: 1px; min-height: 28px; background: rgba(255,255,255,0.08); margin: 0 6px; }
.gallery-admin-list { display: flex; flex-direction: column; gap: 14px; }
.gallery-admin-row { display: grid; grid-template-columns: 120px 1fr; gap: 14px; border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 12px; background: rgba(255,255,255,0.025); }
.gallery-admin-row img { width: 120px; height: 78px; object-fit: cover; border-radius: 10px; background: #111827; }
.panel-search { display: flex; gap: 10px; margin-bottom: 18px; }
.panel-search input, .admin-table input, .admin-table select { width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--border-glass); background: rgba(255,255,255,0.04); color: var(--text-primary); }

/* News page moved from inline CSS into global theme */
.news-container { max-width: 1100px; margin: 0 auto; padding: 140px 40px 120px 40px; display: grid; grid-template-columns: 1fr 280px; gap: 50px; align-items: start; }
.news-hero { grid-column: 1 / -1; margin-bottom: 10px; }
.news-hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 12px; }
.news-feed { display: flex; flex-direction: column; gap: 24px; }
.news-post { background: var(--bg-card-glass); border: 1px solid var(--border-glass); backdrop-filter: blur(12px); border-radius: 16px; overflow: hidden; transition: border-color 0.25s ease; }
.news-post:hover { border-color: rgba(99,102,241,0.3); }
.post-type-bar { height: 3px; }
.type-patch { background: linear-gradient(90deg, #6366f1, #8b5cf6); } .type-hotfix { background: linear-gradient(90deg, #f59e0b, #ef4444); } .type-announce { background: linear-gradient(90deg, #10b981, #06b6d4); } .type-event { background: linear-gradient(90deg, #ec4899, #f97316); }
.post-body { padding: 28px 30px 30px; } .post-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.post-badge { font-size: .72rem; padding: 3px 10px; border-radius: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.badge-patch { background: rgba(99,102,241,.15); border: 1px solid rgba(99,102,241,.3); color: #a5b4fc; } .badge-hotfix { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.3); color: #fcd34d; } .badge-announce { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; } .badge-event { background: rgba(236,72,153,.12); border: 1px solid rgba(236,72,153,.3); color: #f9a8d4; }
.post-date, .post-version { font-size: .8rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; } .post-version { margin-left: auto; }
.post-title { font-size: 1.35rem; font-weight: 800; margin-bottom: 10px; } .post-desc { color: var(--text-muted); font-size: .95rem; line-height: 1.65; margin-bottom: 18px; }
.news-body { padding: 16px; background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; }
.post-author { display: flex; align-items: center; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border-glass); }
.author-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(99,102,241,.15); border: 1px solid rgba(99,102,241,.2); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; color: #a5b4fc; }
.author-name { font-size: .85rem; font-weight: 700; } .author-role { font-size: .75rem; color: var(--text-muted); }
.news-sidebar { position: sticky; top: 120px; } .sidebar-widget { background: var(--bg-card-glass); border: 1px solid var(--border-glass); backdrop-filter: blur(12px); border-radius: 14px; padding: 22px; margin-bottom: 20px; }
.widget-title { font-size: .75rem; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 800; color: var(--text-muted); margin-bottom: 14px; }
.filter-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 7px; color: var(--text-muted); text-decoration: none; font-size: .88rem; font-weight: 700; border: 1px solid transparent; margin-bottom: 4px; }
.filter-btn:hover, .filter-btn.active { color: #fff; background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.2); }
.filter-btn .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; } .dot-all { background: #6366f1; } .dot-patch { background: #8b5cf6; } .dot-hotfix { background: #f59e0b; } .dot-announce { background: #10b981; } .dot-event { background: #ec4899; }
.count-pill { margin-left: auto; font-size: .72rem; padding: 2px 7px; border-radius: 10px; background: rgba(255,255,255,0.05); color: var(--text-muted); }

@media (max-width: 1050px) { .nav-connect { display: none; } .main-nav { gap: 2px; } .main-nav .nav-link, .nav-dropbtn { padding: 9px 10px; } }
@media (max-width: 900px) { .news-container { grid-template-columns: 1fr; padding: 120px 20px 80px; } .news-sidebar { position: static; } .news-hero h1 { font-size: 2rem; } .panel-metric-grid { grid-template-columns: repeat(2, 1fr); } .form-grid-two { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .main-nav, .nav-connect { display: none; } .nav-container { padding: 10px 18px; } .portal-trigger { max-width: 150px; } .panel-metric-grid { grid-template-columns: 1fr; } .gallery-admin-row { grid-template-columns: 1fr; } .gallery-admin-row img { width: 100%; height: 160px; } }
@media (max-width: 768px) { .nav-actions { display: flex; } }

/* v2.5 CMS, docs, status, and quality-of-life additions */
.site-announcement-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 34px;
    padding: 7px 18px;
    background: linear-gradient(90deg, rgba(99,102,241,0.92), rgba(14,165,233,0.92));
    color: #fff;
    font-size: 0.86rem;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.site-announcement-bar a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.65); }
.site-announcement-bar + header { top: 34px; }
.text-danger { color: #f87171 !important; }
.offline-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #ef4444; }
.home-news-strip { max-width: 1200px; margin: 0 auto; padding: 70px 40px 20px; }
.home-news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.home-news-card { display: block; min-height: 210px; padding: 24px; border-radius: 16px; border: 1px solid var(--border-glass); background: var(--bg-card-glass); color: inherit; text-decoration: none; transition: transform .2s ease, border-color .2s ease; }
.home-news-card:hover { transform: translateY(-3px); border-color: rgba(99,102,241,0.35); }
.home-news-card h3 { margin: 14px 0 8px; font-size: 1.12rem; }
.home-news-card p { color: var(--text-muted); line-height: 1.55; font-size: .92rem; margin-bottom: 16px; }
.home-news-card small { color: #a5b4fc; font-family: 'JetBrains Mono', monospace; font-weight: 800; }
.rules-dashboard-container.cms-docs-page { max-width: 1400px; margin: 0 auto; padding: 140px 40px 120px; display: grid; grid-template-columns: 280px 1fr; gap: 50px; }
.rules-sidebar { position: sticky; top: 120px; height: calc(100vh - 160px); overflow-y: auto; padding-right: 15px; }
.sidebar-subtitle { margin-top: 18px; margin-bottom: 8px; font-size: .68rem; opacity: .8; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text-muted); text-decoration: none; font-weight: 700; font-size: .9rem; border-radius: 8px; border: 1px solid transparent; transition: all .2s ease; }
.sidebar-link i { width: 20px; text-align: center; color: var(--accent-glow); opacity: .75; }
.sidebar-link:hover, .sidebar-link.active-section { color: #fff; background: rgba(99,102,241,.1); border-color: rgba(99,102,241,.22); }
.rules-content-stream { display: flex; flex-direction: column; gap: 30px; }
.rules-card { background: var(--bg-card-glass); border: 1px solid var(--border-glass); backdrop-filter: blur(12px); border-radius: 16px; padding: 40px; scroll-margin-top: 130px; }
.rules-card:target { border-color: var(--accent-glow); }
.card-header { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--border-glass); padding-bottom: 20px; margin-bottom: 25px; }
.card-header i { font-size: 1.35rem; color: var(--accent-glow); background: rgba(99,102,241,.08); padding: 12px; border-radius: 10px; border: 1px solid rgba(99,102,241,.15); }
.card-header h2 { font-size: 1.5rem; font-weight: 900; }
.cms-doc-paragraph { font-size: .98rem !important; color: var(--text-primary) !important; margin-bottom: 14px; }
.cms-doc-list { display: flex; flex-direction: column; gap: 9px; margin: 10px 0 16px 0; padding: 0; list-style: none; }
.cms-doc-list li { padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.025); color: var(--text-primary); }
.cms-doc-list li::before { content: "•"; color: var(--accent-glow); font-weight: 900; margin-right: 10px; }
.cms-two-column { grid-template-columns: minmax(380px, .85fr) 1.15fr; }
.cms-list-row { align-items: flex-start; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.setting-field.setting-textarea { grid-column: span 2; }
.switch-row { display: inline-flex !important; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--border-glass); background: rgba(255,255,255,.035); border-radius: 10px; color: var(--text-primary) !important; }
.form-help { display: block; margin-top: 8px; color: var(--text-muted); line-height: 1.4; }
.form-help code { color: #a5b4fc; }
@media (max-width: 1000px) { .home-news-grid { grid-template-columns: 1fr; } .rules-dashboard-container.cms-docs-page, .cms-two-column { grid-template-columns: 1fr; } .rules-sidebar { position: static; height: auto; } .settings-grid { grid-template-columns: 1fr; } .setting-field.setting-textarea { grid-column: auto; } }

.status-debug-card {
    border: 1px solid rgba(255, 184, 77, 0.2);
}
.status-debug-output {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f8d7a1;
    font-size: 0.88rem;
    line-height: 1.55;
}

/* v2.7 restored Docs CMS rich components */
.doc-internal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    width: 100%;
    margin: 10px 0 18px;
}

.doc-bind-item,
.doc-cmd-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
}

.doc-cmd-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
}

.doc-bind-item kbd {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    color: #ffffff;
    background: rgba(99, 102, 241, 0.16);
    border: 1px solid rgba(99, 102, 241, 0.32);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: .85rem;
    min-width: 58px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
}

.doc-bind-desc {
    color: var(--text-primary);
    font-size: .95rem;
}

.doc-cmd-item code {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    color: #a5b4fc;
    font-size: .95rem;
    white-space: normal;
}

.doc-section-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: #ffffff;
    border-left: 3px solid var(--accent-glow);
    padding-left: 10px;
    margin: 18px 0 8px;
}

.doc-section-title:first-child {
    margin-top: 0;
}

.doc-callout {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 14px;
    background: rgba(99, 102, 241, 0.08);
    padding: 13px 15px;
    border-left: 3px solid var(--accent-glow);
    border-radius: 6px;
    line-height: 1.55;
}

.hero-actions-inline {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-actions-inline form {
    margin: 0;
}

.form-help {
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.6;
    margin: -6px 0 12px;
}

.form-help code {
    font-family: 'JetBrains Mono', monospace;
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 5px;
    padding: 2px 5px;
}

/* v3 Community Hub / CMS expansion */
.public-page { padding-top: 135px; }
.public-hero { align-items: center; }
.hero-action-stack, .hub-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.cms-public-section { margin-bottom: 24px; }
.faq-list { display: grid; gap: 12px; }
.faq-item { border: 1px solid rgba(255,255,255,.1); border-radius: 16px; background: rgba(255,255,255,.035); overflow: hidden; }
.faq-item summary { cursor: pointer; list-style: none; padding: 18px 20px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 10px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { padding: 0 20px 20px; color: var(--text-muted); line-height: 1.75; }
.event-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.event-card { position: relative; overflow: hidden; }
.featured-event-card { border-color: rgba(99,102,241,.45); box-shadow: 0 20px 55px rgba(99,102,241,.16); }
.card-kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 900; margin-bottom: 12px; }
.event-meta-row { margin: 12px 0; color: var(--text-muted); font-size: .95rem; }
.event-meta-row i { color: var(--accent); margin-right: 8px; }
.compact-list { display: grid; gap: 10px; }
.compact-list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(255,255,255,.035); color: inherit; text-decoration: none; }
.compact-list-row strong { color: #fff; display: block; }
.compact-list-row small { color: var(--text-muted); display: block; margin-top: 4px; }
.compact-list-row p { margin: 8px 0 0; color: var(--text-muted); }
.compact-list-row.active-row, .compact-list-row:hover { border-color: rgba(99,102,241,.5); background: rgba(99,102,241,.08); }
.roadmap-board { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 18px; align-items: start; overflow-x: auto; padding-bottom: 12px; }
.roadmap-column { min-width: 230px; display: grid; gap: 12px; }
.roadmap-column h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); display: flex; justify-content: space-between; }
.roadmap-column h2 span { color: #fff; }
.roadmap-card h3 { margin: 0 0 10px; }
.progress-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin: 14px 0 8px; }
.progress-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #22c55e); }
.support-layout { grid-template-columns: minmax(310px, .75fr) minmax(360px, 1.25fr); align-items: start; }
.ticket-message { padding: 16px; border-radius: 14px; background: rgba(255,255,255,.04); color: var(--text-muted); line-height: 1.7; }
.ticket-row .status-pill { flex-shrink: 0; }
.status-open { background: rgba(59,130,246,.16); color: #93c5fd; }
.status-waiting { background: rgba(245,158,11,.16); color: #fcd34d; }
.status-resolved { background: rgba(34,197,94,.16); color: #86efac; }
.status-closed { background: rgba(148,163,184,.16); color: #cbd5e1; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.row-actions form { margin: 0; }
.btn-mini { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #fff; border-radius: 10px; padding: 8px 10px; text-decoration: none; font-weight: 800; cursor: pointer; }
.btn-mini.danger { border-color: rgba(239,68,68,.28); color: #fecaca; }
.cms-editor-grid { grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr); align-items: start; }
.quick-action-list { display: grid; gap: 10px; }
.quick-action-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.035); font-weight: 800; }
.quick-action-list a i { color: var(--accent); }
.quick-action-list a span { color: var(--text-muted); font-weight: 700; }
.community-hub-strip { margin-top: 24px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.switch-row { display: flex; align-items: center; gap: 10px; color: var(--text-muted); margin: 10px 0; }
.switch-row input { width: auto; }
@media (max-width: 980px) {
    .support-layout, .cms-editor-grid { grid-template-columns: 1fr; }
    .roadmap-board { grid-template-columns: repeat(5, minmax(260px, 1fr)); }
    .form-row { grid-template-columns: 1fr; }
}

/* v3.2 Mobile accessibility + Discord/OpenGraph polish */
.skip-link {
    position: fixed;
    left: 14px;
    top: 14px;
    z-index: 5000;
    transform: translateY(-150%);
    background: #ffffff;
    color: #07090e;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.skip-link:focus { transform: translateY(0); }

img, video, iframe { max-width: 100%; }
button, input, textarea, select { font-size: 16px; }
main { outline: none; }

.nav-shell {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.055);
    color: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    margin-left: auto;
}
.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transition: transform .2s ease, opacity .2s ease;
}
body.nav-open .mobile-menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .mobile-menu-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .mobile-menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-dropdown.is-open .nav-dropdown-menu,
.portal-menu.is-open .portal-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropbtn:focus-visible,
.portal-trigger:focus-visible,
.mobile-menu-toggle:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid rgba(165,180,252,.9);
    outline-offset: 3px;
}

@media (max-width: 1180px) {
    .nav-container { padding-inline: 24px; }
    .nav-shell { gap: 10px; }
    .main-nav { gap: 3px; }
    .main-nav .nav-link, .nav-dropbtn { padding: 9px 11px; font-size: .84rem; }
    .nav-connect { display: none; }
}

@media (max-width: 900px) {
    body.nav-open { overflow: hidden; }
    header { backdrop-filter: blur(18px); }
    .nav-container { padding: 9px 16px; gap: 12px; }
    .logo-area { height: 46px; }
    .mobile-menu-toggle { display: inline-flex; }
    .nav-shell {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 76px;
        max-height: calc(100dvh - 92px);
        overflow-y: auto;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
        border: 1px solid rgba(255,255,255,.1);
        border-radius: 20px;
        background: rgba(7, 9, 14, .98);
        box-shadow: 0 24px 90px rgba(0,0,0,.6);
    }
    .site-announcement-bar + header .nav-shell {
        top: 110px;
        max-height: calc(100dvh - 126px);
    }
    .nav-shell.is-open { display: flex; }
    nav.main-nav,
    .main-nav {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 0;
        border: 0;
        background: transparent;
        border-radius: 0;
    }
    .main-nav .nav-link,
    .nav-dropbtn {
        width: 100%;
        justify-content: space-between;
        border-radius: 14px;
        padding: 14px 16px;
        background: rgba(255,255,255,.04);
        border: 1px solid rgba(255,255,255,.06);
        font-size: .96rem;
    }
    .nav-dropdown-menu,
    .portal-dropdown {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        min-width: 0;
        box-shadow: none;
        margin-top: 8px;
        background: rgba(255,255,255,.035);
        border-radius: 16px;
    }
    .nav-dropdown:hover .nav-dropdown-menu,
    .portal-menu:hover .portal-dropdown {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .nav-dropdown.is-open .nav-dropdown-menu,
    .portal-menu.is-open .portal-dropdown { display: grid; }
    .nav-dropdown-menu a,
    .portal-dropdown a { padding: 13px 14px; font-size: .95rem; }
    .nav-actions {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .nav-icon-btn,
    .nav-connect,
    .portal-trigger {
        width: 100%;
        max-width: none;
        min-height: 46px;
        justify-content: center;
        border-radius: 14px;
    }
    .nav-connect { display: inline-flex !important; }
    .portal-trigger span { overflow: hidden; text-overflow: ellipsis; }

    .site-announcement-bar {
        min-height: 36px;
        padding: 8px 14px;
        text-align: center;
        font-size: .78rem;
    }
    .site-announcement-bar + header { top: 36px; }
}

@media (max-width: 768px) {
    body { background-attachment: scroll; }
    .hero-section,
    .dashboard-container,
    .auth-page,
    .apply-container,
    .store-container,
    .news-container,
    .staff-container,
    .rules-dashboard-container.cms-docs-page,
    .public-page {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
    .hero-section { min-height: auto; padding-top: 118px; padding-bottom: 46px; }
    .flashy-hero-text { font-size: clamp(2.25rem, 12vw, 3.2rem); letter-spacing: -1.2px; }
    .hero-content p { font-size: 1rem; }
    .hero-buttons,
    .hero-action-stack,
    .hub-actions,
    .hero-actions-inline { flex-direction: column; align-items: stretch; justify-content: flex-start; }
    .btn-play,
    .btn-primary,
    .btn-secondary,
    .btn-more,
    .form-submit { justify-content: center; width: 100%; }
    .quick-stats-container { grid-template-columns: 1fr; padding-inline: 18px; margin-bottom: 56px; }
    .stat-card { padding: 18px; }
    .section-header-row { align-items: stretch; }
    .section-title h2, .dashboard-hero h1, .apply-hero h1, .store-hero h1, .news-hero h1 { font-size: clamp(1.8rem, 8vw, 2.35rem); }
    .dept-slide-item,
    .gallery-slide-item { width: calc(100vw - 48px); }
    .slider-controls { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .slider-btn { width: 100%; }
    .home-news-strip { padding-inline: 18px; }
    .home-news-grid,
    .framework-grid,
    .event-grid,
    .panel-action-grid,
    .factions-grid { grid-template-columns: 1fr !important; }
    .dash-card,
    .auth-card,
    .rules-card,
    .news-post,
    .home-news-card { padding: 22px; }
    .post-body { padding: 22px; }
    .dashboard-hero { align-items: stretch; }
    .dashboard-grid,
    .application-review-grid,
    .support-layout,
    .cms-editor-grid,
    .cms-two-column { grid-template-columns: 1fr !important; }
    .application-main,
    .compact-list-row,
    .profile-row { align-items: flex-start; flex-direction: column; }
    .profile-row strong { text-align: left; }
    .panel-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        margin-left: -4px;
        margin-right: -4px;
        -webkit-overflow-scrolling: touch;
    }
    .panel-tab { white-space: nowrap; }
    .panel-search { flex-direction: column; }
    .admin-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-inline: -10px;
        padding-inline: 10px;
    }
    .admin-table { min-width: 760px; }
    .form-grid-two,
    .form-row,
    .settings-grid { grid-template-columns: 1fr !important; }
    .setting-field.setting-textarea { grid-column: auto; }
    .doc-internal-grid { grid-template-columns: 1fr; }
    .doc-bind-item { align-items: flex-start; }
    .roadmap-board {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 16px;
    }
    .roadmap-column { min-width: 82vw; scroll-snap-align: start; }
    .footer-container { flex-direction: column; text-align: center; gap: 18px; }
    footer { padding: 30px 18px; }
    .modal-content-wrapper { width: calc(100vw - 28px); max-height: 88dvh; overflow-y: auto; }
}

@media (max-width: 520px) {
    .nav-container { padding-inline: 12px; }
    .logo-area { height: 42px; }
    .server-logo { max-width: 156px; }
    .hero-section,
    .dashboard-container,
    .auth-page,
    .apply-container,
    .store-container,
    .news-container,
    .staff-container,
    .rules-dashboard-container.cms-docs-page,
    .public-page { padding-top: 112px !important; }
    .site-announcement-bar + header + main,
    .site-announcement-bar + header ~ main { padding-top: 146px !important; }
    .auth-card,
    .dash-card,
    .rules-card { border-radius: 14px; padding: 18px; }
    .card-header { align-items: flex-start; }
    .card-header h2 { font-size: 1.25rem; }
    .post-meta { align-items: flex-start; flex-direction: column; }
    .post-version { margin-left: 0; }
    .row-actions { width: 100%; }
    .row-actions .btn-secondary,
    .row-actions .btn-mini,
    .row-actions button,
    .row-actions form { width: 100%; }
    .row-actions form button { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* v3.2.1 desktop navbar polish: keep long account names inside the top-right pill */
@media (min-width: 901px) {
    .nav-shell {
        flex: 1 1 auto;
        justify-content: flex-end;
        min-width: 0;
    }
    .main-nav {
        flex: 0 1 auto;
        min-width: 0;
    }
    .nav-actions {
        min-width: 0;
        flex: 0 1 auto;
    }
    .nav-icon-btn,
    .nav-connect {
        flex: 0 0 auto;
    }
    .portal-menu {
        min-width: 0;
        max-width: 178px;
    }
    .portal-trigger {
        max-width: 178px;
        min-width: 0;
        overflow: hidden;
    }
    .portal-trigger i {
        flex: 0 0 auto;
    }
    .portal-trigger span {
        display: block;
        min-width: 0;
        max-width: 104px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.15;
    }
}

@media (min-width: 1181px) and (max-width: 1320px) {
    .nav-container { padding-inline: 24px; }
    .portal-menu, .portal-trigger { max-width: 154px; }
    .portal-trigger span { max-width: 82px; }
}

/* v3.2.2 desktop nav correction + 18-character username support */
@media (min-width: 901px) {
    .nav-container {
        display: grid;
        grid-template-columns: minmax(170px, 1fr) auto minmax(260px, 1fr);
        align-items: center;
        gap: 18px;
    }
    .logo-area {
        grid-column: 1;
        justify-self: start;
    }
    .nav-shell {
        display: contents;
    }
    .main-nav {
        grid-column: 2;
        justify-self: center;
        margin-inline: auto;
    }
    .nav-actions {
        grid-column: 3;
        justify-self: end;
        width: auto;
        max-width: none;
    }
    .portal-menu {
        max-width: none;
    }
    .portal-trigger {
        min-width: 152px;
        max-width: 248px;
        padding-inline: 15px;
        justify-content: center;
    }
    .portal-trigger span {
        max-width: 168px;
        overflow: hidden;
        text-overflow: clip;
        white-space: nowrap;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    .nav-container {
        grid-template-columns: minmax(150px, .8fr) auto minmax(236px, .8fr);
        gap: 12px;
    }
    .main-nav .nav-link,
    .nav-dropbtn {
        padding-inline: 10px;
        font-size: .82rem;
    }
    .portal-trigger {
        min-width: 145px;
        max-width: 230px;
    }
    .portal-trigger span {
        max-width: 155px;
    }
}

/* v3.2.3 desktop nav centering, hover-safe dropdowns, and logo favicon polish */
@media (min-width: 1181px) {
    header .nav-container {
        max-width: 100%;
        width: 100%;
        padding-inline: clamp(22px, 4vw, 64px);
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        gap: 18px;
    }
    header .logo-area {
        flex: 0 0 220px;
        justify-content: flex-start;
        min-width: 0;
    }
    header .nav-shell {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex: 1 1 auto;
        min-width: 0;
        gap: 14px;
    }
    header .main-nav {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) !important;
        margin: 0;
        z-index: 1002;
    }
    header .nav-actions {
        margin-left: auto;
        position: relative;
        z-index: 1003;
    }
    header .portal-trigger {
        min-width: 218px;
        max-width: 292px;
        justify-content: center;
        padding-inline: 16px;
    }
    header .portal-trigger span {
        max-width: 190px;
        overflow: hidden;
        text-overflow: clip;
        white-space: nowrap;
    }
}

@media (min-width: 901px) and (max-width: 1340px) {
    header .nav-container {
        grid-template-columns: minmax(150px, 0.75fr) auto minmax(250px, 0.75fr);
        gap: 12px;
    }
    header .nav-connect { display: none; }
    header .portal-trigger {
        min-width: 196px;
        max-width: 248px;
    }
    header .portal-trigger span { max-width: 168px; }
}

@media (min-width: 901px) {
    .nav-dropdown-menu,
    .portal-dropdown {
        top: calc(100% + 8px);
        pointer-events: none;
    }
    .nav-dropdown::after,
    .portal-menu::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 12px;
        display: block;
    }
    .nav-dropdown:hover .nav-dropdown-menu,
    .portal-menu:hover .portal-dropdown,
    .nav-dropdown:focus-within .nav-dropdown-menu,
    .portal-menu:focus-within .portal-dropdown,
    .nav-dropdown.is-open .nav-dropdown-menu,
    .portal-menu.is-open .portal-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
    .nav-dropdown:hover .nav-dropbtn,
    .nav-dropdown:focus-within .nav-dropbtn,
    .portal-menu:hover .portal-trigger,
    .portal-menu:focus-within .portal-trigger {
        color: #fff;
        background: rgba(99,102,241,0.12);
    }
}
