:root {
    --bg: #eef3f7;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --line: #d4deea;
    --line-strong: #b9c7d8;
    --text: #142033;
    --muted: #5f6f86;
    --brand: #d71920;
    --brand-dark: #9f1218;
    --accent: #34a853;
    --accent-dark: #1d7b3b;
    --ok: #157347;
    --warn: #9a6700;
    --bad: #b42318;
    --shadow: 0 16px 40px rgba(20, 32, 51, .09);
    --shadow-soft: 0 10px 24px rgba(20, 32, 51, .06);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: linear-gradient(180deg, #f7fafc 0, var(--bg) 44%, #edf2f6 100%);
    color: var(--text);
    font-family: "Albert Sans", "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    min-height: 72px;
    padding: 12px 48px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 26px rgba(20, 32, 51, .05);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
    font-weight: 900;
}

.brand img {
    width: 154px;
    height: auto;
    display: block;
}

.brand span {
    color: var(--brand);
    font-size: 15px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.topbar nav a {
    flex: 0 0 auto;
    padding: 9px 11px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    transition: color .16s ease, background .16s ease;
}

.topbar nav a:hover {
    color: var(--text);
    background: #eef3f9;
}

.page-shell {
    width: min(1220px, calc(100% - 32px));
    margin: 30px auto 54px;
}

.tools-header {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
    align-items: center;
    gap: 34px;
    padding: 34px;
    background: linear-gradient(135deg, #ffffff 0, #f8fbff 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.tools-header::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, var(--brand), var(--accent));
}

.tools-header img {
    width: 226px;
    max-width: 100%;
    justify-self: end;
}

.tools-hero-copy {
    min-width: 0;
}

.tools-hero-copy p:not(.eyebrow) {
    max-width: 820px;
    color: #2d3b50;
    font-size: 17px;
}

.tools-hero-aside {
    display: grid;
    gap: 18px;
    justify-items: end;
    min-width: 0;
}

.tools-hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.tools-hero-links a {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--brand);
    background: #fff;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(20, 32, 51, .05);
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.tools-hero-links a:hover {
    border-color: #c5d0de;
    background: #f2f5f9;
    transform: translateY(-1px);
}

.tools-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: min(100%, 320px);
}

.tools-hero-metrics span {
    min-width: 0;
    padding: 12px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow-soft);
}

.tools-hero-metrics strong,
.tools-hero-metrics small {
    display: block;
}

.tools-hero-metrics strong {
    color: var(--brand);
    font-size: 22px;
    line-height: 1.1;
}

.tools-hero-metrics small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 46px;
    line-height: 1.08;
}

h2 {
    margin: 26px 0 12px;
    font-size: 20px;
}

p {
    margin: 10px 0 0;
}

.muted {
    color: var(--muted);
}

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

.tool-section {
    margin-top: 26px;
}

.hub-path-grid,
.service-link-grid {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.hub-path-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.service-link-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.section-heading h2 {
    margin-top: 0;
}

.tool-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 14px;
    min-height: 144px;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.tool-card-action {
    border-color: #bdd0e3;
    background: linear-gradient(180deg, #ffffff 0, #fbfdff 100%);
}

.tool-card-action .tool-icon {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--accent-dark));
    box-shadow: 0 10px 22px rgba(215, 25, 32, .18);
}

.tool-card-action::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--accent);
}

.tool-card-action::after {
    content: ">";
    position: absolute;
    right: 14px;
    top: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
}

.tool-card:hover {
    border-color: var(--line-strong);
    box-shadow: 0 18px 34px rgba(20, 32, 51, .1);
    transform: translateY(-2px);
}

.tool-card-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-bottom: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef3f9;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
}

.tool-card-action .tool-card-badge {
    background: #edf8f1;
    color: var(--accent-dark);
}

.tool-card-cta {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 30px;
    margin-top: 12px;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
}

.hub-path-card,
.service-link-grid a {
    min-width: 0;
    min-height: 188px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.hub-path-card h3,
.service-link-grid strong {
    display: block;
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.25;
}

.hub-path-card p:not(.eyebrow),
.service-link-grid span {
    color: var(--muted);
    font-size: 14px;
}

.hub-path-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.hub-path-links a,
.service-link-grid a {
    text-decoration: none;
}

.hub-path-links a {
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--brand);
    background: var(--panel-soft);
    font-size: 13px;
    font-weight: 900;
}

.hub-path-links a:hover,
.service-link-grid a:hover {
    border-color: #c5d0de;
    background: #f2f5f9;
}

.service-link-grid strong {
    color: var(--brand);
}

.tool-icon,
.tool-nav a span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: #eef3f8;
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
}

.tool-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 18px;
    line-height: 1.22;
}

.tool-card small {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.42;
}

.tool-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    min-width: 0;
}

.tool-nav,
.tool-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 0;
    width: 100%;
}

.tool-nav {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 116px);
    overflow: auto;
    padding: 10px;
}

.tool-nav a {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 800;
    transition: color .16s ease, background .16s ease;
}

.tool-title > div,
.tool-nav a span:last-child {
    min-width: 0;
}

.tool-nav a.active,
.tool-nav a:hover {
    color: var(--text);
    background: #eef4f9;
}

.tool-nav a.active {
    box-shadow: inset 4px 0 0 var(--accent);
}

.tool-nav .back-link {
    display: block;
    grid-template-columns: none;
    margin-bottom: 8px;
    padding: 10px;
    color: var(--brand);
}

.tool-panel {
    padding: 30px;
}

.tool-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.tool-title h1 {
    font-size: 38px;
    line-height: 1.1;
}

.tool-badge {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 6px;
    background: #fff4f4;
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
}

.tool-form {
    margin-top: 22px;
}

.tool-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-weight: 800;
}

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

input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 168, 83, .16);
}

button,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s ease, transform .16s ease;
}

button:hover,
.primary-button:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
}

button:disabled,
.primary-button:disabled {
    cursor: wait;
    opacity: .82;
}

button.is-loading::before,
.primary-button.is-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: button-spin .8s linear infinite;
    flex: 0 0 auto;
}

button:disabled:hover,
.primary-button:disabled:hover {
    background: var(--brand);
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.captcha-box {
    margin-top: 14px;
}

.alert-box {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.alert-box.error {
    border-color: #f1b8b8;
    background: #fff5f5;
    color: var(--bad);
}

.result-box {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.score-row,
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.score-tile,
.metric-grid div {
    min-height: 82px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.score-tile span,
.metric-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.score-tile strong,
.metric-grid strong {
    display: block;
    margin-top: 6px;
    overflow-wrap: anywhere;
    font-size: 26px;
    line-height: 1.15;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    overflow-wrap: anywhere;
    font-size: 14px;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.kv {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.kv span,
.kv strong {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.kv span {
    background: var(--panel-soft);
    color: var(--muted);
}

.kv strong {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.clean-list,
.risk-list {
    display: grid;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.clean-list li,
.risk-list li {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
}

.risk-list li {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
}

.risk-critical strong {
    color: var(--bad);
}

.risk-warning strong {
    color: var(--warn);
}

.risk-ok strong {
    color: var(--ok);
}

pre {
    max-height: 420px;
    overflow: auto;
    padding: 14px;
    border-radius: 8px;
    background: #101828;
    color: #e8eef7;
    white-space: pre-wrap;
}

.as-path {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 14px;
}

.as-path span {
    padding: 6px 9px;
    border: 1px solid #c9d5e4;
    border-radius: 6px;
    color: var(--brand);
    background: var(--panel-soft);
    font-weight: 900;
}

.lg-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

.lg-table th,
.lg-table td {
    min-width: 92px;
}

.trace-table th:nth-child(1),
.trace-table td:nth-child(1) {
    min-width: 54px;
}

.trace-table th:nth-child(4),
.trace-table td:nth-child(4) {
    min-width: 220px;
    white-space: normal;
}

.raw-details {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.raw-details summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 900;
}

.bgp-play-form {
    margin-bottom: 18px;
}

.bgp-play-intro {
    display: grid;
    gap: 6px;
    margin: 18px 0 28px;
    padding: 22px;
    border: 1px solid #dce3eb;
    border-radius: 8px;
    background: #f7f9fb;
    color: var(--muted);
}

.bgp-play-intro strong {
    color: var(--text);
    font-size: 1.05rem;
}

.bgp-play-explainer {
    margin-top: 32px;
}

.bgp-play-explainer > h2 {
    margin-bottom: 16px;
}

.bgp-play-explainer .faq-list {
    margin-top: 22px;
}

.bgp-live-panel {
    margin: 28px 0;
    padding: 20px;
    border: 1px solid #cfd8e4;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 29, 45, .08);
}

.bgp-live-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.bgp-live-header h2 {
    margin: 2px 0 6px;
}

.bgp-live-header p:not(.eyebrow) {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
}

.bgp-live-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}

.bgp-mode-switch {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(74px, 1fr));
    min-height: 36px;
    padding: 3px;
    border: 1px solid #d9e1eb;
    border-radius: 7px;
    background: #f1f4f7;
}

.bgp-mode-switch button {
    min-height: 28px;
    padding: 0 11px;
    border: 0;
    border-radius: 5px;
    color: #526173;
    background: transparent;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.bgp-mode-switch button:hover {
    color: #1f3449;
}

.bgp-mode-switch button.is-active {
    color: #315c16;
    background: #fff;
    box-shadow: 0 2px 7px rgba(24, 42, 60, .12);
}

.bgp-mode-switch button:focus-visible,
.bgp-history-controls button:focus-visible,
.bgp-history-controls input:focus-visible,
.bgp-history-controls select:focus-visible {
    outline: 3px solid rgba(114, 183, 39, .35);
    outline-offset: 2px;
}

.bgp-live-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid #d9e1eb;
    border-radius: 6px;
    color: #415166;
    background: #f7f9fc;
    font-size: 13px;
    font-weight: 800;
}

.bgp-live-status i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e6a23c;
    box-shadow: 0 0 0 4px rgba(230, 162, 60, .13);
}

.bgp-live-status[data-state="connected"] i,
.bgp-live-status[data-state="subscribed"] i {
    background: #72b727;
    box-shadow: 0 0 0 4px rgba(114, 183, 39, .15);
    animation: bgp-live-status-pulse 1.8s ease-in-out infinite;
}

.bgp-live-status[data-state="error"] i {
    background: #d94242;
    box-shadow: 0 0 0 4px rgba(217, 66, 66, .12);
}

.bgp-live-status[data-state="paused"] i,
.bgp-live-status[data-state="complete"] i {
    background: #8793a3;
    box-shadow: none;
}

.bgp-live-status[data-state="history-loading"] i {
    background: #e6a23c;
    animation: bgp-live-status-pulse 1.1s ease-in-out infinite;
}

.bgp-live-status[data-state="history-ready"] i {
    background: #72b727;
    box-shadow: 0 0 0 4px rgba(114, 183, 39, .15);
}

.bgp-live-status[data-state="history-playing"] i {
    background: #72b727;
    box-shadow: 0 0 0 4px rgba(114, 183, 39, .15);
    animation: bgp-live-status-pulse .9s ease-in-out infinite;
}

.bgp-live-toggle {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #b9c5d3;
    border-radius: 6px;
    color: #20344b;
    background: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.bgp-live-toggle:hover {
    border-color: #72b727;
    box-shadow: 0 5px 14px rgba(38, 74, 24, .13);
    transform: translateY(-1px);
}

.bgp-live-toggle:focus-visible,
.bgp-path-choice:focus-visible {
    outline: 3px solid rgba(114, 183, 39, .35);
    outline-offset: 2px;
}

.bgp-history-controls {
    display: grid;
    gap: 13px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #d9e1e9;
    border-radius: 8px;
    background: #f7f9fb;
}

.bgp-history-controls[hidden] {
    display: none;
}

.bgp-history-range {
    display: grid;
    grid-template-columns: auto minmax(185px, 1fr) minmax(185px, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.bgp-history-presets {
    display: flex;
    gap: 5px;
}

.bgp-history-presets button,
.bgp-history-load,
.bgp-history-buttons button {
    min-height: 38px;
    border: 1px solid #cbd5df;
    border-radius: 6px;
    color: #26394d;
    background: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.bgp-history-presets button {
    min-width: 46px;
    padding: 0 9px;
}

.bgp-history-presets button:hover,
.bgp-history-presets button.is-active,
.bgp-history-buttons button:hover {
    border-color: #78b832;
    box-shadow: 0 4px 12px rgba(37, 70, 25, .12);
}

.bgp-history-presets button.is-active,
.bgp-history-buttons button.is-primary {
    color: #fff;
    border-color: #5c9d20;
    background: #5c9d20;
}

.bgp-history-range label,
.bgp-history-speed {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: #556477;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.bgp-history-range input,
.bgp-history-speed select {
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #cbd5df;
    border-radius: 6px;
    color: #24384d;
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-transform: none;
}

.bgp-history-load {
    padding: 0 16px;
    color: #fff;
    border-color: #5c9d20;
    background: #5c9d20;
}

.bgp-history-load:hover {
    border-color: #4d8b18;
    background: #4d8b18;
    box-shadow: 0 5px 14px rgba(43, 83, 25, .18);
    transform: translateY(-1px);
}

.bgp-history-load:disabled {
    cursor: wait;
    opacity: .65;
    transform: none;
}

.bgp-history-player {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) 86px;
    align-items: end;
    gap: 14px;
    padding-top: 12px;
    border-top: 1px solid #dfe5eb;
}

.bgp-history-buttons {
    display: flex;
    gap: 5px;
}

.bgp-history-buttons button {
    width: 39px;
    height: 38px;
    padding: 0;
    line-height: 1;
}

.bgp-history-buttons button.is-primary {
    width: 44px;
}

.bgp-history-timeline {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.bgp-history-timeline input {
    width: 100%;
    min-height: 24px;
    margin: 0;
    accent-color: #63a624;
    cursor: pointer;
}

.bgp-history-timeline > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #5b6878;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.bgp-history-timeline output {
    color: #273b50;
    font-weight: 800;
}

.bgp-history-message {
    min-height: 17px;
    margin: 0;
    color: #516273;
    font-size: 12px;
}

.bgp-history-message.is-warning {
    color: #745a15;
}

.bgp-history-message.is-error {
    color: #b33242;
}

.bgp-live-metrics {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 18px 0 14px;
    overflow: hidden;
    border: 1px solid #dce3ec;
    border-radius: 7px;
    background: #dce3ec;
}

.bgp-live-metrics span {
    min-width: 0;
    padding: 11px 13px;
    background: #f8fafc;
}

.bgp-live-metrics small,
.bgp-live-metrics strong {
    display: block;
}

.bgp-live-metrics small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.bgp-live-metrics strong {
    margin-top: 3px;
    overflow-wrap: anywhere;
    color: #162a40;
    font-size: 16px;
}

.bgp-live-canvas {
    position: relative;
    overflow: hidden;
    border: 1px solid #20344b;
    border-radius: 8px;
    background:
        radial-gradient(circle at 78% 18%, rgba(115, 183, 39, .15), transparent 34%),
        #0d1724;
}

.bgp-live-canvas svg {
    display: block;
    width: 100%;
    aspect-ratio: 1000 / 360;
    min-height: 270px;
}

.bgp-grid line {
    stroke: rgba(157, 177, 201, .07);
    stroke-width: 1;
}

.bgp-edge,
.bgp-edge-pulse {
    fill: none;
    stroke-linecap: round;
}

.bgp-edge {
    stroke: #49627c;
    stroke-width: 5;
}

.bgp-live-canvas svg.is-history-frame .bgp-edge {
    stroke-dasharray: 700;
    animation: bgp-history-edge-arrive .42s ease-out both;
}

.bgp-edge-pulse {
    stroke: #8bd331;
    stroke-width: 2;
    stroke-dasharray: 9 18;
    animation: bgp-edge-flow 1.4s linear infinite;
}

.is-withdrawal .bgp-edge {
    stroke: #743c45;
}

.is-withdrawal .bgp-edge-pulse {
    stroke: #ef596c;
    animation-direction: reverse;
}

.bgp-node circle {
    fill: #182a3d;
    stroke: #9bb0c6;
    stroke-width: 2;
}

.bgp-node.is-observer circle {
    fill: #213b55;
    stroke: #82a6c9;
}

.bgp-node.is-origin circle {
    fill: #385f1d;
    stroke: #9bd64b;
    filter: url(#bgp-node-glow);
}

.bgp-node.is-local circle {
    stroke-width: 4;
}

.bgp-node-asn {
    fill: #fff;
    font-size: 14px;
    font-weight: 900;
}

.bgp-node-owner {
    fill: #b8c6d6;
    font-size: 11px;
    font-weight: 700;
}

.bgp-node.is-local .bgp-node-owner {
    fill: #b8ee72;
    font-size: 13px;
}

.bgp-live-canvas svg.is-history-frame .bgp-node {
    transform-box: fill-box;
    transform-origin: center;
    animation: bgp-history-node-arrive .34s cubic-bezier(.2, .8, .2, 1) both;
}

.bgp-live-canvas svg.is-dense .bgp-node-owner {
    display: none;
}

.bgp-empty {
    fill: #a9b9ca;
    font-size: 18px;
    font-weight: 800;
}

.bgp-live-graph-caption {
    position: absolute;
    left: 14px;
    bottom: 12px;
    max-width: calc(100% - 28px);
    padding: 6px 9px;
    border: 1px solid rgba(199, 215, 232, .24);
    border-radius: 5px;
    color: #dbe6f1;
    background: rgba(4, 11, 19, .78);
    font-size: 12px;
    font-weight: 700;
}

.bgp-live-lower {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 20px;
    margin-top: 18px;
}

.bgp-live-lower h3 {
    margin: 0 0 9px;
    font-size: 15px;
}

.bgp-path-choices {
    display: grid;
    gap: 7px;
}

.bgp-path-choice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    overflow: hidden;
    border: 1px solid #d7e0ea;
    border-radius: 6px;
    color: #24394f;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}

.bgp-path-choice:hover,
.bgp-path-choice.is-active {
    border-color: #87bd4a;
    background: #f5faef;
}

.bgp-path-choice small {
    color: var(--muted);
    white-space: nowrap;
}

.bgp-path-choice > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bgp-snapshot-error {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #e7d5ab;
    border-radius: 6px;
    color: #6d561a;
    background: #fffaf0;
}

.bgp-event-log {
    display: grid;
    gap: 7px;
    max-height: 288px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.bgp-event-log li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    min-height: 42px;
    padding: 8px 10px;
    border-left: 3px solid #78b82f;
    border-radius: 4px;
    color: #26384c;
    background: #f6f8fb;
    font-size: 12px;
}

.bgp-event-log li.is-withdraw {
    border-left-color: #d94b5f;
}

.bgp-event-log li.is-empty {
    grid-template-columns: 1fr;
    border-left-color: #a9b4c2;
    color: var(--muted);
}

.bgp-event-log span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bgp-event-log time {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.bgp-live-note {
    margin: 17px 0 0;
    padding-top: 13px;
    border-top: 1px solid #e0e6ed;
    color: var(--muted);
    font-size: 12px;
}

@keyframes bgp-edge-flow {
    to { stroke-dashoffset: -27; }
}

@keyframes bgp-live-status-pulse {
    50% { box-shadow: 0 0 0 7px rgba(114, 183, 39, .04); }
}

@keyframes bgp-history-edge-arrive {
    from { stroke-dashoffset: 700; opacity: .18; }
    to { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes bgp-history-node-arrive {
    from { opacity: 0; scale: .72; }
    to { opacity: 1; scale: 1; }
}

.speedtest-box {
    margin-top: 22px;
}

.mail-hub {
    margin-top: 22px;
}

.lead {
    max-width: 940px;
    color: #2d3b50;
    font-size: 18px;
}

.hub-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 28px;
}

.hub-actions a {
    display: grid;
    gap: 6px;
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    text-decoration: none;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.hub-actions a:hover {
    border-color: #c5d0de;
    background: #f2f5f9;
    transform: translateY(-1px);
}

.hub-actions strong {
    color: var(--brand);
    font-size: 17px;
}

.hub-actions span {
    color: var(--muted);
    font-size: 14px;
}

.seo-content {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.seo-content h2 {
    max-width: 820px;
}

.seo-content h3 {
    margin: 22px 0 8px;
    font-size: 18px;
}

.seo-content p {
    max-width: 920px;
    color: #2d3b50;
}

.seo-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.seo-columns article,
.faq-list details {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.seo-columns article h3 a {
    color: var(--brand);
    text-decoration: none;
}

.seo-columns article h3 a:hover {
    text-decoration: underline;
}

.seo-checklist {
    display: grid;
    gap: 8px;
    padding-left: 20px;
}

.seo-checklist li {
    padding-left: 4px;
}

.audit-steps {
    display: grid;
    gap: 10px;
    padding-left: 24px;
}

.audit-steps li {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.audit-steps strong {
    display: block;
    margin-bottom: 4px;
}

.related-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.related-tools a {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--brand);
    background: #fff;
    font-weight: 800;
    text-decoration: none;
}

.related-tools a:hover {
    border-color: #c5d0de;
    background: #f2f5f9;
}

.faq-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 900;
}

.faq-list details p {
    margin-top: 10px;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto 34px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 1180px) {
    .tool-grid,
    .hub-path-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .topbar {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 8px;
        padding: 12px 24px;
    }

    .topbar nav {
        width: 100%;
        justify-content: flex-start;
    }

    .tools-header,
    .tool-layout {
        grid-template-columns: 1fr;
    }

    .tools-hero-aside,
    .tools-header img {
        justify-self: start;
    }

    .tool-grid,
    .hub-path-grid,
    .service-link-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-nav {
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-title {
        display: grid;
    }

    .bgp-live-header,
    .bgp-live-lower {
        grid-template-columns: 1fr;
    }

    .bgp-live-header {
        display: grid;
    }

    .bgp-live-controls {
        justify-content: space-between;
    }

    .bgp-live-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bgp-history-range {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bgp-history-presets {
        align-self: end;
    }

    .bgp-history-player {
        grid-template-columns: auto minmax(180px, 1fr);
    }

    .bgp-history-speed {
        grid-column: 2;
        width: 92px;
        justify-self: end;
    }
}

@media (max-width: 620px) {
    .topbar {
        padding: 10px 16px;
    }

    .page-shell {
        width: min(100% - 20px, 1220px);
        margin-top: 14px;
    }

    .tools-header,
    .tool-panel {
        padding: 18px;
    }

    h1 {
        font-size: 32px;
    }

    .tool-title h1 {
        font-size: 30px;
    }

    .tool-grid,
    .score-row,
    .metric-grid,
    .input-row,
    .hub-actions,
    .hub-path-grid,
    .service-link-grid,
    .seo-columns {
        grid-template-columns: 1fr;
    }

    .tool-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 8px;
        scrollbar-width: thin;
    }

    .tool-nav a {
        flex: 0 0 142px;
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .tool-nav .back-link {
        flex-basis: 122px;
        margin-bottom: 0;
    }

    .tool-card {
        grid-template-columns: 46px minmax(0, 1fr);
        min-height: 0;
        padding: 16px;
    }

    .tool-card-action::after {
        right: 12px;
        top: 12px;
    }

    .tool-icon,
    .tool-nav a span:first-child {
        width: 40px;
        height: 40px;
    }

    .tools-hero-metrics {
        grid-template-columns: 1fr;
        width: 100%;
    }

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

    .risk-list li {
        grid-template-columns: 1fr;
    }

    .brand img {
        width: 136px;
    }

    .footer {
        display: grid;
    }

    .bgp-live-panel {
        padding: 14px;
    }

    .bgp-live-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .bgp-live-controls {
        justify-content: flex-start;
    }

    .bgp-mode-switch {
        width: 100%;
    }

    .bgp-history-controls {
        padding: 11px;
    }

    .bgp-history-range,
    .bgp-history-player {
        grid-template-columns: 1fr;
    }

    .bgp-history-presets {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .bgp-history-presets button {
        min-width: 0;
    }

    .bgp-history-load {
        width: 100%;
    }

    .bgp-history-buttons {
        justify-content: center;
    }

    .bgp-history-timeline {
        order: -1;
    }

    .bgp-history-speed {
        grid-column: auto;
        width: 100%;
        justify-self: stretch;
    }

    .bgp-live-canvas svg {
        min-height: 230px;
    }

    .bgp-node-owner {
        display: none;
    }

    .bgp-path-choice {
        grid-template-columns: 1fr;
    }

    .bgp-event-log li {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .bgp-event-log time {
        grid-column: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bgp-edge-pulse,
    .bgp-live-canvas svg.is-history-frame .bgp-edge,
    .bgp-live-canvas svg.is-history-frame .bgp-node,
    .bgp-live-status[data-state="connected"] i,
    .bgp-live-status[data-state="subscribed"] i,
    .bgp-live-status[data-state="history-loading"] i,
    .bgp-live-status[data-state="history-playing"] i {
        animation: none;
    }
}
