:root {
    --subnet-blue: #3545b0;
    --subnet-blue-light: #8796ff;
}

body.subnet-page {
    min-height: 100vh;
    display: block;
    padding: 0;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(53, 69, 176, .16),
            transparent 30%
        ),
        linear-gradient(
            180deg,
            #080b0f 0%,
            #05070a 100%
        );
}

.subnet-shell {
    width: min(calc(100% - 40px), 1120px);
    margin: 0 auto;
    padding: 34px 0 64px;
}

.subnet-nav {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 76px;
}

.subnet-back {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.subnet-nav-meta {
    color: #5f6e79;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.subnet-header {
    max-width: 940px;
    margin-bottom: 56px;
}

.subnet-header h1 {
    margin-top: 20px;
    font-size: clamp(58px, 9.2vw, 116px);
    line-height: .84;
    letter-spacing: -.06em;
}

.subnet-tagline {
    margin: 31px 0 0;
    color: var(--text);
    font-size: clamp(21px, 2.5vw, 29px);
    line-height: 1.35;
    font-weight: 620;
}

.subnet-intro {
    max-width: 800px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.subnet-checker,
.subnet-result {
    overflow: hidden;
    background: rgba(12, 18, 24, .80);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.subnet-checker {
    padding: 28px 30px 30px;
}

.subnet-checker-head,
.subnet-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.subnet-kicker {
    color: var(--subnet-blue-light);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .17em;
}

.subnet-checker h2,
.subnet-summary h2 {
    margin: 9px 0 0;
    color: var(--text);
    font-size: 28px;
    line-height: 1.1;
}

.subnet-mode {
    padding: 7px 10px;
    color: #8796ff;
    background: rgba(53, 69, 176, .08);
    border: 1px solid rgba(53, 69, 176, .42);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .12em;
}

.subnet-form {
    margin-top: 28px;
}

.subnet-label {
    display: block;
    margin-bottom: 9px;
    color: #8a98a3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.subnet-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.subnet-input-row input {
    min-width: 0;
    height: 54px;
    padding: 0 17px;
    color: var(--text);
    background: #080d12;
    border: 1px solid #26313a;
    border-radius: 9px;
    outline: none;
    font: inherit;
    font-size: 16px;
}

.subnet-input-row input:focus {
    border-color: var(--subnet-blue);
    box-shadow: 0 0 0 3px rgba(53, 69, 176, .12);
}

.subnet-input-row button {
    height: 54px;
    padding: 0 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #fff;
    background: var(--subnet-blue);
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.subnet-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.subnet-presets button {
    min-height: 30px;
    padding: 0 10px;
    color: #7e8d98;
    background: #0a1015;
    border: 1px solid #26313a;
    border-radius: 999px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 820;
}

.subnet-presets button:hover,
.subnet-presets button:focus-visible {
    color: #aab5ff;
    border-color: rgba(53,69,176,.65);
}

.subnet-hint {
    margin: 10px 0 0;
    color: #596873;
    font-size: 11px;
}

.subnet-hint code {
    color: #8c99a3;
}

.subnet-error {
    margin-top: 18px;
    padding: 15px 18px;
    color: #ff9ba5;
    background: rgba(239,98,112,.07);
    border: 1px solid rgba(239,98,112,.28);
    border-radius: 10px;
    font-size: 13px;
}

.subnet-result {
    margin-top: 24px;
}

.subnet-summary {
    padding: 27px 30px;
    border-bottom: 1px solid var(--border);
}

.subnet-summary p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.subnet-summary-badge {
    padding: 7px 10px;
    color: #8796ff;
    background: rgba(53,69,176,.08);
    border: 1px solid rgba(53,69,176,.42);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .12em;
}

.subnet-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--border);
}

.subnet-card {
    min-height: 145px;
    padding: 22px 20px;
    border-right: 1px solid rgba(255,255,255,.055);
    border-bottom: 1px solid rgba(255,255,255,.055);
}

.subnet-card:nth-child(4n) {
    border-right: 0;
}

.subnet-card-primary {
    background:
        linear-gradient(
            125deg,
            rgba(53,69,176,.15),
            rgba(53,69,176,.025)
        );
}

.subnet-card-label {
    display: block;
    color: #6e7d88;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .12em;
}

.subnet-card strong {
    display: block;
    margin-top: 17px;
    color: #eef1f4;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 19px;
    overflow-wrap: anywhere;
}

.subnet-card small {
    display: block;
    margin-top: 8px;
    color: #687781;
    font-size: 10px;
    line-height: 1.4;
}

.subnet-binary {
    padding: 25px 30px 0;
}

.subnet-binary-head h3 {
    margin: 8px 0 16px;
    font-size: 18px;
}

.subnet-binary-table {
    overflow: hidden;
    border: 1px solid #202a32;
    border-radius: 10px;
}

.subnet-binary-row {
    display: grid;
    grid-template-columns: 100px minmax(0,1fr);
    gap: 18px;
    padding: 11px 13px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    color: #75838d;
    font-size: 11px;
}

.subnet-binary-row:last-child {
    border-bottom: 0;
}

.subnet-binary-row code {
    color: #b9c4cc;
    background: transparent;
    overflow-wrap: anywhere;
    font-size: 11px;
}

.subnet-explainer {
    margin: 24px 30px 30px;
    padding: 18px 20px;
    background:
        linear-gradient(
            100deg,
            rgba(53,69,176,.13),
            rgba(53,69,176,.035)
        );
    border: 1px solid rgba(53,69,176,.28);
    border-radius: 10px;
}

.subnet-explainer-label {
    display: block;
    margin-bottom: 10px;
    color: #8796ff;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .15em;
}

.subnet-explainer p {
    margin: 0 0 10px;
    color: #9aa7b1;
    font-size: 12px;
    line-height: 1.65;
}

.subnet-explainer p:last-child {
    margin-bottom: 0;
}

.subnet-explainer strong {
    color: #e7ebef;
}

.subnet-footer {
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #61707b;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .10em;
}

.subnet-footer-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--subnet-blue);
    box-shadow: 0 0 11px rgba(53,69,176,.9);
}

@media (max-width: 900px) {
    .subnet-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .subnet-card:nth-child(4n) {
        border-right: 1px solid rgba(255,255,255,.055);
    }

    .subnet-card:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 620px) {
    .subnet-shell {
        width: min(calc(100% - 28px), 1120px);
        padding-top: 24px;
    }

    .subnet-nav {
        margin-bottom: 52px;
    }

    .subnet-nav-meta {
        display: none;
    }

    .subnet-checker-head,
    .subnet-summary {
        flex-direction: column;
    }

    .subnet-input-row {
        grid-template-columns: 1fr;
    }

    .subnet-grid {
        grid-template-columns: 1fr;
    }

    .subnet-card,
    .subnet-card:nth-child(2n),
    .subnet-card:nth-child(4n) {
        border-right: 0;
    }

    .subnet-binary-row {
        grid-template-columns: 1fr;
    }
}
