@font-face {
    font-family: "Quantico";
    src: url("../public/fonts/Quantico-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Quantico";
    src: url("../public/fonts/Quantico-Bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --display-font: "Quantico", "Avenir Next Condensed", "Arial Narrow", "Franklin Gothic Medium", "Bahnschrift SemiCondensed", "Segoe UI", sans-serif;
    --header-height: 72px;
    background: #f3f5f7;
    color: #10202f;
    --panel-border: #c8d1da;
    --panel-bg: #ffffff;
    --accent: #0b5fff;
    --accent-weak: #d8e5ff;
    --danger: #a12626;
    --danger-bg: #fce8e8;
    --muted: #526273;
    --soft-bg: #eff4fb;
}

* {
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top left, rgba(11, 95, 255, 0.08), transparent 28%),
        linear-gradient(180deg, #f9fbfe, #eef2f6 45%, #ebf0f5);
}

body.modal-open {
    overflow: hidden;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #1800ac;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 28px rgba(14, 24, 38, 0.16);
}

.site-header-inner {
    position: relative;
    width: min(1480px, calc(100% - 1.5rem));
    margin: 0 auto;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.brand-title {
    font-family: var(--display-font);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #ffffff;
}

.page-intro h1,
.page-intro h2,
.content-section h2,
.content-section h3,
.panel-head h2,
.status-row h2,
.subpanel-head h3,
.footer-title,
.footer-heading,
.info-title,
.note-label {
    font-family: var(--display-font);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.site-nav-head,
.site-nav-footer {
    display: none;
}

.site-nav-close {
    display: none;
}

.nav-toggle,
.nav-backdrop {
    display: none;
}

.nav-toggle {
    align-items: center;
    gap: 0.5rem;
    padding: 0.72rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
}

.nav-toggle-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.72rem 0.9rem;
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.9rem;
    font-weight: 700;
    transition: background 120ms ease, transform 120ms ease;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    -ms-border-radius: 20px;
    -o-border-radius: 20px;
}

.nav-link:hover,
.nav-link-active {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 1.2rem;
    color: #dfe3ff;
    font-size: 0.96rem;
    font-weight: 800;
}

.page-shell {
    width: min(1480px, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.page-intro {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.15rem 0 0.35rem;
}

.page-kicker {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5b6d80;
}

.page-intro h1,
.page-intro h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.page-lead {
    max-width: 74rem;
    margin: 0;
    color: #415264;
    line-height: 1.58;
    font-size: 1rem;
}

.docs-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    align-self: start;
    padding-right: 1.1rem;
    border-right: 1px solid #d9e2ec;
}

.docs-sidebar-inner {
    display: grid;
    gap: 1rem;
}

.docs-sidebar-title {
    margin: 0 0 0.75rem;
    font-family: var(--display-font);
    font-size: 0.92rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #5b6d80;
}

.docs-nav {
    display: grid;
    gap: 0.35rem;
}

.docs-nav a {
    display: block;
    padding: 0.55rem 0.2rem 0.55rem 0.8rem;
    border-left: 3px solid transparent;
    color: #405264;
    background: transparent;
    font-size: 0.92rem;
    line-height: 1.35;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.docs-nav a:hover,
.docs-nav a.docs-nav-link-active {
    background: #eef4ff;
    color: #173f9a;
    border-color: #2b65dd;
}

.docs-sidebar-note {
    margin: 0;
    color: #5c6e80;
    font-size: 0.86rem;
    line-height: 1.5;
}

.docs-sidebar-tools {
    display: grid;
    gap: 0.7rem;
    padding-top: 0.9rem;
    border-top: 1px solid #dde5ee;
}

.docs-meta {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.38rem 0.62rem;
    border-radius: 999px;
    background: #edf3ff;
    color: #1a49b1;
    font-size: 0.8rem;
    font-weight: 800;
}

.docs-sidebar-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.82rem 0.95rem;
    border: 1px solid #ced9ea;
    border-radius: 14px;
    background: #ffffff;
    color: #173f9a;
    font-size: 0.9rem;
    font-weight: 800;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.docs-sidebar-cta:hover {
    transform: translateY(-1px);
    border-color: #9db8ef;
    background: #f8fbff;
}

.docs-content {
    min-width: 0;
}

.visual-card {
    margin: 1rem 0 1.1rem;
    padding: 1rem;
    border: 1px solid #d8e4f2;
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(11, 95, 255, 0.07), transparent 35%),
        linear-gradient(180deg, #fbfdff, #f5f8fd);
}

.visual-title {
    margin: 0 0 0.75rem;
    font-family: var(--display-font);
    font-size: 0.95rem;
    color: #213447;
}

.flow-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.flow-node,
.mini-node {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    min-height: 48px;
    padding: 0.7rem 0.8rem;
    border-radius: 999px;
    border: 2px solid #cdd9e6;
    background: #ffffff;
    color: #22384d;
    font-weight: 800;
}

.flow-node-target {
    border-color: #2b65dd;
    background: #e7efff;
    color: #19469f;
}

.flow-node-origin {
    border-color: #33905f;
    background: #e8f6ee;
    color: #286f4b;
}

.flow-arrow {
    color: #6d7f90;
    font-size: 1.15rem;
    font-weight: 800;
}

.visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.visual-step {
    padding: 0.9rem;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    background: #ffffff;
}

.visual-step strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #1f3348;
}

.mini-topology {
    display: grid;
    gap: 0.7rem;
}

.mini-topology-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.relationship-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.62rem;
    border-radius: 999px;
    background: #f2ecde;
    color: #7a5c22;
    font-size: 0.8rem;
    font-weight: 800;
}

.faq-pair {
    display: grid;
    gap: 0.55rem;
}

.key-points {
    display: grid;
    gap: 0.7rem;
    margin-top: 1rem;
}

.key-point {
    padding: 0.85rem 0.9rem;
    border-left: 4px solid #2b65dd;
    border-radius: 0 14px 14px 0;
    background: #f7faff;
    color: #3d4f62;
}

.content-stack {
    display: grid;
    gap: 1.5rem;
    margin-top: 1rem;
}

.content-stack-tight {
    gap: 1rem;
}

.content-section {
    max-width: 920px;
    padding: 0 0 1.3rem;
    border-bottom: 1px solid #dde5ee;
}

.content-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.content-section h2 {
    margin: 0 0 0.7rem;
    font-size: 1.45rem;
    line-height: 1.15;
}

.section-heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.section-anchor {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #58708a;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 120ms ease, color 120ms ease;
}

.content-section:hover .section-anchor,
.content-section:focus-within .section-anchor {
    opacity: 1;
}

.section-anchor:hover {
    color: #173f9a;
}

.content-section-backtop {
    margin-top: 1rem;
}

.backtop-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #5c7187;
    font-size: 0.83rem;
    font-weight: 700;
}

.backtop-link:hover {
    color: #173f9a;
}

.content-section h3 {
    margin: 1rem 0 0.45rem;
    font-size: 1.05rem;
    line-height: 1.2;
}

.content-section p,
.content-section li {
    color: #415264;
    line-height: 1.65;
    font-size: 1rem;
}

.content-section p {
    margin: 0.6rem 0 0;
}

.content-section ul,
.content-section ol {
    margin: 0.8rem 0 0;
    padding-left: 1.2rem;
}

.content-section li + li {
    margin-top: 0.35rem;
}

.site-footer {
    margin-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.14), transparent 28%),
        linear-gradient(180deg, #1800ac, #130085 72%, #0f006d);
}

.site-footer-inner {
    width: min(1480px, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1.9rem 0 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(180px, 0.7fr));
    gap: 1.75rem;
    align-items: start;
}

.footer-brand {
    display: grid;
    gap: 0.85rem;
}

.footer-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #ffffff;
}

.footer-copy,
.footer-list a,
.footer-credit a,
.footer-credit span {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
    font-size: 0.93rem;
}

.footer-copy {
    margin: 0;
    max-width: 36rem;
}

.footer-heading {
    margin: 0 0 0.7rem;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(223, 227, 255, 0.9);
}

.footer-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.footer-list a {
    width: fit-content;
    transition: color 120ms ease, transform 120ms ease;
}

.footer-list a:hover,
.footer-credit a:hover {
    color: #ffffff;
    transform: translateX(2px);
}

.footer-credit {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    align-items: center;
    padding-top: 0.25rem;
}

.code-block {
    margin: 0.85rem 0 0;
    padding: 0.9rem 1rem;
    border: 1px solid #d9e1eb;
    border-radius: 16px;
    background: #f7f9fc;
    color: #233446;
    overflow-x: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88rem;
    line-height: 1.5;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(286px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.workspace-sidebar,
.workspace-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.panel,
.subpanel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow:
        0 10px 30px rgba(16, 32, 47, 0.045),
        0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.panel {
    padding: 1.15rem;
    min-width: 0;
}

.subpanel {
    padding: 0.95rem;
    min-width: 0;
}

.panel-head,
.status-row,
.subpanel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.panel-head h2,
.status-row h2,
.subpanel-head h3 {
    margin: 0;
    line-height: 1.1;
}

.graph-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.route-nav-controls,
.results-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: #f7f9fc;
    color: #2b4056;
    font-size: 0.84rem;
    font-weight: 700;
}

.toggle-pill input {
    margin: 0;
}

.toolbar-grid {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.mode-grid {
    display: grid;
    gap: 0.7rem;
    margin-top: 1rem;
}

.mode-card {
    display: grid;
    gap: 0.25rem;
    width: 100%;
    text-align: left;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: #f3f6fb;
    color: #243548;
    box-shadow: none;
}

.mode-card span {
    font-size: 0.86rem;
    line-height: 1.35;
    color: #617284;
    font-weight: 600;
}

.mode-card-active {
    background: linear-gradient(180deg, #e8f0ff, #dfe9ff);
    color: #173f9a;
    box-shadow: 0 10px 24px rgba(11, 95, 255, 0.12);
}

.quick-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.quick-target-button {
    padding: 0.7rem 0.95rem;
    background: #edf3ff;
    color: #1d4ab4;
    font-size: 0.88rem;
}

.compact-copy {
    margin-top: 0.8rem;
}

.quick-start-copy {
    font-size: 0.98rem;
    font-weight: 600;
    color: #334556;
}

.quick-start-list {
    margin: 0.85rem 0 0;
    padding-left: 1.15rem;
    color: #425264;
    line-height: 1.5;
    font-size: 0.93rem;
}

.toolbar-button,
.mini-button,
button {
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

button {
    padding: 0.82rem 1.15rem;
    background: var(--accent);
    color: #ffffff;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.toolbar-button {
    width: 100%;
    justify-content: center;
    padding: 0.78rem 1rem;
    background: #eaf1ff;
    color: #2048aa;
}

.mini-button {
    padding: 0.55rem 0.85rem;
    background: var(--accent);
    color: #fff;
}

.secondary-button {
    background: #e9eef5;
    color: #223242;
}

#close-upload-modal-button {
    padding: 0.68rem 0.95rem;
    background: #f1f5fb;
    color: #27415b;
    border: 1px solid #d8e2ee;
    box-shadow: none;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(11, 95, 255, 0.12);
}

button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.simulator-form {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.info-card {
    border: 1px solid #d8e4f2;
    border-radius: 14px;
    background: var(--soft-bg);
    padding: 1rem;
}

.modal-info-card {
    margin-top: 1rem;
}

.info-title {
    margin: 0;
    font-weight: 800;
}

.hint-list {
    margin: 0.65rem 0 0;
    padding-left: 1.1rem;
    color: #3e4d5d;
    line-height: 1.42;
    font-size: 0.92rem;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.upload-summary {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.75rem;
}

.upload-summary p {
    margin: 0;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field span {
    font-size: 0.88rem;
    font-weight: 700;
}

.field input,
.announcement-form input,
.rov-form input {
    width: 100%;
    padding: 0.82rem 0.9rem;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: #fbfcfd;
    min-width: 0;
}

.field input[type="file"] {
    padding: 0.55rem 0.6rem;
    overflow: hidden;
    font-size: 0.82rem;
}

.field-meta {
    color: var(--muted);
    overflow-wrap: anywhere;
    line-height: 1.35;
    min-height: 0;
    font-size: 0.78rem;
}

.editor-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.builder-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.builder-section {
    display: grid;
    gap: 0.8rem;
}

.announcement-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.rov-form {
    margin-top: 0.8rem;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    font-size: 0.88rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
}

.actions > button {
    flex: 1 1 140px;
    min-width: 0;
}

.status-pill,
.soft-pill,
.relationship-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-pill {
    background: #edf1f5;
    color: #4d5d6c;
}

.soft-pill {
    background: var(--accent-weak);
    color: #1b4dbb;
}

.site-statusbar {
    position: fixed;
    left: 50%;
    bottom: 0.9rem;
    transform: translateX(-50%);
    z-index: 20;
    padding: 0.55rem 0.8rem;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 28px rgba(16, 32, 47, 0.12);
    backdrop-filter: blur(10px);
    transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
}

.site-statusbar.statusbar-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(12px);
    pointer-events: none;
}

.statusbar-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: #44607b;
    white-space: nowrap;
}

.relationship-pill {
    background: #e8f4ed;
    color: #2d6f49;
}

.runtime-message {
    margin: 0.9rem 0 0;
    line-height: 1.45;
    color: var(--muted);
    font-size: 0.94rem;
}

.error-box {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid #efb6b6;
    background: var(--danger-bg);
    color: var(--danger);
    white-space: pre-wrap;
}

.results-summary {
    margin-top: 1rem;
    font-weight: 700;
}

.results-sort-control {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #405264;
    font-size: 0.88rem;
    font-weight: 700;
}

.results-sort {
    padding: 0.68rem 0.82rem;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: #fbfcfd;
    color: #1f3348;
    font: inherit;
}

.results-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.metric-card {
    border: 1px solid #d9e5f3;
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfdff, #f3f7fc);
    padding: 0.9rem 1rem;
}

.metric-label {
    margin: 0;
    color: #607284;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.metric-value {
    margin: 0.35rem 0 0;
    color: #16283a;
    font-family: var(--display-font);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
}

.compact-table {
    max-height: 300px;
    overflow: auto;
    border: 1px solid #e6ebf1;
    border-radius: 12px;
}

.builder-table-wrap {
    margin-top: 0.2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.72rem 0.78rem;
    border-bottom: 1px solid #e1e7ed;
    text-align: left;
    vertical-align: top;
    font-size: 0.88rem;
}

thead th {
    background: #f7f9fb;
}

tbody tr {
    cursor: pointer;
}

tbody tr:hover,
.row-selected {
    background: #f4f8ff;
}

tbody tr:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.inline-remove {
    padding: 0.38rem 0.58rem;
    border-radius: 999px;
    border: 0;
    background: #f3e2e2;
    color: #8c2a2a;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.76rem;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
    max-height: 180px;
    overflow: auto;
    padding-right: 0.25rem;
}

.chip {
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.8rem;
    background: #eaf1ff;
    color: #2145a0;
    font-weight: 700;
    cursor: pointer;
}

.builder-section .chip-list {
    margin-top: 0.15rem;
    max-height: 132px;
}

.sticky-panel {
    position: static;
}

.graph-panel {
    min-height: 640px;
    padding: 1.25rem 1.3rem;
}

.graph-empty {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 14px;
    background: #f6f8fb;
    color: var(--muted);
    line-height: 1.5;
}

.graph-title {
    margin: 1rem 0 0;
    font-size: 0.98rem;
    font-weight: 800;
}

.graph-subtitle {
    margin: 0.35rem 0 0;
    color: var(--muted);
    line-height: 1.4;
    font-size: 0.95rem;
}

.graph-canvas {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.graph-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.legend-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.legend-target {
    background: #dbe8ff;
    color: #204eb0;
}

.legend-transit {
    background: #edf1f5;
    color: #4a5968;
}

.legend-origin {
    background: #e1f4e8;
    color: #2d6f49;
}

.legend-edge {
    background: #f4efe1;
    color: #866431;
}

.graph-svg {
    width: 100%;
    min-height: 360px;
    border: 1px solid #dbe3ec;
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(11, 95, 255, 0.07), transparent 36%),
        linear-gradient(180deg, #fcfdff, #f3f8fd);
}

.graph-edge {
    fill: none;
    stroke: #9fb6d6;
    stroke-width: 4;
    stroke-linecap: round;
}

.packet-trace {
    fill: none;
    stroke: transparent;
    stroke-width: 16;
    pointer-events: none;
}

.packet-dot {
    fill: #ff7a00;
    stroke: #ffffff;
    stroke-width: 3;
    filter: drop-shadow(0 6px 12px rgba(255, 122, 0, 0.35));
}

.graph-edge-label {
    fill: #6f5830;
    font-size: 14px;
    font-weight: 700;
}

.graph-node-circle {
    stroke-width: 4;
}

.graph-node-target {
    fill: #dbe8ff;
    stroke: #2b65dd;
}

.graph-node-transit {
    fill: #edf1f5;
    stroke: #7f93a8;
}

.graph-node-origin {
    fill: #e3f5ea;
    stroke: #33905f;
}

.graph-node-inner {
    fill: rgba(255, 255, 255, 0.8);
}

.graph-node-asn {
    fill: #16283a;
    font-size: 15px;
    font-weight: 800;
}

.graph-node-caption {
    fill: #596a7b;
    font-size: 11px;
    font-weight: 700;
}

.graph-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.graph-node-card {
    border: 1px solid #d8e4f2;
    border-radius: 16px;
    background: #fbfdff;
    padding: 0.9rem 1rem;
}

.graph-node-title {
    margin: 0;
    font-weight: 800;
}

.graph-node-role {
    margin: 0.35rem 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.route-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
    margin-top: 0.55rem;
}

.route-fact {
    border: 1px solid #dee7f2;
    border-radius: 14px;
    background: #f7faff;
    padding: 0.7rem 0.8rem;
}

.route-fact-label {
    margin: 0;
    color: #617284;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.route-fact-value {
    margin: 0.35rem 0 0;
    color: #1b3147;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.35;
}

.graph-bridge {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
}

.graph-arrow {
    font-size: 1.35rem;
    color: #5f7186;
}

.graph-notes {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.note-card {
    border: 1px solid #e3e9ef;
    border-radius: 14px;
    background: #fbfcfd;
    padding: 0.85rem 0.9rem;
}

.note-label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6a7988;
}

.note-copy {
    margin: 0.45rem 0 0;
    line-height: 1.5;
    color: #344454;
}

.flow-list {
    margin: 0.55rem 0 0;
    padding-left: 1.1rem;
    color: #344454;
    line-height: 1.5;
}

.results-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.9rem;
}

.upload-modal {
    border: 0;
    padding: 0;
    background: transparent;
}

.upload-modal::backdrop {
    background: rgba(14, 24, 38, 0.46);
    backdrop-filter: blur(4px);
}

.upload-modal-card {
    width: min(680px, calc(100vw - 1.5rem));
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    background: #fff;
    padding: 1.15rem;
    box-shadow: 0 24px 60px rgba(14, 24, 38, 0.2);
}

.upload-modal .field-grid {
    margin: 1.15rem 0 1.35rem;
}

.upload-modal .field {
    gap: 0.5rem;
}

.results-filter {
    width: min(100%, 360px);
    padding: 0.82rem 0.9rem;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: #fbfcfd;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.results-table-wrap {
    max-height: 320px;
    overflow: auto;
}

.mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88rem;
    line-height: 1.35;
}

.workspace-sidebar .panel {
    overflow: hidden;
}

.workspace-sidebar .runtime-message,
.workspace-sidebar .hint-list,
.workspace-sidebar .field,
.workspace-sidebar .subpanel {
    font-size: 0.95rem;
}

@media (max-width: 1240px) {
    .workspace-grid {
        grid-template-columns: minmax(270px, 300px) minmax(0, 1fr);
    }
}

@media (max-width: 1120px) {
    .workspace-grid,
    .editor-grid,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
        padding-right: 0;
        padding-bottom: 1rem;
        border-right: 0;
        border-bottom: 1px solid #d9e2ec;
    }

    .sticky-panel {
        position: static;
    }
}

@media (max-width: 720px) {
    :root {
        --header-height: 68px;
    }

    .page-shell {
        width: min(100% - 0.75rem, 1440px);
        padding-top: 0.85rem;
    }

    .panel,
    .subpanel {
        padding: 1rem;
    }

    .panel-head,
    .status-row,
    .subpanel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .graph-head-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .route-nav-controls,
    .results-controls {
        width: 100%;
    }

    .results-filter {
        width: 100%;
    }

    .site-header-inner {
        min-height: 68px;
        justify-content: space-between;
        padding: 0.7rem 0;
    }

    .brand-mark {
        max-width: calc(100% - 7.5rem);
    }

    .brand-title {
        font-size: 1.12rem;
        line-height: 1.05;
        letter-spacing: 0.02em;
    }

    .site-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, calc(100vw - 2.5rem));
        padding: 1rem;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.75rem;
        overflow-y: auto;
        background: linear-gradient(180deg, #1800ac, #14008f 72%, #100072);
        border-left: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow: -3px 0 16px rgba(8, 10, 48, 0.12);
        transform: translateX(100%);
        transition: transform 180ms ease;
        z-index: 1002;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-backdrop {
        position: fixed;
        inset: 0;
        border: 0;
        padding: 0;
        background: rgba(11, 15, 34, 0.16);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
        z-index: 1001;
    }

    body.nav-open {
        overflow: hidden;
    }

    body.nav-open .site-nav {
        transform: translateX(0);
    }

    body.nav-open .nav-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    body.nav-open .nav-toggle-icon {
        transform: rotate(90deg);
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 0.95rem 1rem;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.1);
    }

    .site-nav-head,
    .site-nav-footer {
        display: grid;
    }

    .site-nav-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.32rem;
        padding: 0.35rem 0 0.85rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        margin-bottom: 0.15rem;
    }

    .site-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.35rem;
        height: 2.35rem;
        appearance: none;
        -webkit-appearance: none;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.08);
        box-shadow: none;
        color: #ffffff;
        font-size: 1.4rem;
        line-height: 1;
        padding: 0;
        outline: none;
        flex: 0 0 auto;
    }

    .site-nav-footer-label {
        margin: 0;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: rgba(223, 227, 255, 0.74);
        font-family: var(--display-font);
    }

    .site-nav-title {
        margin: 0;
        color: #ffffff;
        font-family: var(--display-font);
        font-size: 1.18rem;
        line-height: 1.08;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .site-nav-footer {
        gap: 0.5rem;
        margin-top: auto;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .site-nav-portfolio-link {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        padding: 0.9rem 1rem;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
        font-weight: 800;
        letter-spacing: 0.01em;
        font-family: var(--display-font);
        text-transform: uppercase;
    }

    .graph-panel {
        padding: 1rem;
    }

    .upload-modal-card {
        width: min(100vw - 0.75rem, 680px);
        padding: 0.95rem;
    }

    .page-intro h1,
    .page-intro h2 {
        font-size: 2rem;
    }

    .section-heading-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .section-anchor {
        opacity: 1;
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }
}

#run-button{
margin-top: 20px;
}

#builder-add-rov-button{
    margin-top: 10px;
}
