
html {
    touch-action: pan-x pan-y;
    overscroll-behavior: none;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg);
}

:root {
    --bg: #030712;
    --surface: #0a0f1a;
    --surface-2: #111827;
    --glass: rgba(255,255,255,0.03);
    --glass-border: rgba(255,255,255,0.08);
    --primary: #538cbe;
    --primary-light: #7ab0d9;
    --text: #f9fafb;
    --text-muted: #b0b8c4;
    --success: #10b981;
    --warning: #eab308;
    --orange: #f97316;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
}

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

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0 0 8px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10000;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    transition: opacity 0.08s ease;
    display: flex;
    flex-direction: column;
}

.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 8s ease-in-out infinite;
    will-change: transform, opacity;
}
@keyframes particleFloat {
    0%, 100% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-100px) scale(1); }
}
.glow-blob {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}
.glow-blob-1 {
    background: var(--primary);
    top: -200px;
    left: -200px;
    animation: blobMove1 20s ease-in-out infinite;
}
.glow-blob-2 {
    background: var(--primary-light);
    bottom: -200px;
    right: -200px;
    animation: blobMove2 25s ease-in-out infinite;
}
.glow-blob-3 {
    background: #06b6d4;
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: blobMove3 30s ease-in-out infinite;
    opacity: 0.08;
}
@keyframes blobMove1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(100px, 50px); }
    66% { transform: translate(50px, 100px); }
}
@keyframes blobMove2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-50px, -100px); }
    66% { transform: translate(-100px, -50px); }
}
@keyframes blobMove3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}
.grid-pattern {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(83, 140, 190, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(83, 140, 190, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    z-index: 0;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
    pointer-events: none;
}

header {
    border-bottom: 1px solid var(--glass-border);
    background: rgba(10, 15, 26, 0.85);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.25s ease;
}
header.header-hidden { transform: translateY(-100%); }

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
}

.logo img { border-radius: 6px; }

.logo-badge {
    background: #3a6a96;
    color: white;
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.admin-link {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    transition: color 0.2s;
}
.admin-link:hover { color: var(--text); }

.push-toggle {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-muted);
    padding: 0.4rem 0.55rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.push-toggle:hover { color: var(--text); border-color: var(--primary); }
.push-toggle.push-active {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}
.back-link:hover { color: var(--primary-light); }

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
    flex: 1;
    position: relative;
    z-index: 1;
}

.status-banner {
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.status-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background: radial-gradient(ellipse at center, currentColor, transparent 70%);
}

.status-banner--operational {
    background: rgba(16,185,129,0.05);
    border-color: rgba(16,185,129,0.2);
    color: var(--success);
}
.status-banner--degraded {
    background: rgba(234,179,8,0.05);
    border-color: rgba(234,179,8,0.2);
    color: var(--warning);
}
.status-banner--partial_outage {
    background: rgba(249,115,22,0.05);
    border-color: rgba(249,115,22,0.2);
    color: var(--orange);
}
.status-banner--major_outage {
    background: rgba(239,68,68,0.05);
    border-color: rgba(239,68,68,0.2);
    color: var(--danger);
}
.status-banner--maintenance {
    background: rgba(83,140,190,0.05);
    border-color: rgba(83,140,190,0.2);
    color: var(--text);
}

.status-banner-icon { margin-bottom: 0.75rem; position: relative; }

.status-check-anim {
    width: 36px;
    height: 36px;
    position: relative;
    display: inline-block;
}
.status-check-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2.5px solid var(--success);
    animation: checkCircle 0.6s ease forwards;
    opacity: 0;
}
.status-check-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 16px;
    border-right: 2.5px solid var(--success);
    border-bottom: 2.5px solid var(--success);
    transform: translate(-50%, -55%) rotate(45deg) scale(0);
    animation: checkMark 0.3s ease 0.5s forwards;
}
@keyframes checkCircle {
    0% { opacity: 0; transform: scale(0.5); }
    60% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:0.3; } }
.grecaptcha-badge { visibility: hidden !important; }
@keyframes checkMark {
    0% { transform: translate(-50%, -55%) rotate(45deg) scale(0); }
    60% { transform: translate(-50%, -55%) rotate(45deg) scale(1.15); }
    100% { transform: translate(-50%, -55%) rotate(45deg) scale(1); }
}
.status-banner-title { font-size: 1.5rem; font-weight: 700; position: relative; }
.status-banner-time { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.5rem; position: relative; }

.section { margin-bottom: 2.5rem; }
.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.category-group {
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.category-name {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    background: var(--glass);
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background 0.15s;
}
.category-name:hover { background: rgba(255,255,255,0.04); }
.category-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}
.category-name.collapsed .category-toggle { transform: rotate(-90deg); }
.category-name.collapsed { border-bottom-color: transparent; }
.services-list.collapsed { display: none; }

.services-list { display: flex; flex-direction: column; }

.service-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.15s;
}
.service-row:last-child { border-bottom: none; }
.service-row:hover { background: var(--glass); }

.service-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-shrink: 0;
}

.service-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.service-dot--pulse {
    animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50% { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

.service-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.service-tag {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.2;
}
.service-group-card {
    padding: 0.75rem 1.25rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}
.service-group-card:last-child { border-bottom: none; }
.service-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.service-group-instances {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}
.instance-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: border-color 0.15s;
}
.instance-card:hover { border-color: rgba(255,255,255,0.15); }
.instance-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.instance-name {
    font-size: 0.82rem;
    font-weight: 500;
}
.instance-location {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: auto;
}
.instance-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.instance-rt {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.instance-status {
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: auto;
}
.response-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.service-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.service-status {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    min-width: 100px;
    text-align: right;
}

.uptime-bars-wrap { display: flex; flex-direction: column; gap: 2px; }
.uptime-bars-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.7;
    line-height: 1;
}
.uptime-bars {
    display: flex;
    gap: 1.5px;
    height: 34px;
    align-items: stretch;
    border-radius: 3px;
}

.uptime-bar {
    flex: 1;
    min-width: 1px;
    height: 100%;
    cursor: pointer;
    transition: filter 0.15s;
}
.uptime-bar:hover { filter: brightness(1.3); }
.uptime-bar:first-child { border-radius: 3px 0 0 3px; }
.uptime-bar:last-child { border-radius: 0 3px 3px 0; }

.uptime-pct {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1;
}

.uptime-bar--ok { background: var(--success); }
.uptime-bar--degraded { background: var(--warning); }
.uptime-bar--down { background: var(--danger); }
.uptime-bar--nodata { background: rgba(255,255,255,0.1); }

.uptime-legend {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.legend-bar {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
}
.legend-bar--ok { background: var(--success); }
.legend-bar--degraded { background: var(--warning); }
.legend-bar--down { background: var(--danger); }
.legend-bar--nodata { background: rgba(255,255,255,0.08); }

.uptime-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.uptime-card {
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}
.uptime-card-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.uptime-card-value { font-size: 1.5rem; font-weight: 700; color: var(--text-muted); }
.uptime-card-value--ok { color: var(--success); }
.uptime-card-value--degraded { color: var(--warning); }
.uptime-card-value--down { color: var(--danger); }

.incident-card {
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    border-left: 3px solid;
}
.incident-card--minor { border-left-color: var(--warning); }
.incident-card--major { border-left-color: var(--orange); }
.incident-card--critical { border-left-color: var(--danger); }

.incident-header { padding: 1rem 1.25rem; }

.incident-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.severity-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.severity-badge--minor { background: rgba(234,179,8,0.15); color: var(--warning); }
.severity-badge--major { background: rgba(249,115,22,0.15); color: var(--orange); }
.severity-badge--critical { background: rgba(239,68,68,0.15); color: var(--danger); }

.incident-status { font-size: 0.8rem; color: var(--text-muted); }
.incident-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.incident-title a { color: inherit; text-decoration: none; }
.incident-title a:hover { color: var(--primary-light); }
.incident-services { font-size: 0.8rem; color: var(--text-muted); }

.incident-timeline {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--glass-border);
}

.timeline-item {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1rem;
    position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 12px;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}
.timeline-item:last-child::before { display: none; }

.timeline-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 7px;
}

.timeline-content { flex: 1; min-width: 0; }

.timeline-status {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-light);
}
.timeline-status--investigating { color: var(--danger); }
.timeline-status--identified { color: var(--orange); }
.timeline-status--monitoring { color: var(--primary-light); }
.timeline-status--resolved { color: var(--success); }
.timeline-status--in_progress { color: var(--orange); }
.timeline-status--completed { color: var(--success); }
.timeline-status--scheduled { color: var(--text-muted); }

.timeline-dot--investigating { background: var(--danger); }
.timeline-dot--identified { background: var(--orange); }
.timeline-dot--monitoring { background: var(--primary-light); }
.timeline-dot--resolved { background: var(--success); }
.timeline-dot--in_progress { background: var(--orange); }
.timeline-dot--completed { background: var(--success); }
.timeline-dot--scheduled { background: var(--text-muted); }

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.timeline-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.5;
}

.maintenance-card {
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(83,140,190,0.2);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}

.maintenance-header { padding: 1rem 1.25rem; }

.maintenance-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.maintenance-badge--scheduled { background: rgba(83,140,190,0.15); color: var(--primary-light); }
.maintenance-badge--in_progress { background: rgba(249,115,22,0.15); color: var(--orange); }
.maintenance-badge--completed { background: rgba(16,185,129,0.15); color: var(--success); }

.incident-severity-badge,
.incident-status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.incident-severity-badge--minor { background: rgba(234,179,8,0.15); color: var(--warning); }
.incident-severity-badge--major { background: rgba(249,115,22,0.15); color: var(--orange); }
.incident-severity-badge--critical { background: rgba(239,68,68,0.15); color: var(--danger); }
.incident-status-badge--investigating { background: rgba(239,68,68,0.15); color: var(--danger); }
.incident-status-badge--identified { background: rgba(249,115,22,0.15); color: var(--orange); }
.incident-status-badge--monitoring { background: rgba(83,140,190,0.15); color: var(--primary-light); }
.incident-status-badge--resolved { background: rgba(16,185,129,0.15); color: var(--success); }

.maintenance-title { font-size: 1rem; font-weight: 600; margin: 0.5rem 0 0.25rem; }
.maintenance-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.maintenance-schedule {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.maintenance-services { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.4rem; }

.maintenance-card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.maintenance-card--link:hover {
    border-color: rgba(83,140,190,0.4);
    background: rgba(83,140,190,0.08);
}

.maint-detail-card {
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.maint-detail-header {
    padding: 1.25rem 1.5rem;
}

.maint-detail-meta {
    margin-bottom: 0.75rem;
}
.badge-group {
    display: inline-flex;
    border-radius: 5px;
    overflow: hidden;
}
.badge-group .incident-severity-badge,
.badge-group .incident-status-badge {
    border-radius: 0;
}

.maint-detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.maint-detail-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.maint-detail-services {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.maint-detail-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
    border-top: 1px solid var(--glass-border);
}

.maint-date-item {
    padding: 0.75rem 1.5rem;
    border-right: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}
.maint-date-item:last-child { border-right: none; border-bottom: none; }

.maint-date-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    opacity: 0.7;
}

.maint-date-value {
    font-size: 0.85rem;
    font-weight: 500;
}

.maint-detail-card--timeline { padding: 0; }
.incident-timeline--standalone { border-top: none; padding-top: 1.25rem; }

.history-item {
    display: block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.25rem;
    margin-bottom: 0.5rem;
    transition: background 0.2s, border-color 0.2s;
}
.history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}
.history-item--minor { border-left-color: var(--warning); }
.history-item--major { border-left-color: var(--orange); }
.history-item--critical { border-left-color: var(--danger); }

.history-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}

.history-title { font-size: 0.88rem; font-weight: 500; color: var(--text); }
.history-item:hover .history-title { color: var(--primary-light); }

.history-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.history-services {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.history-services::after {
    content: '·';
    margin-left: 0.25rem;
    opacity: 0.4;
}
.history-date {
    opacity: 0.7;
}

.lang-switcher { display: flex; gap: 0.3rem; }
.lang-opt { padding: 0.3rem 0.6rem; border-radius: 5px; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-decoration: none; transition: all 0.3s; border: 1px solid transparent; }
.lang-opt:hover { color: var(--text); }
.lang-active { color: var(--primary-light); background: rgba(83,140,190,0.1); border-color: rgba(83,140,190,0.3); }

.subscribe-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(83,140,190,0.12);
    color: var(--primary-light);
    border: 1px solid rgba(83,140,190,0.25);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.85rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.subscribe-trigger:hover {
    background: rgba(83,140,190,0.2);
    border-color: rgba(83,140,190,0.4);
}
.subscribe-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3,7,18,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.subscribe-overlay.open { display: flex; }
.subscribe-modal {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 360px;
    max-width: calc(100vw - 2rem);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    position: relative;
}
.subscribe-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.subscribe-modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.subscribe-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.subscribe-modal-close:hover { color: var(--text); }
.subscribe-modal-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.subscribe-form {
    display: flex;
    gap: 0.5rem;
}

.subscribe-input {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}
.subscribe-input:focus { border-color: var(--primary); }
.subscribe-input::placeholder { color: var(--text-muted); }

.subscribe-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.subscribe-btn:hover { background: var(--primary-light); }
.subscribe-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.subscribe-msg {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    display: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}
.subscribe-msg--ok {
    background: rgba(16,185,129,0.1);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.2);
}
.subscribe-msg--error {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.2);
}

.last-incident-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.5rem;
    background: rgba(16,185,129,0.06);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: var(--radius);
    color: var(--success);
    font-size: 0.85rem;
}
.last-incident-card strong {
    color: var(--text);
    font-weight: 600;
}
.last-incident-card svg {
    flex-shrink: 0;
}
.last-incident-sep {
    margin: 0 0.2em;
    color: rgba(255, 255, 255, 0.35);
}

.uptime-tooltip {
    position: fixed;
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text);
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.page-footer {
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    position: relative;
    z-index: 1;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-text { color: var(--text-muted); font-size: 0.82rem; }
.footer-text a { color: var(--primary-light); text-decoration: none; }
.footer-text a:hover { text-decoration: underline; }

.section-header-public {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.section-header-public .section-title { margin-bottom: 0; }
.loc-select option { background: #0a0f1a; color: var(--text); }


.service-row[data-service-id],
.instance-card[data-service-id] { transition: opacity 0.2s; }
.service-row:has(.response-badge),
.instance-card:has(.instance-rt) { cursor: pointer; }
.service-row:has(.response-badge):hover,
.instance-card:has(.instance-rt):hover { background: rgba(255,255,255,0.02); }

.rt-chart-panel {
    background: rgba(0,0,0,0.25);
    border-top: 1px solid var(--glass-border);
    padding: 0.75rem;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    position: relative;
}
.rt-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.rt-chart-ranges { display: flex; gap: 0.25rem; }
.rt-range {
    background: rgba(255,255,255,0.06);
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--text-muted);
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.rt-range:hover { color: var(--text); border-color: var(--glass-border); }
.rt-range.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rt-chart-avg {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.rt-chart-panel canvas {
    width: 100%;
    height: 140px;
    border-radius: 6px;
}
.rt-chart-tooltip {
    position: absolute;
    display: none;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .header-inner { padding: 0.75rem 1rem; }
    .back-link span, .back-link { font-size: 0.8rem; }
    .admin-link { font-size: 0.8rem; }
    .header-right { gap: 0.5rem; }
    .status-banner { padding: 1.5rem; }
    .uptime-bars { gap: 1px; height: 28px; }
    .service-status { min-width: 80px; font-size: 0.75rem; }
    input, select { font-size: 16px !important; }
}

@media (max-width: 640px) {
    main { padding: 1.5rem 1rem; }
    .status-banner { padding: 1.5rem 1rem; }
    .status-banner-title { font-size: 1.25rem; }

    .service-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    .service-right {
        width: 100%;
        align-items: flex-end;
        gap: 0.75rem;
    }

    .uptime-bars-wrap { flex: 1; }

    .service-status { min-width: auto; font-size: 0.75rem; }

    .subscribe-form { flex-direction: column; }
    .subscribe-input, .subscribe-btn { font-size: 16px !important; }

    .uptime-summary { grid-template-columns: 1fr; }

    .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }

    .incident-header { padding: 0.75rem 1rem; }
    .incident-timeline { padding: 0 1rem 0.75rem; }
    .maintenance-header { padding: 0.75rem 1rem; }
    .category-name { padding: 0.6rem 1rem; }
    .service-row { padding: 0.65rem 1rem; }
    .maint-detail-header { padding: 1rem; }
    .maint-date-item { padding: 0.65rem 1rem; }
    .maint-detail-dates { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 400px) {
    main { padding: 1rem 0.75rem; }
    .header-inner { padding: 0.6rem 0.75rem; }
    .back-link { font-size: 0; gap: 0; min-width: 32px; min-height: 32px; justify-content: center; }
    .back-link svg { width: 18px; height: 18px; flex-shrink: 0; }
    .admin-link { font-size: 0; gap: 0; min-width: 32px; min-height: 32px; justify-content: center; }
    .admin-link svg { width: 18px; height: 18px; flex-shrink: 0; }
    .logo-badge { font-size: 8px; padding: 2px 5px; }
    .section-title { font-size: 1rem; }
    .status-banner { padding: 1.25rem 0.75rem; margin-bottom: 1.5rem; }
    .section { margin-bottom: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .particles, .glow-blob { display: none; }
}

@media print {
    body { background: #fff; color: #111; }
    .particles, .glow-blob, .grid-pattern, header, .subscribe-overlay, #subscribeTrigger, .push-toggle, .skip-link, footer { display: none; }
    main { padding: 1rem; }
    .status-banner { background: #f8f8f8; border: 1px solid #ddd; color: #111; }
    .status-banner-title, .status-banner-time { color: #111; }
    .section-card, .incident-card, .maintenance-card { background: #fff; border: 1px solid #ddd; break-inside: avoid; }
    .category-name, .service-row, .incident-header { color: #111; }
    .service-status { filter: none; }
    .uptime-bar { height: 16px; }
    a { color: #111; text-decoration: underline; }
}
