/* Flow Chart */
.flow-chart {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 60px;
}

/* Flow Node */
.flow-node {
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Main Card */
.node-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding: 40px;
    border-left: 8px solid;
    position: relative;
    transition: all 0.3s ease;
}

.node-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(10px);
}

.node-1 .node-card {
    border-color: #f56565;
}

.node-2 .node-card {
    border-color: #ed8936;
}

.node-3 .node-card {
    border-color: #9f7aea;
}

.node-4 .node-card {
    border-color: #48bb78;
}

.node-5 .node-card {
    border-color: #4299e1;
}

.node-6 .node-card {
    border-color: #ecc94b;
}

.node-7 .node-card {
    border-color: #e53e3e;
}

/* Node Header */
.node-header {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 25px;
    margin-bottom: 30px;
    align-items: center;
}

.node-number {
    background: rgba(255, 255, 255, 0.15);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    font-weight: 900;
}

.node-title-section {
    display: flex;
    flex-direction: column;
}

.node-title {
    font-size: 2.8em;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1;
}

.node-subtitle {
    font-size: 1.3em;
    color: #a0aec0;
    font-style: italic;
}

/* Core Question Box */
.core-question {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 3px solid #667eea;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.core-question h4 {
    color: #667eea;
    font-size: 1.2em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.core-question p {
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.4;
}

.problem-type {
    margin-top: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 1.1em;
    color: #a0aec0;
}

/* ══════════════════════════════════════════════════
   LAYER SYSTEM (Capacity node)
   ══════════════════════════════════════════════════ */

.layer {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    grid-column: 1 / -1;
}
.layer:last-child {
    border-bottom: none;
}
.layer-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 32px;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
}
.layer-header:hover {
    background: rgba(255, 255, 255, 0.06);
}
details.layer > summary {
    list-style: none;
}
details.layer > summary::-webkit-details-marker {
    display: none;
}
.layer-badge {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    display: inline-block;
}
.layer-title {
    font-size: 1em;
    font-weight: 700;
    color: #fff;
}
.layer-desc {
    font-size: 0.82em;
    color: #a0aec0;
    margin-top: 1px;
}
.layer-toggle {
    margin-left: auto;
    color: #a0aec0;
    font-size: 1.1em;
    transition: transform 0.25s;
}
details.layer[open] .layer-toggle {
    transform: rotate(180deg);
}
.layer-body {
    padding: 0 32px 32px;
}
.layer-handoff {
    background: rgba(99, 179, 237, 0.06);
    border-left: 3px solid rgba(99, 179, 237, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 4px 0 0;
    font-size: 0.88em;
    color: #a0aec0;
    font-style: italic;
}
.proof-section-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 700;
    color: #718096;
    display: block;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* Operating Rule Bar */
.op-rule-bar {
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 16px 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.op-rule-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 0;
}
.op-rule-step:not(:last-child)::after {
    content: '\2192';
    color: #718096;
    margin-left: 6px;
    font-size: 0.85em;
}
.op-rule-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #718096;
    display: block;
}
.op-rule-value {
    font-size: 0.88em;
    font-weight: 700;
    color: #ecc94b;
}

/* ══════════════════════════════════════════════════
   MODEL BRIDGE (Behavior node)
   ══════════════════════════════════════════════════ */

.model-bridge {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 10px;
}
.bridge-step {
    padding: 11px 13px;
    text-align: center;
    font-size: 0.76em;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: #4a5568;
    line-height: 1.4;
}
.bridge-step:last-child {
    border-right: none;
}
.bridge-step.active {
    background: rgba(102, 126, 234, 0.1);
    color: #c3cafe;
}
.bridge-step .bs-sub {
    display: block;
    font-size: 0.85em;
    font-weight: 400;
    opacity: 0.65;
    margin-top: 2px;
    text-transform: none;
    letter-spacing: 0;
}

/* ══════════════════════════════════════════════════
   DEEP MAP STRIP (Behavior node)
   ══════════════════════════════════════════════════ */

.deep-map {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.deep-map-step {
    padding: 10px 10px 11px;
    text-align: center;
    font-size: 0.73em;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: #4a5568;
    line-height: 1.35;
}
.deep-map-step:last-child { border-right: none; }
.deep-map-step .dms-label {
    display: block;
    font-size: 0.9em;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 3px;
}
.deep-map-step .dms-sub {
    display: block;
    font-weight: 400;
    font-size: 0.9em;
    opacity: 0.7;
    text-transform: none;
    letter-spacing: 0;
}
.deep-map-step.dm-drivers  { color: #9f7aea; background: rgba(159, 122, 234, 0.07); }
.deep-map-step.dm-suppress { color: #fc8181; background: rgba(245, 101, 101, 0.06); }
.deep-map-step.dm-context  { color: #667eea; background: rgba(102, 126, 234, 0.07); }
.deep-map-step.dm-actions  { color: #63b3ed; background: rgba(99, 179, 237, 0.06); }
.deep-map-step.dm-outcome  { color: #48bb78; background: rgba(72, 187, 120, 0.07); }
