/* ============================================================================
   CarServify Infrastructure Atlas
   Hand-authored stylesheet. No build step, no npm — this file ships as-is.
   ========================================================================= */

:root {
    --bg: #05080f;
    --bg-2: #070d1a;
    --panel: rgba(10, 18, 33, 0.72);
    --panel-solid: rgba(9, 16, 30, 0.94);
    --line: rgba(120, 170, 230, 0.16);
    --line-soft: rgba(255, 255, 255, 0.05);
    --text: #e9f2ff;
    --muted: #8ba3c7;
    --dim: #6d86a6;
    --cyan: #4fd6ff;
    --cyan-deep: #0f9ee0;
    --violet: #a78bfa;
    --amber: #ffb86b;
    --green: #4ce39a;
    --pink: #ff7ab8;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --display: 'Sora', var(--sans);
    --r-lg: 26px;
    --r-md: 18px;
    --r-sm: 12px;
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); line-height: 1.08; letter-spacing: -0.015em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

::selection { background: rgba(79, 214, 255, 0.28); }

/* ---------------------------------------------------------------- ambient */

.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.ambient-grid {
    position: absolute;
    inset: -20%;
    background-image:
        linear-gradient(rgba(79, 214, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 214, 255, 0.055) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at 50% 24%, #000 0%, transparent 72%);
    -webkit-mask-image: radial-gradient(circle at 50% 24%, #000 0%, transparent 72%);
    animation: gridDrift 34s linear infinite;
}

.ambient-glow { position: absolute; border-radius: 999px; filter: blur(90px); opacity: 0.55; }

.ambient-glow-one {
    width: 620px; height: 620px; top: -220px; left: -180px;
    background: radial-gradient(circle, rgba(15, 158, 224, 0.55), transparent 68%);
    animation: floaty 18s ease-in-out infinite;
}

.ambient-glow-two {
    width: 520px; height: 520px; top: 28%; right: -200px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.4), transparent 70%);
    animation: floaty 24s ease-in-out infinite reverse;
}

.ambient-glow-three {
    width: 460px; height: 460px; bottom: -180px; left: 38%;
    background: radial-gradient(circle, rgba(255, 184, 107, 0.24), transparent 70%);
    animation: floaty 30s ease-in-out infinite;
}

.ambient-scan {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 4px);
    mix-blend-mode: overlay;
}

/* --------------------------------------------------------------- primitives */

.shell {
    position: relative;
    z-index: 1;
    width: min(100%, 1520px);
    margin: 0 auto;
    padding: 30px 30px 60px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.eyebrow {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 10px;
}

.lead { color: var(--muted); max-width: 62ch; line-height: 1.75; }

.panel,
.masthead,
.commandbar,
.topology,
.node-card,
.editor-card,
.status-banner,
.auth-card,
.section-head {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
}

/* Gradient hairline that traces the top edge of every major surface. */
.masthead::before,
.topology::before,
.node-card::before,
.editor-card::before,
.auth-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(79, 214, 255, 0.7), rgba(167, 139, 250, 0.5), transparent);
    opacity: 0.8;
}

/* --------------------------------------------------------------- reveal fx */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 620ms cubic-bezier(.2,.7,.2,1), transform 620ms cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* ---------------------------------------------------------------- masthead */

.masthead {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.75fr);
    gap: 34px;
    padding: 38px;
    overflow: hidden;
}

.masthead-compact { grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.6fr); }

.brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 9px 18px 9px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line-soft);
    margin-bottom: 26px;
}

.brand-chip img { width: 96px; padding: 7px 9px; border-radius: 10px; background: rgba(255, 255, 255, 0.93); }
.brand-chip span { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

.masthead h1 { font-size: clamp(2rem, 3.4vw, 3.5rem); max-width: 16ch; margin-bottom: 18px; }

/* Chromatic-aberration headline. */
.glitch { position: relative; }
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
}
.glitch::before { color: var(--cyan); transform: translate(-1.5px, 0); mix-blend-mode: screen; animation: aberrate 7s ease-in-out infinite; }
.glitch::after { color: var(--pink); transform: translate(1.5px, 0); mix-blend-mode: screen; animation: aberrate 7s ease-in-out infinite reverse; }

/* ----------------------------------------------------------------- console */

.console {
    margin-top: 26px;
    border-radius: var(--r-md);
    border: 1px solid var(--line-soft);
    background: rgba(2, 6, 14, 0.78);
    overflow: hidden;
    max-width: 640px;
}

.console-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    background: rgba(255, 255, 255, 0.035);
    border-bottom: 1px solid var(--line-soft);
}

.console-bar i { width: 9px; height: 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); }
.console-bar i:first-child { background: #ff5f57; }
.console-bar i:nth-child(2) { background: #febc2e; }
.console-bar i:nth-child(3) { background: #28c840; }
.console-bar span { margin-left: 10px; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

.console-body { margin: 0; padding: 18px 20px; font-family: var(--mono); font-size: 0.78rem; line-height: 1.95; color: var(--muted); white-space: pre-wrap; }
.c-prompt { color: var(--cyan); }
.c-cmd { color: var(--text); }
.c-ok { color: var(--green); }
.c-dim { color: var(--violet); }
.c-caret { color: var(--cyan); animation: blink 1.1s steps(1) infinite; }

/* -------------------------------------------------------------- side stack */

.masthead-side { display: flex; flex-direction: column; gap: 14px; }

.operator-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, rgba(79, 214, 255, 0.12), rgba(167, 139, 250, 0.08));
    border: 1px solid rgba(79, 214, 255, 0.2);
}

.operator-avatar {
    display: grid;
    place-items: center;
    width: 46px; height: 46px;
    flex: none;
    border-radius: 14px;
    font-family: var(--display);
    font-weight: 800;
    color: #04121d;
    background: linear-gradient(135deg, var(--cyan), #9be3ff);
}

.operator-card strong { display: block; font-family: var(--display); font-size: 1.05rem; }
.operator-card small { color: var(--muted); font-family: var(--mono); font-size: 0.7rem; }
.operator-card .eyebrow { margin-bottom: 2px; }

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

.metric {
    position: relative;
    padding: 16px 18px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line-soft);
    overflow: hidden;
    transition: border-color 220ms ease, transform 220ms ease;
}

.metric:hover { border-color: rgba(79, 214, 255, 0.34); transform: translateY(-2px); }

.metric strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--display);
    font-size: 1.9rem;
    line-height: 1;
    margin-bottom: 6px;
}

.metric span { font-size: 0.76rem; color: var(--muted); letter-spacing: 0.02em; }

.metric-spark {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0.6;
    animation: sweep 3.4s ease-in-out infinite;
}

.metric-live strong { font-size: 1.4rem; color: var(--green); }

.clock-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--line-soft);
}

.clock-strip .eyebrow { margin: 0; }
.clock-strip strong { font-family: var(--mono); font-size: 1rem; letter-spacing: 0.08em; }

/* ------------------------------------------------------------- commandbar */

.commandbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    border-radius: var(--r-md);
    flex-wrap: wrap;
}

.commandbar-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 340px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(2, 6, 14, 0.6);
    border: 1px solid var(--line-soft);
    transition: border-color 200ms ease;
}

.commandbar-search:focus-within { border-color: rgba(79, 214, 255, 0.5); }
.commandbar-search > span { color: var(--cyan); font-size: 1.05rem; }

.commandbar-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.9rem;
}

.commandbar-search input::placeholder { color: #57708f; }

.commandbar-search kbd {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--muted);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.04);
}

.commandbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.chip {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 9px 15px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 200ms ease;
}

.chip:hover { color: var(--text); border-color: rgba(79, 214, 255, 0.36); }
.chip.is-active { color: #04121d; background: linear-gradient(135deg, var(--cyan), #9be3ff); border-color: transparent; font-weight: 700; }

/* ----------------------------------------------------------------- buttons */

.button-primary,
.button-secondary {
    font-family: var(--sans);
    font-size: 0.86rem;
    font-weight: 700;
    border: 0;
    border-radius: 999px;
    padding: 12px 22px;
    cursor: pointer;
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
    display: inline-block;
    text-decoration: none;
}

.button-primary {
    color: #04121d;
    background: linear-gradient(135deg, var(--cyan), #9be3ff);
    box-shadow: 0 14px 34px rgba(79, 214, 255, 0.24);
}

.button-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--line-soft);
}

.button-primary:hover, .button-secondary:hover { transform: translateY(-2px); }
.button-secondary:hover { border-color: rgba(79, 214, 255, 0.4); }
.button-small { padding: 11px 20px; }

/* ------------------------------------------------------------ status banner */

.status-banner {
    padding: 15px 20px;
    border-radius: var(--r-md);
    color: var(--green);
    border-color: rgba(76, 227, 154, 0.3);
    background: rgba(76, 227, 154, 0.07);
    font-weight: 600;
}

.status-banner-error { color: #ff9d9d; border-color: rgba(255, 120, 120, 0.32); background: rgba(255, 100, 100, 0.07); }
.status-banner ul { margin-top: 8px; padding-left: 18px; font-weight: 400; font-size: 0.86rem; }

/* ---------------------------------------------------------------- topology */

.topology { padding: 32px; overflow: hidden; }

.topology-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 26px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.topology-head h2 { font-size: clamp(1.5rem, 2.1vw, 2.1rem); margin-bottom: 12px; }
.topology-head strong { color: var(--cyan); }

.topology-legend { display: grid; gap: 9px; }

.legend-item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.legend-item i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-core i { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.legend-client i { background: var(--violet); box-shadow: 0 0 12px var(--violet); }
.legend-api i { background: var(--green); box-shadow: 0 0 12px var(--green); }
.legend-ai i { background: var(--pink); box-shadow: 0 0 12px var(--pink); }
.legend-service i { background: var(--amber); box-shadow: 0 0 12px var(--amber); }

.topology-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: rgba(2, 6, 14, 0.5);
    border: 1px solid var(--line-soft);
    margin-bottom: 18px;
}

.controls-label {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cyan);
    padding-right: 6px;
}

.flow-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    padding: 10px 17px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    transition: all 200ms ease;
}

.flow-button:hover { border-color: rgba(79, 214, 255, 0.45); transform: translateY(-1px); }
.flow-play { color: var(--cyan); font-size: 0.68rem; }

.flow-button.is-running {
    color: #04121d;
    background: linear-gradient(135deg, var(--cyan), #9be3ff);
    border-color: transparent;
}

.flow-button.is-running .flow-play { color: #04121d; }
.flow-button-reset { color: var(--muted); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

.topology-stage {
    position: relative;
    border-radius: var(--r-md);
    border: 1px solid var(--line-soft);
    background:
        radial-gradient(circle at 50% 30%, rgba(15, 158, 224, 0.1), transparent 60%),
        rgba(2, 6, 14, 0.5);
    overflow: hidden;
}

.topology-scan {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, rgba(79, 214, 255, 0.07), transparent);
    height: 34%;
    animation: scanline 7s linear infinite;
    pointer-events: none;
    z-index: 2;
}

.topology-svg { display: block; width: 100%; height: auto; }

/* links */
.topo-link-base { fill: none; stroke: rgba(120, 170, 230, 0.22); stroke-width: 2; }

.topo-link-flow {
    fill: none;
    stroke: rgba(79, 214, 255, 0.75);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 5 15;
    animation: dashFlow 1.6s linear infinite;
    opacity: 0.55;
}

.topo-link-trace { stroke: none; fill: none; }

.topo-link-label {
    fill: #7e97b8;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-anchor: middle;
    transition: fill 240ms ease;
}

.topo-link.is-active .topo-link-base { stroke: rgba(79, 214, 255, 0.55); stroke-width: 3; }
.topo-link.is-active .topo-link-flow { stroke: #9be9ff; opacity: 1; stroke-width: 3; animation-duration: 0.55s; }
.topo-link.is-active .topo-link-label { fill: var(--cyan); }
.topo-link.is-dim { opacity: 0.18; }

/* nodes */
.topo-node { cursor: pointer; outline: none; }
.topo-node-box { fill: url(#nodeFill); stroke: rgba(140, 180, 230, 0.28); stroke-width: 1.5; transition: stroke 240ms ease, fill 240ms ease; }
.topo-node-halo { fill: transparent; stroke: none; transition: fill 240ms ease; }
.topo-node-brackets path { fill: none; stroke: rgba(140, 180, 230, 0.35); stroke-width: 1.5; stroke-linecap: square; transition: stroke 240ms ease; }
.topo-node-tag { fill: #7e97b8; font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; }
.topo-node-name { fill: #eaf3ff; font-family: 'Sora', sans-serif; font-weight: 700; }
.topo-node-meta { fill: #6f88a8; font-family: var(--mono); font-size: 11px; }
.topo-node-hubline { fill: var(--cyan); opacity: 0.75; }
.topo-node-pulse { fill: var(--green); animation: nodePulse 2.4s ease-in-out infinite; }

.topo-node-core .topo-node-box { fill: url(#coreFill); stroke: rgba(79, 214, 255, 0.55); }
.topo-node-core .topo-node-brackets path { stroke: rgba(79, 214, 255, 0.7); }
.topo-node-core .topo-node-tag { fill: var(--cyan); }

.topo-node-client .topo-node-brackets path { stroke: rgba(167, 139, 250, 0.55); }
.topo-node-api .topo-node-brackets path { stroke: rgba(76, 227, 154, 0.55); }
.topo-node-ai .topo-node-brackets path { stroke: rgba(255, 122, 184, 0.55); }
.topo-node-service .topo-node-brackets path { stroke: rgba(255, 184, 107, 0.6); }

.topo-node:hover .topo-node-box,
.topo-node:focus-visible .topo-node-box,
.topo-node.is-active .topo-node-box {
    stroke: var(--cyan);
    fill: rgba(79, 214, 255, 0.14);
}

.topo-node:hover .topo-node-brackets path,
.topo-node.is-active .topo-node-brackets path { stroke: var(--cyan); }

.topo-node.is-active { filter: url(#nodeGlow); }
.topo-node.is-active .topo-node-halo { fill: rgba(79, 214, 255, 0.14); }
.topo-node.is-dim { opacity: 0.25; }

.topo-packet { fill: #ffffff; filter: drop-shadow(0 0 8px var(--cyan)); }
.topo-packet-halo { fill: rgba(79, 214, 255, 0.35); }

/* readout */
.topology-readout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--line-soft);
    background: rgba(2, 6, 14, 0.72);
    position: relative;
    z-index: 3;
    min-height: 56px;
}

.readout-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--cyan); flex: none; box-shadow: 0 0 14px var(--cyan); animation: nodePulse 2s ease-in-out infinite; }
.topology-readout p { font-family: var(--mono); font-size: 0.79rem; color: var(--muted); line-height: 1.6; }
.topology-readout.is-live p { color: var(--text); }

/* steps */
.topology-steps { margin-top: 18px; padding: 20px 22px; border-radius: var(--r-md); background: rgba(2, 6, 14, 0.5); border: 1px solid var(--line-soft); }

.steps-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.steps-head strong { font-family: var(--display); font-size: 1.05rem; }
.steps-head span { font-family: var(--mono); font-size: 0.72rem; color: var(--cyan); letter-spacing: 0.1em; }

.topology-steps ol { list-style: none; display: grid; gap: 9px; counter-reset: step; }

.topology-steps li {
    counter-increment: step;
    display: flex;
    gap: 13px;
    align-items: flex-start;
    padding: 10px 13px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-size: 0.86rem;
    color: var(--muted);
    transition: all 260ms ease;
}

.topology-steps li::before {
    content: counter(step, decimal-leading-zero);
    font-family: var(--mono);
    font-size: 0.7rem;
    color: #56708f;
    padding-top: 2px;
    flex: none;
}

.topology-steps li.is-done { color: #a9c0dd; }
.topology-steps li.is-current {
    color: var(--text);
    background: rgba(79, 214, 255, 0.09);
    border-color: rgba(79, 214, 255, 0.3);
}
.topology-steps li.is-current::before { color: var(--cyan); }

/* ------------------------------------------------------------- section head */

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 24px;
    border-radius: var(--r-md);
    flex-wrap: wrap;
}

.section-head h2 { font-size: 1.5rem; }
.section-note { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); letter-spacing: 0.08em; }

/* ------------------------------------------------------------- node cards */

.node-grid, .editor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 20px; }

.node-card {
    padding: 24px;
    overflow: hidden;
    transition: transform 260ms cubic-bezier(.2,.7,.2,1), border-color 260ms ease, box-shadow 260ms ease;
}

.node-card.is-visible:hover {
    transform: translateY(-5px);
    border-color: rgba(79, 214, 255, 0.4);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(79, 214, 255, 0.12);
}

.node-sheen {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(79, 214, 255, 0.13), transparent 60%);
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
}

.node-card:hover .node-sheen { opacity: 1; }

.node-index {
    position: absolute;
    top: 18px; right: 22px;
    font-family: var(--mono);
    font-size: 2.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.035);
    line-height: 1;
    pointer-events: none;
}

.node-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; position: relative; }
.node-kicker { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber); margin-bottom: 8px; }
.node-head h3 { font-size: 1.35rem; margin-bottom: 6px; }
.node-host { font-family: var(--mono); font-size: 0.74rem; color: #6d86a6; }

.pill {
    flex: none;
    font-family: var(--mono);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding: 7px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.pill-credentialed { background: rgba(79, 214, 255, 0.14); color: #9be9ff; border: 1px solid rgba(79, 214, 255, 0.22); }
.pill-public { background: rgba(76, 227, 154, 0.14); color: #9ff2c6; border: 1px solid rgba(76, 227, 154, 0.22); }
.pill-api { background: rgba(255, 184, 107, 0.14); color: #ffd3a3; border: 1px solid rgba(255, 184, 107, 0.24); }

.node-health { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }

.status-line { display: inline-flex; align-items: center; gap: 10px; color: var(--green); font-weight: 600; font-size: 0.86rem; }
.status-dot { width: 10px; height: 10px; border-radius: 999px; flex: none; background: var(--green); }
.status-dot-live { animation: livePulse 2s infinite; }

.node-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; }
.node-bars i { width: 3px; border-radius: 2px; background: rgba(79, 214, 255, 0.6); animation: equalize 1.6s ease-in-out infinite; }
.node-bars i:nth-child(1) { height: 40%; animation-delay: 0s; }
.node-bars i:nth-child(2) { height: 70%; animation-delay: .18s; }
.node-bars i:nth-child(3) { height: 100%; animation-delay: .36s; }
.node-bars i:nth-child(4) { height: 55%; animation-delay: .54s; }
.node-bars i:nth-child(5) { height: 80%; animation-delay: .72s; }

.node-description { color: var(--muted); line-height: 1.75; margin-bottom: 18px; font-size: 0.9rem; }

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

.meta-cell {
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.028);
    border: 1px solid var(--line-soft);
}

.meta-cell-wide { grid-column: 1 / -1; }
.meta-cell dt { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: #6d86a6; margin-bottom: 6px; }
.meta-cell dd { margin: 0; font-size: 0.85rem; color: #cfe0f5; word-break: break-word; line-height: 1.55; }
.meta-cell dd a { text-decoration: none; border-bottom: 1px solid rgba(79, 214, 255, 0.35); color: #9be9ff; }
.meta-cell dd a:hover { border-bottom-color: var(--cyan); }

/* ------------------------------------------------------------------ vault */

.vault {
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, rgba(79, 214, 255, 0.08), rgba(167, 139, 250, 0.07));
    border: 1px solid rgba(79, 214, 255, 0.18);
}

.vault-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.vault-head span { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.vault-toggle, .copy-button {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan);
    background: rgba(79, 214, 255, 0.1);
    border: 1px solid rgba(79, 214, 255, 0.25);
    border-radius: 999px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 180ms ease;
}

.vault-toggle:hover, .copy-button:hover { background: rgba(79, 214, 255, 0.2); color: #d6f4ff; }
.copy-button.is-copied { color: var(--green); border-color: rgba(76, 227, 154, 0.4); background: rgba(76, 227, 154, 0.14); }

.vault-rows { display: grid; gap: 8px; }
.vault-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.vault-row > span { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); }
.vault-row code { font-family: var(--mono); font-size: 0.84rem; color: #d8ecff; word-break: break-all; }

.vault-open-access { display: flex; align-items: center; }
.vault-open-access span { font-size: 0.84rem; color: var(--muted); }

/* ---------------------------------------------------------------- editor */

.editor-card { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.editor-card.is-touched { border-color: rgba(79, 214, 255, 0.45); box-shadow: 0 0 0 1px rgba(79, 214, 255, 0.14), var(--shadow); }
.editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.editor-head h3 { font-size: 1.25rem; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-wide { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

.field input,
.field textarea,
.field select {
    width: 100%;
    font-family: var(--sans);
    font-size: 0.9rem;
    color: var(--text);
    background: rgba(2, 6, 14, 0.66);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    outline: none;
    transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.field select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--cyan) 50%), linear-gradient(135deg, var(--cyan) 50%, transparent 50%);
    background-position: calc(100% - 19px) 20px, calc(100% - 14px) 20px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.field select option { background: #0a1220; color: var(--text); }

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: rgba(79, 214, 255, 0.6);
    background: rgba(2, 6, 14, 0.92);
    box-shadow: 0 0 0 3px rgba(79, 214, 255, 0.1);
}

.field textarea { resize: vertical; min-height: 90px; line-height: 1.65; }
.field small { color: #ff9d9d; font-size: 0.76rem; }

.checkbox-field { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.86rem; }
.checkbox-field input { accent-color: var(--cyan); width: 16px; height: 16px; }

.editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.editor-hint { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }

/* ------------------------------------------------------------------- misc */

.empty-state { text-align: center; padding: 40px; color: var(--muted); font-family: var(--mono); font-size: 0.85rem; }

.shell-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 22px;
    margin-top: 10px;
    border-top: 1px solid var(--line-soft);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #56708f;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------------- auth */

.auth-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 30px; }

.auth-card {
    width: min(100%, 1080px);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 30px;
    padding: 36px;
    overflow: hidden;
}

.auth-brand { padding: 26px; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.022); border: 1px solid var(--line-soft); }
.brand-mark { width: 176px; padding: 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.93); margin-bottom: 26px; }
.auth-brand h1 { font-size: clamp(1.9rem, 3vw, 2.9rem); max-width: 13ch; margin-bottom: 16px; }

.auth-points { list-style: none; display: grid; gap: 12px; margin-top: 26px; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.88rem; }
.auth-points li span { width: 8px; height: 8px; border-radius: 999px; flex: none; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }

.auth-form {
    padding: 30px;
    border-radius: var(--r-md);
    background: rgba(2, 6, 14, 0.5);
    border: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.auth-form h2 { font-size: 1.7rem; margin-bottom: 8px; }

/* -------------------------------------------------------------- keyframes */

@keyframes gridDrift { to { transform: translate(54px, 54px); } }

@keyframes floaty {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(28px, -34px) scale(1.08); }
}

@keyframes blink { 50% { opacity: 0; } }

@keyframes aberrate {
    0%, 92%, 100% { opacity: 0; transform: translate(0, 0); }
    93% { opacity: 0.5; transform: translate(-2px, 1px); }
    95% { opacity: 0.5; transform: translate(2px, -1px); }
    97% { opacity: 0.4; transform: translate(-1px, 0); }
}

@keyframes sweep {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

@keyframes scanline {
    0% { transform: translateY(-120%); }
    100% { transform: translateY(420%); }
}

@keyframes dashFlow { to { stroke-dashoffset: -40; } }

@keyframes nodePulse {
    0%, 100% { opacity: 1; r: 5; }
    50% { opacity: 0.35; r: 6.5; }
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 227, 154, 0.75); }
    70% { box-shadow: 0 0 0 12px rgba(76, 227, 154, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 227, 154, 0); }
}

@keyframes equalize {
    0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1240px) {
    .masthead, .masthead-compact, .auth-card { grid-template-columns: 1fr; }
    .node-grid, .editor-grid { grid-template-columns: 1fr; }
    .metric-stack { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .shell { padding: 18px 16px 44px; gap: 16px; }
    .masthead, .topology, .node-card, .editor-card, .auth-card { padding: 22px; border-radius: 20px; }
    .metric-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topology-head, .section-head, .editor-foot { flex-direction: column; align-items: flex-start; }
    .meta-grid, .field-grid { grid-template-columns: 1fr; }
    .commandbar { flex-direction: column; align-items: stretch; }
    .commandbar-actions { justify-content: flex-start; }
    .node-index { font-size: 1.9rem; }
    .topology-stage { overflow-x: auto; }
    .topology-svg { min-width: 900px; }
}
