.diagram-container {
    width: 96%;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    background-color: rgba(var(--blue-darker), 0.4);
    border: 1px solid rgba(var(--blue-mid), 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.diagram-header {
    background-color: rgba(var(--blue-mid), 0.2);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(var(--blue-mid), 0.3);
}

.diagram-title {
    margin: 0;
    color: rgb(var(--blue-mid));
    font-family: monospace;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.svg-wrapper {
    position: relative;
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.architecture-svg {
    width: 100%;
    max-width: 900px;
    height: auto;
    min-height: 300px;
}

/* Boundary Box */
.boundary-rect {
    fill: rgba(var(--blue-mid), 0.05);
    stroke: rgba(var(--blue-mid), 0.4);
    stroke-width: 1.5px;
    stroke-dasharray: 6 6;
}

.boundary-title {
    fill: rgb(var(--blue-mid));
    font-family: monospace;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Nodes */
.node-rect {
    fill: #081a14;
    stroke: rgb(var(--blue-mid));
    stroke-width: 1.5px;
    transition: all 0.3s ease;
}

.hub-node {
    stroke: rgb(var(--blue-bright));
}

/* Human Review gate — emphasized as the mandatory checkpoint */
.gate-node {
    fill: rgba(var(--blue-bright), 0.08);
    stroke: rgb(var(--blue-bright));
    stroke-width: 2px;
    filter: drop-shadow(0 0 5px rgba(var(--blue-bright), 0.6));
}

.gate-subtext {
    fill: rgb(var(--blue-bright)) !important;
    font-weight: bold;
}

.main-node {
    stroke: rgb(var(--blue-mid));
    fill: rgba(var(--blue-mid), 0.15);
}

.node-text {
    fill: #E0E0E0;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
}

.node-subtext {
    fill: #d1dbd7;
    font-family: monospace;
    font-size: 12px;
}

/* Paths */
.path-line {
    fill: none;
    stroke-width: 1.5px;
}

.static-path {
    stroke: rgba(var(--blue-mid), 0.3);
}

.path-label {
    fill: rgb(var(--blue-mid));
    font-family: monospace;
    font-size: 12px;
    text-anchor: middle;
}

/* Animated Pulse */
.pulse-path {
    stroke: rgb(var(--blue-bright));
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 4px rgb(var(--blue-bright)));
    stroke-dasharray: 10, 1000;
    animation: pulse-flow linear infinite;
    will-change: stroke-dashoffset, opacity;
}

.path-1 { animation-duration: 2.5s; animation-delay: 0s; }
.path-2 { animation-duration: 2.5s; animation-delay: 0.6s; }
.path-3 { animation-duration: 2.5s; animation-delay: 1.2s; }
.path-4 { animation-duration: 2.5s; animation-delay: 1.8s; }
.path-5 { animation-duration: 2s; animation-delay: 2.6s; }

@keyframes pulse-flow {
    0% {
        stroke-dashoffset: 1000;
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }
}

/* Hard Guards annotation */
.guard-rect {
    fill: rgba(180, 40, 40, 0.08);
    stroke: rgba(200, 80, 80, 0.5);
    stroke-width: 1.5px;
    stroke-dasharray: 4 4;
}

.guard-title {
    fill: #d98c8c;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.guard-subtext {
    fill: #c9a9a9;
    font-family: monospace;
    font-size: 12px;
}

/* Mobile */
@media (max-width: 850px) {
    .svg-wrapper {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1.5rem;
    }

    .architecture-svg {
        min-height: 280px;
        min-width: 720px;
    }
}
