:root {
    --primary: #c52a31;
    --primary-dark: #a21b23;
    --primary-soft: #fff1f2;

    --bg: #f4f7fb;
    --card-bg: #ffffff;
    --soft-bg: #f8fafc;

    --text: #1f2937;
    --text-dark: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;

    --success-bg: #ecfdf5;
    --success-text: #047857;
    --success-border: #a7f3d0;
    --success-dot: #10b981;

    --terminal-bg: #111827;
    --terminal-header: #1f2937;
    --terminal-text: #ffffff;

    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.12);

    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 8px;
}

/* RESET */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at top, rgba(0, 138, 213, 0.12), transparent 35%),
        linear-gradient(135deg, rgba(0, 138, 213, 0.04) 25%, transparent 25%),
        var(--bg);
    background-size: auto, 32px 32px, auto;
    color: var(--text);
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 10000;
    transform: translateY(-150%);
    padding: 10px 14px;
    color: #ffffff;
    background: var(--text-dark);
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.skip-link:focus {
    transform: translateY(0);
}

/* MAIN WRAPPER */
.container {
    width: min(94%, 1080px);
    margin: 32px auto;
    padding: 30px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
}

/* BRAND */
.brand-area {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.hero-intro {
    max-width: 680px;
    margin: 0 auto 26px;
}

.hero-intro h1 {
    margin: 3px 0 8px;
    color: var(--text-dark);
    font-size: clamp(26px, 5vw, 38px);
    line-height: 1.15;
}

.hero-intro p:last-child {
    color: var(--muted);
    font-size: 16px;
}

.eyebrow,
.section-heading span {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
    align-items: start;
    gap: 20px;
}

.logo {
    display: block;
    width: 200px;
    max-width: 70%;
    height: auto;
    margin: 0;
}

.service-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: fit-content;
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.service-status span {
    position: relative;
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: var(--success-dot);
    border-radius: 50%;
}

.service-status span::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.25);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* INFO BOXES */
.info-box,
.device-info-box {
    padding: 22px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.info-box {
    background: linear-gradient(145deg, #087fbd, #00a4e4);
    color: #ffffff;
}

.device-info-box {
    background: var(--soft-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.info-box h2,
.device-info-box h2 {
    text-align: center;
    line-height: 1.3;
    margin-bottom: 6px;
}

.device-info-box h2 {
    color: var(--text-dark);
}

.device-info-box .info-row,
.device-info-box .user-agent-details {
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

.device-info-box .info-label {
    flex-basis: auto;
}

.data-notice {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    color: var(--text);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.info-label {
    flex: 0 0 210px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
}

.info-data {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 15px;
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* MAIN IP CARD */
.main-ip-card {
    background: #ffffff;
    color: var(--text-dark);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.main-ip-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 700;
}

.main-ip-card strong,
#ip-address {
    font-weight: 700;
    letter-spacing: 0.2px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.main-ip-card strong {
    font-size: clamp(24px, 5vw, 34px);
    line-height: 1.2;
}

/* BUTTONS */
.copy-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.copy-btn:active {
    transform: translateY(1px);
}

.copy-btn:focus-visible,
.map-link:focus-visible,
footer a:focus-visible {
    outline: 3px solid rgba(0, 138, 213, 0.25);
    outline-offset: 3px;
}

/* SMALL ELEMENTS */
.flag {
    height: 20px;
    width: auto;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.map-link {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.map-link:hover {
    text-decoration: underline;
}

.qr-code {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 4px;
    background: #ffffff;
}

/* DEVICE INFO */
.device-badge {
    display: inline-flex;
    align-items: center;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border: 1px solid rgba(0, 138, 213, 0.25);
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
}

.user-agent-details {
    background: #ffffff;
    color: var(--text);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    border: 1px solid var(--border);
}

.user-agent-details summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-dark);
}

.user-agent-raw {
    margin-top: 10px;
    padding: 10px;
    background: var(--soft-bg);
    border-radius: var(--radius-sm);
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* SECTIONS */
.section-divider {
    margin: 28px 0;
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.content-section {
    background-color: var(--soft-bg);
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: left;
}

.content-section h2 {
    color: var(--primary);
    margin-top: 26px;
    margin-bottom: 10px;
    line-height: 1.35;
    font-size: 22px;
}

.content-section h2:first-child {
    margin-top: 0;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h2,
.section-heading h2:first-child {
    margin: 4px 0 0;
    color: var(--text-dark);
    font-size: clamp(24px, 4vw, 30px);
}

.section-heading.compact {
    margin-bottom: 16px;
}

.content-section h3 {
    color: var(--text);
    margin-top: 18px;
    margin-bottom: 8px;
    font-size: 18px;
}

.content-section p {
    margin-bottom: 18px;
    color: #374151;
    font-size: 15px;
}

.content-section code {
    background: #eef2f7;
    padding: 2px 6px;
    border-radius: 5px;
    font-family: Consolas, Monaco, monospace;
}

/* TOOL SECTION */
.tool-section {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.tool-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
}

.tool-card h2 {
    margin-top: 0;
    font-size: 18px;
}

.tool-card p {
    min-height: 72px;
    font-size: 14px;
}

.tool-card .terminal-box {
    margin-bottom: 0;
}

.terminal-box {
    background: var(--terminal-bg);
    border-radius: 12px;
    overflow: hidden;
    margin: 12px 0 24px;
    box-shadow: var(--shadow-md);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--terminal-header);
    padding: 10px 12px;
    color: #d1d5db;
    font-size: 13px;
}

.terminal-header span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6b7280;
}

.terminal-header strong {
    margin-left: 6px;
    font-weight: 600;
}

.terminal-body {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 14px;
    padding: 14px;
    overflow: hidden;
}

.terminal-body code {
    color: var(--terminal-text);
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
}

.terminal-body .copy-btn {
    justify-self: start;
}

/* PRIVACY */
.privacy-note {
    background: var(--primary-soft);
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: var(--radius-md);
    margin: 22px 0;
}

.privacy-note h2 {
    margin-top: 0;
}

/* TOAST */
.toast-message {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: var(--terminal-bg);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* FOOTER */
footer {
    margin-top: auto;
    font-size: 13px;
    text-align: center;
    padding: 16px 10px 22px;
    color: var(--muted);
}

footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

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

.accordion-item summary:focus-visible,
.user-agent-details summary:focus-visible {
    outline: 3px solid rgba(0, 138, 213, 0.25);
    outline-offset: 3px;
}
.accordion-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.accordion-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.accordion-item summary {
    position: relative;
    cursor: pointer;
    list-style: none;
    padding: 14px 46px 14px 16px;
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.4;
}

.accordion-item summary::-webkit-details-marker {
    display: none;
}

.accordion-item summary::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    line-height: 1;
}

.accordion-item[open] summary {
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.accordion-item[open] summary::after {
    content: "−";
    background: var(--primary);
    color: #ffffff;
}

.accordion-item p {
    margin: 0;
    padding: 14px 16px 16px;
    color: #374151;
    font-size: 15px;
}

.accordion-item code {
    background: #eef2f7;
    padding: 2px 6px;
    border-radius: 5px;
    font-family: Consolas, Monaco, monospace;
}

@media (max-width: 640px) {
    .container {
        width: 94%;
        margin: 18px auto;
        padding: 16px;
        border-radius: 14px;
    }

    .info-box,
    .device-info-box {
        padding: 16px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .info-label {
        flex: none;
        font-size: 14px;
    }

    .info-data {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
        font-size: 14px;
    }

    .copy-btn {
        margin-left: auto;
    }

    .main-ip-card .copy-btn {
        margin-left: 0;
    }

    .terminal-body {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .terminal-body .copy-btn {
        margin-left: 0;
    }

    .terminal-body code {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .content-section {
        padding: 20px;
    }

    .content-section h2 {
        font-size: 20px;
    }

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

    .tool-card p {
        min-height: 0;
    }

    .toast-message {
        right: 12px;
        left: 12px;
        bottom: 12px;
        text-align: center;
    }
}

@media (max-width: 860px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .brand-area {
        flex-direction: column;
        justify-content: center;
    }
}

/* Netopsiyon IP: shared navigation, utility pages and readable results. */
body { background: #f5f5f5; }
.container { width: min(94%, 1160px); padding: 30px; text-align: left; }
.brand-area > a { display: inline-block; flex: 0 1 360px; }
.brand-area .logo { width: 360px; max-width: 100%; height: auto; }
.brand-caption { font-size: 14px; color: var(--muted); }
.hero-intro { text-align: center; margin: 32px auto; }
.site-nav { display: flex; gap: 5px; flex-wrap: wrap; padding: 16px 0; margin: 16px 0 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.site-nav a { display: block; color: #374151; font-weight: 600; padding: 8px 12px; border-radius: 6px; text-decoration: none; font-size: 14px; }
.site-nav a:hover { color: var(--primary-dark); background: var(--primary-soft); }
.site-nav a[aria-current] { color: #fff; background: var(--primary); font-weight: 750; }
.site-nav a[aria-current]:hover { background: var(--primary-dark); }
footer nav a[aria-current] { font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; }
.brand-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 14px; }
.language-switch { display: flex; gap: 2px; text-align: right; font-size: 13px; margin: 0; padding: 3px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.language-switch a { display: inline-block; padding: 5px 9px; border-radius: 5px; text-decoration: none; }
.language-switch a[aria-current] { background: var(--primary-soft); color: var(--primary-dark); font-weight: 750; }
a { color: var(--primary-dark); text-underline-offset: 3px; }
.info-box { background: #282a30; }
.info-box h2, .device-info-box h2 { text-align: left; font-size: 19px; }
.info-label { flex-basis: 150px; font-size: 14px; }
.info-data { flex-wrap: wrap; font-size: 14px; }
.info-data .copy-btn { padding: 5px 8px; font-size: 12px; }
.protocol-note { font-size: 12px; color: #dedee4; }
.copy-btn { background: var(--primary); min-height: 34px; font-weight: 600; }
.copy-btn:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid #7f1d1d; outline-offset: 3px; }
.network-tools { margin: 32px 0; }
.tool-links { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.tool-links > a { display: flex; justify-content: space-between; gap: 12px; padding: 20px; background: var(--soft-bg); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; font-weight: 650; color: #222; }
.tool-links > a:hover { border-color: var(--primary); color: var(--primary-dark); }
.tool-links span { color: var(--primary); }
.endpoint-list { margin: 20px 0; }
.api-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.api-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.api-table caption { caption-side: bottom; padding: 12px 16px; color: var(--muted); text-align: left; font-size: 13px; }
.api-table th, .api-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.api-table thead { background: #eeeef1; color: var(--text-dark); }
.api-table tbody th { font-weight: 650; }
.api-table code { white-space: nowrap; color: var(--text-dark); background: var(--soft-bg); }
.api-table td:last-child { width: 1%; white-space: nowrap; }
.api-table .copy-btn { font-size: 12px; padding: 7px 10px; }
.api-note { margin-top: 14px; font-size: 14px; }
.api-note summary { cursor: pointer; color: var(--muted); }
.api-note p { margin-top: 10px; }
.tool-workspace { width: 100%; margin: 0 0 28px; border: 1px solid var(--border); border-top: 3px solid var(--primary); border-radius: 12px; background: var(--soft-bg); padding: 24px; }
form { display: grid; gap: 10px; }
.local-analysis-fields { display: grid; gap: 10px; min-width: 0; border: 0; padding: 0; margin: 0; }
.gateway-fields { display: grid; gap: 10px; }
.gateway-fields [hidden] { display: none; }
.gateway-fields label { display: block; margin-bottom: 5px; }
.example-btn { padding: 0; border: 0; color: var(--primary-dark); background: transparent; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.subnet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.subnet-table-wrap { margin-top: 12px; max-height: 430px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.subnet-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.subnet-table th, .subnet-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.subnet-table th { position: sticky; top: 0; background: #eeeef1; color: var(--text-dark); }
.subnet-table td:first-child { white-space: nowrap; font-family: Consolas, monospace; }
.subnet-table td:last-child { text-align: right; }
.subnet-table .copy-btn { padding: 5px 8px; font-size: 12px; }
.subnet-table .address-network, .subnet-table .address-broadcast { color: #666; background: #f2f3f5; }
.subnet-table .address-gateway { background: var(--primary-soft); color: var(--primary-dark); font-weight: 650; }
form label { font-weight: 650; }
input, select, textarea { font: inherit; width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid #9ca3af; border-radius: 7px; background: white; color: var(--text-dark); }
input[type=checkbox] { width: auto; flex: none; }
.checkbox-label { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
form button { justify-self: start; margin: 6px 0; padding: 11px 22px; }
#tool-result { margin-top: 20px; overflow-wrap: anywhere; }
#tool-result:empty { margin: 0; }
#tool-result .info-row { margin: 8px 0; border: 1px solid var(--border); }
#tool-result .info-row span { overflow-wrap: anywhere; text-align: right; max-width: 70%; }
#tool-result textarea { margin: 10px 0; font-family: Consolas, monospace; font-size: 13px; }
.muted { color: #575d67; font-size: 14px; margin: 14px 0; }
.tool-explainer, .article { width: 100%; margin: 0 0 24px; }
.article { background: white; padding: 0 0 24px; line-height: 1.85; }
.article h2 { margin-top: 30px; color: #222; font-size: 23px; }
.article h3 { margin-top: 22px; }
.article p, .article ul, .article ol { margin: 15px 0; }
.article li { margin: 8px 0 8px 24px; }
.article pre { padding: 16px; overflow-x: auto; background: #20242c; color: #fff; border-radius: 8px; font-size: 14px; }
.guide-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.guide-list article { border: 1px solid var(--border); border-radius: 10px; padding: 22px; background: var(--soft-bg); }
.guide-list h2 { font-size: 19px; line-height: 1.4; margin-bottom: 10px; }
.guide-list p { color: #575d67; font-size: 14px; }
footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-bottom: 12px; }
.terminal-body code { white-space: normal; overflow-wrap: anywhere; }
.service-status span::after { animation: none; }
@media (max-width: 640px) {
  .container { padding: 16px; margin: 12px auto; }
  .brand-area { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .brand-area > a { flex: 1 1 260px; max-width: 360px; }
  .brand-caption { font-size: 12px; text-align: right; }
  .service-status { font-size: 11px; padding: 6px 8px; }
  .site-nav { gap: 2px; padding: 10px 0; }
  .site-nav a { padding: 8px; font-size: 13px; }
  .tool-links, .guide-list { grid-template-columns: 1fr; }
  .tool-links > a { padding: 16px; }
  .tool-workspace { padding: 18px; }
  .article { padding: 0 0 16px; }
  .info-label { flex-basis: auto; }
  .info-data .copy-btn { margin-left: 0; }
  #tool-result .info-row span { max-width: 100%; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
