* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    color: #fff;
}

body {
    background: linear-gradient(145deg, #0a1929 0%, #11212e 100%);
    min-height: 100vh;
    color: #f0f9ff;
}

/* ── Header ── */
.header {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.logo {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    padding: 8px 24px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.logo img {
    height: 32px;
    width: auto;
}

/* ── Wrapper ── */
.wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
}

/* ── Hero ── */
.hero {
    text-align: center;
    margin-bottom: 8px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    background: linear-gradient(to right, #fff, #b0d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.hero p {
    color: #a0b8cc;
    font-size: 1.2rem;
}

.warning {
    width: 100%;
    background: rgba(251, 176, 0, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}

/* ── Metrics row ── */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
}

.metric-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: #5a7a9a;
    text-transform: uppercase;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #aad0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.metric-value.good {
    background: linear-gradient(135deg, #2ecc71, #5effa0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-value.neutral {
    background: linear-gradient(135deg, #f0b429, #ffdc80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-unit {
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 2px;
}

/* ── Two-column grid ── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

/* ── Card base ── */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-full {
    width: 100%;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.card-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #a0b8cc;
}

.card-share {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 22px 18px;
    width: 100%;
    box-sizing: border-box;
}

.card-share-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #5f7f9d;
    text-transform: uppercase;
}

.card-share-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #d3e8ff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.share-btn i {
    font-size: 1rem;
}

.share-btn:hover {
    color: #ffffff;
}

.share-vk {
    border-color: rgba(0, 119, 255, 0.35);
    background: linear-gradient(135deg, rgba(0, 119, 255, 0.22), rgba(0, 119, 255, 0.08));
}

.share-vk:hover {
    border-color: rgba(71, 154, 255, 0.7);
    box-shadow: 0 10px 20px -12px rgba(0, 119, 255, 0.85);
}

.share-tg {
    border-color: rgba(42, 171, 238, 0.35);
    background: linear-gradient(135deg, rgba(42, 171, 238, 0.2), rgba(42, 171, 238, 0.08));
}

.share-tg:hover {
    border-color: rgba(117, 203, 255, 0.72);
    box-shadow: 0 10px 20px -12px rgba(42, 171, 238, 0.85);
}

.share-wa {
    border-color: rgba(37, 211, 102, 0.35);
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.2), rgba(37, 211, 102, 0.08));
}

.share-wa:hover {
    border-color: rgba(116, 232, 158, 0.72);
    box-shadow: 0 10px 20px -12px rgba(37, 211, 102, 0.85);
}

.flag-emoji {
    width: 20px;
    height: 20px;
    font-size: 1.4rem;
    line-height: 1;
}

.badge-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.badge {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #a0b8cc;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-online {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

/* ── Fields ── */
.fields {
    padding: 4px 0;
    flex: 1;
}

.field {
    padding: 12px 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: #4a6a8a;
    text-transform: uppercase;
}

.field-value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.field-value {
    font-size: 0.97rem;
    font-weight: 500;
    color: #e8f4ff;
}

.field-value.mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.field-value.secret {
    word-break: break-all;
    font-size: 0.78rem;
    color: #b0c8e0;
}

.copy-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    cursor: pointer;
    color: #6a8aaa;
    padding: 0;
    transition: all 0.15s;
    box-shadow: none;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.copy-btn.copied {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.4);
    color: #2ecc71;
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0 22px;
}

/* ── Card actions ── */
.card-actions {
    display: flex;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 11px 18px;
    border-radius: 40px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 24px -8px #0f2b5e;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
    box-shadow: 0 16px 28px -10px #0f2b5e;
}

.btn-primary svg {
    flex-shrink: 0;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.11);
    color: #b0c8e0;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 11px 18px;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* ── Geo grid ── */
.geo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 4px 0;
    flex: 1;
}

.geo-stat {
    padding: 12px 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.geo-stat:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.geo-stat-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: #4a6a8a;
    text-transform: uppercase;
}

.geo-stat-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: #dbeeff;
}

.geo-stat-value.mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
}

/* ── Map ── */
#map {
    height: 160px;
    width: 100%;
    filter: brightness(0.85) contrast(1.05);
}

/* ── Ping chart ── */
.chart-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 3px;
}

.chart-tab {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    border: none;
    background: transparent;
    color: #5a7a9a;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.15s;
}

.chart-tab:hover {
    color: #a0c4e0;
    background: transparent;
    box-shadow: none;
}

.chart-tab.active {
    background: rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
    box-shadow: none;
}

.chart-wrap {
    padding: 16px 22px 20px;
    height: 220px;
}

/* ── Availability grid ── */
.avail-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: #5a7a9a;
}

.avail-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.avail-dot.avail-online {
    background: #2ecc71;
}

.avail-dot.avail-degraded {
    background: #f39c12;
}

.avail-dot.avail-offline {
    background: #e74c3c;
}

.avail-grid {
    display: grid;
    grid-template-columns: repeat(30, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    padding: 14px 22px 20px;
}

.avail-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.avail-cell:hover {
    opacity: 0.75;
    transform: scale(1.2);
}

.avail-cell.avail-online {
    background: rgba(46, 204, 113, 0.6);
}

.avail-cell.avail-degraded {
    background: rgba(243, 156, 18, 0.7);
}

.avail-cell.avail-offline {
    background: rgba(231, 76, 60, 0.75);
}

/* ── Status dot ── */
.status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status.online {
    background: #2ecc71;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.7);
}

.status.offline {
    background: #e74c3c;
}

.status.degraded {
    background: #f39c12;
}

/* ── Back link ── */
.back-link {
    display: inline-block;
    margin-top: 8px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    color: #4a6a8a;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: #a0c4e0;
}

/* ── Pulse animation for map marker ── */
@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* ── Responsive ── */
@media (max-width: 820px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-actions {
        flex-direction: column;
    }

    .avail-grid {
        grid-template-columns: repeat(15, 1fr);
        grid-template-rows: repeat(6, 1fr);
    }

    .geo-grid {
        grid-template-columns: 1fr;
    }

    .geo-stat:nth-child(odd) {
        border-right: none;
    }

    .card-share-actions {
        grid-template-columns: 1fr;
    }
}