:root {
    --ndi-yellow: #ff9d00;
    --ndi-yellow-glow: rgba(255, 157, 0, 0.3);
    --stat-bg: #111116;
    --border-dim: rgba(255, 255, 255, 0.05);
}

.ndi-planner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 20px 60px;
}

.tool-header {
    text-align: center;
    margin-bottom: 50px;
}

/* Dashboard */
.planner-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--stat-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.stat-card .label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.value-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-card .unit {
    font-size: 1rem;
    color: var(--text-muted);
}

.stat-progress-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.stat-progress-fill {
    height: 100%;
    background: var(--brand-cyan);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-msg {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.stat-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.value-sub {
    font-family: var(--font-mono);
    color: var(--brand-cyan);
}

.label-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Multicast Card */
.multicast-stat {
    border-left: 4px solid var(--ndi-yellow);
}

.stat-card .value#network-mode {
    font-size: 1.8rem;
    color: var(--ndi-yellow);
}

/* Layout */
.planner-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    align-items: start;
}

/* Sidebar */
.planner-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.sidebar-block h3 {
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.element-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.add-btn {
    background: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    color: var(--text-main);
}

.add-btn:hover {
    border-color: var(--brand-cyan);
    background: rgba(0, 240, 255, 0.05);
    transform: translateX(5px);
}

.add-btn .icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--brand-cyan);
}

.btn-text {
    display: flex;
    flex-direction: column;
}

.btn-text strong { font-size: 0.9rem; }
.btn-text span { font-size: 0.7rem; color: var(--text-muted); }

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-item label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.setting-item select {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-main);
}

/* Build Area */
.build-area {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    min-height: 600px;
}

.build-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
}

.text-btn:hover { color: #ff3e3e; }

.signal-chain {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.chain-empty {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    gap: 10px;
}

.empty-icon { font-size: 2rem; opacity: 0.5; }

/* Chain Element */
.chain-item {
    background: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.item-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.item-badge {
    background: rgba(255, 157, 0, 0.1);
    color: var(--ndi-yellow);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 30px;
}

.receiver-count {
    display: flex;
    align-items: center;
    gap: 10px;
}

.receiver-count input {
    width: 60px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px;
    color: var(--text-main);
    text-align: center;
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

.btn-remove:hover { color: #ff3e3e; }

/* Latency Timeline */
.latency-timeline {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

.latency-path {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.path-step {
    flex: 1;
    min-width: 150px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.path-step::after {
    content: "→";
    position: absolute;
    right: -10px;
    top: 25px;
    color: var(--text-muted);
    opacity: 0.5;
}

.path-step:last-child::after { display: none; }

.step-node {
    width: 60px;
    height: 60px;
    background: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.step-label { font-size: 0.75rem; color: var(--text-muted); text-align: center; }
.step-value { font-family: var(--font-mono); color: var(--brand-cyan); font-size: 0.8rem; }

/* Warnings */
.warning-high { border-color: #ff3e3e !important; }
.warning-high .status-msg { color: #ff3e3e; }
.warning-high .stat-progress-fill { background: #ff3e3e; }

/* SEO Guide */
.seo-guide {
    margin-top: 60px;
    background: var(--bg-surface);
    border-radius: 20px;
    padding: 40px;
}

/* Responsive */
@media (max-width: 900px) {
    .planner-layout {
        grid-template-columns: 1fr;
    }
}
