* {
    box-sizing: border-box;
}

:root {
    --navy: #203b60;
    --navy-dark: #182f4d;
    --blue: #1769e0;
    --blue-soft: #eaf3ff;
    --green: #18a267;
    --green-dark: #078452;
    --green-soft: #eafaf4;
    --border: #d9e4ef;
    --text: #15345d;
    --muted: #64748b;
    --white: #ffffff;
    --danger: #c63d3d;
    --shadow: 0 5px 18px rgba(25, 56, 90, .07);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: #f4f8fc;
}

.topbar {
    min-height: 74px;
    background: linear-gradient(110deg, var(--navy-dark), var(--navy));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3.2%;
    gap: 24px;
}

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

.brand-icon {
    width: 46px;
    height: 46px;
    border: 3px solid #4aa2ff;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #4aa2ff;
    font-size: 30px;
}

.brand strong {
    display: block;
    font-size: 27px;
    letter-spacing: -.5px;
}

.brand span {
    display: block;
    color: #b9cae1;
    font-size: 13px;
    margin-top: 1px;
}

.main-nav {
    display: flex;
    align-self: stretch;
    gap: 8px;
}

.main-nav a {
    color: #d9e5f3;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 16px;
    border-bottom: 4px solid transparent;
    white-space: nowrap;
    font-size: 14px;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fff;
    border-bottom-color: #2587ff;
}

.container {
    width: min(1470px, 94%);
    margin: 27px auto;
}

.top-grid,
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.card,
.tool-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card {
    padding: 16px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.card-title h1,
.card-title h2 {
    margin: 0;
    font-size: 20px;
}

.title-icon {
    font-size: 25px;
    color: #15528c;
}

.ip-display {
    background: linear-gradient(100deg, #edf6ff, #f7fbff);
    border-radius: 7px;
    padding: 14px 17px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 17px;
}

.ip-display > span:first-child {
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 800;
    letter-spacing: -1px;
}

.badge {
    background: #2f7ff2;
    color: white;
    padding: 6px 11px;
    border-radius: 7px;
    font-weight: 700;
    font-size: 13px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 235px;
    gap: 20px;
    align-items: center;
}

.details > div {
    display: grid;
    grid-template-columns: 28px 125px 1fr;
    align-items: center;
    min-height: 41px;
    font-size: 14px;
}

.detail-icon {
    color: #1c5eaa;
    font-size: 18px;
}

.notice {
    border: 1px solid #92e3c1;
    background: #f0fff8;
    border-radius: 7px;
    padding: 13px;
    color: #166044;
    font-size: 13px;
}

.notice strong {
    display: block;
    margin-bottom: 7px;
}

.notice p {
    margin: 0;
    line-height: 1.5;
}

.map-card {
    padding-bottom: 12px;
}

#map {
    height: 263px;
    border-radius: 7px;
    overflow: hidden;
    background: #dfeaf2;
}

.map-note {
    margin: 8px 3px 0;
    color: var(--muted);
    font-size: 11px;
}

.tools-grid {
    margin-top: 18px;
    align-items: start;
}

.tool-card {
    min-height: 490px;
}

.tool-header {
    color: white;
    padding: 14px 19px;
    display: flex;
    align-items: center;
    gap: 11px;
}

.tool-header span {
    font-size: 27px;
}

.tool-header h2 {
    font-size: 19px;
    margin: 0;
}

.tool-card.blue .tool-header {
    background: linear-gradient(90deg, #236dcc, #1e5ca9);
}

.tool-card.green .tool-header {
    background: linear-gradient(90deg, #0d9b62, #16a268);
}

.tool-body {
    padding: 19px 21px 23px;
}

label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 9px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 123px;
    gap: 15px;
}

input {
    width: 100%;
    border: 1px solid #cddbea;
    border-radius: 6px;
    padding: 12px 13px;
    font-size: 14px;
    outline: none;
    color: var(--text);
    background: white;
}

input:focus {
    border-color: #4b96e9;
    box-shadow: 0 0 0 3px rgba(42, 125, 226, .1);
}

button {
    border: 0;
    border-radius: 6px;
    padding: 11px 18px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: transform .12s ease, filter .12s ease;
}

button:hover {
    filter: brightness(1.05);
}

button:active {
    transform: translateY(1px);
}

.form-row button {
    background: #1769e0;
}

.range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 27px;
}

.wide-btn {
    width: 100%;
    margin-top: 18px;
    background: var(--green);
}

.results {
    margin-top: 23px;
    border: 1px solid #cfe2f7;
    background: linear-gradient(145deg, #f3f9ff, #fff);
    border-radius: 7px;
    padding: 12px;
}

.green-results {
    border-color: #cfe8dd;
    background: linear-gradient(145deg, #f2fbf7, #fff);
}

.results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
}

.results h3 {
    margin: 0;
    font-size: 17px;
}

.copy-btn {
    color: #1664b5;
    background: transparent;
    font-size: 19px;
    padding: 2px 5px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,.65);
}

th,
td {
    border: 1px solid #d7e4f1;
    padding: 7px 9px;
    text-align: left;
    font-size: 13px;
}

th {
    width: 40%;
    font-weight: 700;
}

.green-results th,
.green-results td {
    border-color: #d6e9e1;
}

.range-note {
    border: 1px solid #a5e0c8;
    background: #effcf6;
    border-radius: 6px;
    margin-top: 11px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #28674e;
}

.error {
    display: none;
    margin-top: 10px;
    color: var(--danger);
    background: #fff0f0;
    border: 1px solid #f2c4c4;
    border-radius: 6px;
    padding: 9px 11px;
    font-size: 13px;
}

.error.visible {
    display: block;
}

.hidden {
    display: none;
}

.about {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.about h2,
.about h3 {
    margin-top: 0;
}

.about p,
.about li {
    color: #53677f;
    font-size: 14px;
    line-height: 1.65;
}

.about ul {
    margin-bottom: 0;
}

footer {
    background: linear-gradient(100deg, #1b3659, #213e63);
    color: #b8c8dc;
    min-height: 66px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 11px;
    font-size: 12px;
    margin-top: 27px;
}

@media (max-width: 1050px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 12px;
    }

    .main-nav {
        width: 100%;
        overflow-x: auto;
        min-height: 48px;
    }

    .main-nav a {
        padding: 0 11px;
    }

    .top-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .container {
        width: 94%;
    }

    .details-grid,
    .about,
    .range-inputs {
        grid-template-columns: 1fr;
    }

    .details > div {
        grid-template-columns: 28px 105px 1fr;
    }

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

    .ip-display {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    #map {
        height: 240px;
    }

    .brand strong {
        font-size: 23px;
    }
}

.map-warning::after {
    content: attr(data-map-status);
    position: absolute;
    z-index: 1000;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: rgba(255,255,255,.94);
    border: 1px solid #e6c9a1;
    border-radius: 6px;
    padding: 7px 10px;
    color: #7b5a2e;
    font-size: 11px;
    pointer-events: none;
}

.map-warning, .map-fallback {
    position: relative;
}

#map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.map-message {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 30px;
    text-align: center;
    color: #53677f;
    background: #edf4f8;
    font-size: 14px;
}
