:root {
    --bg: #020617;
    --bg-elevated: #020818;
    --bg-card: rgba(15, 23, 42, 0.92);
    --bg-card-soft: rgba(15, 23, 42, 0.8);
    --border-subtle: rgba(148, 163, 184, 0.35);
    --border-bright: rgba(148, 163, 184, 0.55);
    --accent: #22c55e;
    --accent-soft: rgba(34, 197, 94, 0.15);
    --accent-strong: rgba(34, 197, 94, 0.35);
    --accent-glow: rgba(45, 212, 191, 0.7);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-soft: #6b7280;
    --danger: #f97373;
    --warn: #facc15;

    --radius-xl: 1.5rem;
    --radius-lg: 1.1rem;
    --shadow-soft: 0 26px 80px rgba(15, 23, 42, 0.9);

    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text-main);
}

/* Layout */

.page {
    min-height: 100vh;
    position: relative;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .page {
        padding: 16px;
    }
}

/* Background grid + glows */

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.95)),
        linear-gradient(to right, rgba(15, 23, 42, 0.35) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.35) 1px, transparent 1px);
    background-size: 100% 100%, 32px 32px, 32px 32px;
    opacity: 1;
    z-index: -3;
}

.bg-glow {
    position: fixed;
    width: 36rem;
    height: 36rem;
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.65;
    z-index: -2;
}

.bg-glow--left {
    background: radial-gradient(circle, rgba(34, 197, 94, 0.58), transparent 60%);
    top: -10rem;
    left: -12rem;
}

.bg-glow--right {
    background: radial-gradient(circle, rgba(52, 211, 153, 0.4), transparent 60%);
    bottom: -8rem;
    right: -10rem;
}

/* Header */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo__icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--accent-strong);
    background:
        radial-gradient(circle at 30% 10%, rgba(45, 212, 191, 0.8), transparent 60%),
        radial-gradient(circle at 70% 80%, rgba(34, 197, 94, 0.65), transparent 60%);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.7);
    position: relative;
    overflow: hidden;
}

.site-logo__icon::after {
    content: "";
    position: absolute;
    inset: 20%;
    border-radius: inherit;
    border: 1px solid rgba(15, 23, 42, 0.7);
}

.site-logo__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-logo__title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-logo__subtitle {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.site-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Pills / buttons */

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    color: var(--text-muted);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.95));
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}

.pill--ghost {
    background: transparent;
}

.pill--small {
    font-size: 0.75rem;
    padding-inline: 12px;
}

.pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

/* Buttons */

.btn {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: radial-gradient(circle at 0 0, rgba(16, 185, 129, 0.4), rgba(5, 46, 22, 0.9));
    color: #ecfdf5;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow:
        0 0 0 1px rgba(22, 163, 74, 0.4),
        0 0 24px rgba(22, 163, 74, 0.7);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0 0, rgba(74, 222, 128, 0.4), transparent 55%);
    mix-blend-mode: screen;
    opacity: 0.8;
    pointer-events: none;
}

.btn__label {
    position: relative;
    z-index: 1;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(22, 163, 74, 0.8),
        0 0 30px rgba(34, 197, 94, 0.9);
}

.btn:active {
    transform: translateY(0);
}

/* Content */

.content {
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* Cards */

.card {
    position: relative;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 20px 20px 18px;
    backdrop-filter: blur(18px);
}

.card--hero {
    margin-bottom: 16px;
    padding: 22px 22px 18px;
    overflow: hidden;
}

.card__scanline {
    position: absolute;
    inset-inline: 0;
    height: 1px;
    top: 56px;
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.9), transparent);
    opacity: 0.4;
    transform-origin: left;
    animation: scanline 3.2s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% { transform: translateX(-50%) scaleX(0.4); opacity: 0; }
    15% { opacity: 0.6; }
    35% { transform: translateX(30%) scaleX(1); opacity: 0.2; }
    100% { transform: translateX(120%) scaleX(0.4); opacity: 0; }
}

/* Hero header */

.card__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.eyebrow {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.ip-value {
    font-size: clamp(1.9rem, 3.2vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 8px;
    word-break: break-all;
}

.ip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-bright);
    color: var(--text-muted);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.9));
}

.badge--accent {
    border-color: var(--accent-strong);
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.35);
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hint span {
    font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: rgba(15, 23, 42, 0.95);
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

/* Hero grid */

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
    gap: 16px;
}

.hero-grid__section {
    border-radius: var(--radius-lg);
    background: var(--bg-card-soft);
    border: 1px solid rgba(148, 163, 184, 0.38);
    padding: 14px 14px 12px;
}

.section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin: 0 0 8px;
}

/* Key-value list */

.key-value-list {
    margin: 0;
}

.kv-row {
    display: grid;
    grid-template-columns: 0.9fr 1.3fr;
    gap: 8px;
    margin-bottom: 6px;
    align-items: baseline;
}

.kv-row dt {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.kv-row dd {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-main);
}

.kv-row__ua {
    font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    word-break: break-all;
}

/* Secondary cards */

.card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
    gap: 16px;
    margin-top: 14px;
}

.card--secondary {
    border-radius: var(--radius-lg);
    padding: 14px 14px 12px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.device-info .kv-row {
    grid-template-columns: 0.9fr 1.3fr;
}

.device-info dt {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.device-info dd {
    margin: 0;
    font-size: 0.9rem;
}

.microcopy {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-soft);
}

/* Status pills */

.pill--status {
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.pill--status-ok {
    border-color: rgba(34, 197, 94, 0.8);
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.3);
}

.pill--status-warn {
    border-color: rgba(250, 204, 21, 0.9);
    color: #facc15;
    background: rgba(250, 204, 21, 0.06);
}

/* Footer */

.site-footer {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(31, 41, 55, 1);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-soft);
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Toast */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.96);
    color: #bbf7d0;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.8);
    padding: 6px 14px;
    font-size: 0.82rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 40;
}

.toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */

@media (max-width: 900px) {
    .card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-actions {
        align-items: flex-start;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .card-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .kv-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .device-info .kv-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card--hero {
        padding: 18px 16px 14px;
    }

    .card {
        padding-inline: 16px;
    }
}