﻿        :root {
            --fa-accent-rgb: 95, 163, 154;
            --fa-accent-soft-rgb: 141, 197, 189;
            --fa-accent: #5fa39a;
            --fa-accent-strong: #4d8b83;
        }
        .type-resource { background: linear-gradient(135deg, #b65f5f, #8f4040); }
        .type-factory { background: linear-gradient(135deg, var(--fa-accent), var(--fa-accent-strong)); }
        .factory-brand-accent { color: var(--fa-accent); }
        .factory-topbar {
            background:
                linear-gradient(180deg, rgba(24, 35, 37, 0.94), rgba(17, 27, 29, 0.94));
            border-bottom: 1px solid rgba(var(--fa-accent-rgb), 0.28);
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.1),
                inset 0 -10px 18px rgba(2, 6, 23, 0.28);
        }
        .factory-side { width: 360px; background: rgba(15, 23, 42, 0.85); border-left: 1px solid rgba(148, 163, 184, 0.25); backdrop-filter: blur(12px); }
        .factory-input, .factory-select { width: 100%; border-radius: 8px; border: 1px solid rgba(148, 163, 184, 0.35); background: rgba(15, 23, 42, 0.7); color: #dbe7f3; padding: 7px 9px; font-size: 12px; outline: none; }
        .factory-input:focus, .factory-select:focus { border-color: rgba(var(--fa-accent-rgb), 0.72); }
        .factory-chip { background: rgba(15, 23, 42, 0.65); border: 1px solid rgba(148, 163, 184, 0.35); border-radius: 10px; padding: 6px 8px; font-size: 11px; color: #cbd5e1; }
        .entity-card {
            background: rgba(30, 41, 59, 0.64);
            border: 1px solid rgba(148, 163, 184, 0.48);
            border-radius: 12px;
            padding: 8px;
            box-shadow:
                0 18px 28px -14px rgba(2, 6, 23, 0.86),
                inset 0 1px 0 rgba(255, 255, 255, 0.24),
                inset 0 -10px 20px rgba(2, 6, 23, 0.36);
            backdrop-filter: blur(16px) saturate(1.2);
            -webkit-backdrop-filter: blur(16px) saturate(1.2);
        }
        .mode-btn {
            padding: 6px 10px;
            border-radius: 8px;
            border: 1px solid transparent;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.03em;
            text-transform: uppercase;
            transition: all 0.15s ease;
        }
        .mode-btn.active {
            background: rgba(var(--fa-accent-rgb), 0.24);
            border-color: rgba(var(--fa-accent-soft-rgb), 0.62);
            color: #e7f8f5;
        }
        .mode-btn.inactive {
            background: rgba(15, 23, 42, 0.55);
            border-color: rgba(148, 163, 184, 0.24);
            color: #9aa4b2;
        }
        .mode-btn.inactive:hover {
            background: rgba(30, 41, 59, 0.65);
            color: #dbe7f3;
        }
        .sim-table th, .sim-table td {
            padding: 8px 11px;
            font-size: 13px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.2);
            white-space: nowrap;
            text-align: left;
        }
        .sim-table th {
            font-size: 12px;
            letter-spacing: 0.03em;
        }
        .mode-switch-shell {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            display: inline-flex;
            gap: 4px;
            padding: 4px;
            border-radius: 12px;
            border: 1px solid rgba(148, 163, 184, 0.34);
            background: rgba(15, 23, 42, 0.78);
            box-shadow: 0 10px 18px -10px rgba(2, 6, 23, 0.85);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        .mode-switch-shell .mode-btn {
            min-width: 132px;
            font-size: 12px;
            padding: 7px 12px;
            border-radius: 9px;
        }
        .sim-factory-card {
            background: linear-gradient(160deg, rgba(32, 39, 40, 0.74), rgba(20, 26, 27, 0.74));
            border-color: rgba(var(--fa-accent-rgb), 0.32);
            box-shadow:
                0 14px 24px -14px rgba(2, 6, 23, 0.84),
                inset 0 1px 0 rgba(255, 255, 255, 0.24),
                inset 0 -10px 20px rgba(2, 6, 23, 0.36);
        }
        .legend-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 2px 8px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(15, 23, 42, 0.55);
            font-size: 10px;
            color: #cbd5e1;
            white-space: nowrap;
        }
        .legend-dot {
            width: 8px;
            height: 8px;
            border-radius: 999px;
            display: inline-block;
        }
        .sim-tooltip {
            position: absolute;
            min-width: 180px;
            max-width: 280px;
            padding: 8px;
            border-radius: 10px;
            border: 1px solid rgba(148, 163, 184, 0.34);
            background: rgba(2, 6, 23, 0.82);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            box-shadow: 0 10px 18px -12px rgba(2, 6, 23, 0.92);
            pointer-events: none;
            z-index: 12;
        }
        .sim-left-shell {
            height: 100%;
            border-radius: 14px;
            border: 1px solid rgba(var(--fa-accent-rgb), 0.22);
            background:
                linear-gradient(160deg, rgba(22, 30, 32, 0.8), rgba(14, 21, 23, 0.78)),
                radial-gradient(120% 180% at 0% 0%, rgba(var(--fa-accent-rgb), 0.08), rgba(var(--fa-accent-rgb), 0) 52%);
            box-shadow:
                0 22px 32px -20px rgba(2, 6, 23, 0.92),
                inset 0 1px 0 rgba(255, 255, 255, 0.16),
                inset 0 -14px 24px rgba(2, 6, 23, 0.3);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .sim-divider {
            height: 1px;
            background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.35), rgba(148, 163, 184, 0));
            margin: 0 14px;
        }
        .sim-controls {
            padding: 12px 14px 10px;
            display: flex;
            align-items: flex-end;
            gap: 10px;
            flex-wrap: wrap;
        }
        .sim-main-row {
            flex: 1;
            min-height: 280px;
            display: grid;
            grid-template-columns: minmax(0, 1fr) 320px;
            gap: 12px;
            padding: 10px 14px;
        }
        .sim-graph-shell {
            border-radius: 12px;
            border: 1px solid rgba(var(--fa-accent-rgb), 0.24);
            background: rgba(15, 23, 42, 0.48);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
        }
        .sim-graph-head {
            padding: 10px 12px 8px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.2);
        }
        .sim-graph-canvas {
            position: relative;
            flex: 1;
            min-height: 260px;
            overflow: hidden;
        }
        .sim-graph-svg {
            position: absolute;
            inset: 10px 10px 6px 10px;
            width: calc(100% - 20px);
            height: calc(100% - 16px);
            display: block;
        }
        .sim-summary-inline {
            border-top: 1px solid rgba(148, 163, 184, 0.2);
            padding: 10px 12px;
            font-size: 13px;
            line-height: 1.35;
            color: #dbe7f3;
            background: rgba(15, 21, 22, 0.36);
        }
        .sim-summary-content {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 360px;
            gap: 12px;
            align-items: start;
        }
        .sim-summary-left {
            min-width: 0;
        }
        .sim-summary-right {
            min-width: 0;
            border-left: 1px solid rgba(148, 163, 184, 0.2);
            padding-left: 12px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .sim-summary-kpi-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
        }
        .sim-summary-kpi-card {
            border-radius: 9px;
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(15, 23, 42, 0.45);
            padding: 7px 8px;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.14),
                inset 0 -8px 16px rgba(2, 6, 23, 0.26);
        }
        .sim-summary-kpi-card .kpi-title {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            color: #9aa4b2;
        }
        .sim-summary-kpi-card .kpi-value {
            font-size: 14px;
            font-weight: 700;
            line-height: 1.15;
            color: #e2e8f0;
        }
        .sim-summary-kpi-card .kpi-note {
            font-size: 11px;
            color: #94a3b8;
        }
        .sim-summary-kpi-card.tone-ok .kpi-value { color: #6ee7b7; }
        .sim-summary-kpi-card.tone-warn .kpi-value { color: #fbbf24; }
        .sim-summary-kpi-card.tone-bad .kpi-value { color: #fda4af; }
        .sim-summary-kpi-card.tone-info .kpi-value { color: #a7f3d0; }
        .sim-summary-reco-shell {
            border-radius: 9px;
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(15, 23, 42, 0.45);
            padding: 8px;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.14),
                inset 0 -8px 16px rgba(2, 6, 23, 0.26);
        }
        .sim-summary-reco-title {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            color: #9aa4b2;
            margin-bottom: 6px;
        }
        .sim-summary-reco-item {
            font-size: 12px;
            line-height: 1.35;
            color: #dbe7f3;
            border-radius: 8px;
            border: 1px solid rgba(148, 163, 184, 0.2);
            background: rgba(30, 41, 59, 0.25);
            padding: 6px 7px;
        }
        .sim-summary-reco-item + .sim-summary-reco-item {
            margin-top: 6px;
        }
        .sim-summary-reco-item.tone-ok { border-color: rgba(16, 185, 129, 0.36); }
        .sim-summary-reco-item.tone-warn { border-color: rgba(251, 191, 36, 0.38); }
        .sim-summary-reco-item.tone-bad { border-color: rgba(251, 113, 133, 0.4); }
        .sim-summary-reco-item.tone-info { border-color: rgba(var(--fa-accent-rgb), 0.36); }
        @media (max-width: 1450px) {
            .sim-summary-content {
                grid-template-columns: minmax(0, 1fr);
            }
            .sim-summary-right {
                border-left: none;
                border-top: 1px solid rgba(148, 163, 184, 0.2);
                padding-left: 0;
                padding-top: 10px;
            }
        }
        .sim-netrate-shell {
            border-radius: 12px;
            border: 1px solid rgba(var(--fa-accent-rgb), 0.26);
            background:
                linear-gradient(160deg, rgba(28, 38, 38, 0.74), rgba(17, 25, 26, 0.74)),
                radial-gradient(140% 120% at 0% 0%, rgba(var(--fa-accent-rgb), 0.07), rgba(var(--fa-accent-rgb), 0) 50%);
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.18),
                inset 0 -10px 20px rgba(2, 6, 23, 0.28);
            padding: 10px;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }
        .sim-splitter {
            height: 12px;
            margin: 2px 14px 0;
            cursor: row-resize;
            display: flex;
            align-items: center;
            justify-content: center;
            user-select: none;
        }
        .sim-splitter::before {
            content: '';
            width: 88px;
            height: 4px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.34);
            background: rgba(30, 41, 59, 0.7);
            box-shadow: 0 6px 10px -8px rgba(2, 6, 23, 0.95);
            transition: all 0.16s ease;
        }
        .sim-splitter:hover::before {
            border-color: rgba(var(--fa-accent-soft-rgb), 0.55);
            background: rgba(var(--fa-accent-rgb), 0.28);
        }
        .sim-table-shell {
            padding: 10px 14px 14px;
            min-height: 0;
            overflow: auto;
        }
        .sim-factory-side {
            background:
                linear-gradient(180deg, rgba(24, 33, 36, 0.88), rgba(18, 27, 30, 0.88));
            border-left-color: rgba(var(--fa-accent-rgb), 0.24);
        }
        .section-title-plate {
            --plate-edge-x: 10px;
            --plate-edge-y: 10px;
            width: calc(100% + (var(--plate-edge-x) * 2));
            margin: calc(-1 * var(--plate-edge-y)) calc(-1 * var(--plate-edge-x)) 8px;
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 8px 12px;
            border-radius: 10px 10px 0 0;
            border: 1px solid rgba(148, 163, 184, 0.34);
            border-bottom-color: rgba(255, 255, 255, 0.1);
            background: rgba(30, 41, 59, 0.22);
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.22),
                inset 0 -10px 20px rgba(2, 6, 23, 0.24),
                0 10px 18px -14px rgba(2, 6, 23, 0.9);
            color: #eef6ff;
        }
        .section-title-plate::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: linear-gradient(135deg, rgba(var(--fa-accent-rgb), 0.62), rgba(77, 139, 131, 0.58));
            z-index: 0;
            pointer-events: none;
        }
        .section-title-plate > * {
            position: relative;
            z-index: 1;
        }
        .section-title-plate-netrate::before {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.72), rgba(5, 150, 105, 0.72));
        }
        .section-title-plate-netrate,
        .section-title-plate-netrate > * {
            color: #f8fafc;
            text-shadow: 0 1px 1px rgba(2, 6, 23, 0.55);
        }
        button.section-title-plate {
            cursor: pointer;
            text-align: left;
            appearance: none;
        }
        .plate-edge-8 { --plate-edge-x: 8px; --plate-edge-y: 8px; }
        .plate-edge-10 { --plate-edge-x: 10px; --plate-edge-y: 10px; }
        .plate-edge-12 { --plate-edge-x: 12px; --plate-edge-y: 10px; }
        .section-title-action {
            width: 20px;
            height: 20px;
            border-radius: 999px;
            border: 1px solid rgba(219, 234, 254, 0.46);
            background: rgba(15, 23, 42, 0.28);
            color: #e2e8f0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            line-height: 1;
            transition: background 0.15s ease;
        }
        .section-title-action:hover {
            background: rgba(15, 23, 42, 0.58);
        }
        .section-chevron {
            transition: transform 0.16s ease;
        }
        .section-chevron.collapsed {
            transform: rotate(-90deg);
        }
        .optimizer-calc-overlay {
            position: absolute;
            inset: 0;
            background: rgba(2, 6, 23, 0.58);
            backdrop-filter: blur(2px);
            -webkit-backdrop-filter: blur(2px);
            border-radius: 10px;
            overflow: hidden;
            z-index: 18;
            pointer-events: none;
        }
        .optimizer-calc-badge {
            position: absolute;
            top: 10px;
            left: 10px;
            padding: 4px 10px;
            border-radius: 999px;
            border: 1px solid rgba(var(--fa-accent-soft-rgb), 0.46);
            background: rgba(15, 23, 42, 0.78);
            color: #e7f8f5;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.02em;
            z-index: 3;
        }
        .optimizer-calc-particle {
            position: absolute;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.38);
            box-shadow:
                0 8px 14px -10px rgba(2, 6, 23, 0.94),
                inset 0 1px 0 rgba(255, 255, 255, 0.16);
            z-index: 2;
        }
        .optimizer-calc-particle.resource {
            background: linear-gradient(165deg, rgba(185, 90, 90, 0.9), rgba(143, 64, 64, 0.9));
            color: #fee2e2;
        }
        .optimizer-calc-particle.factory {
            background: linear-gradient(165deg, rgba(var(--fa-accent-rgb), 0.9), rgba(77, 139, 131, 0.9));
            color: #e7f8f5;
        }
        .optimizer-help-panel {
            width: min(980px, 100%);
            max-height: 88vh;
            overflow: hidden;
            border-radius: 14px;
            border: 1px solid rgba(148, 163, 184, 0.34);
            background:
                linear-gradient(176deg, rgba(44, 52, 64, 0.97), rgba(31, 39, 51, 0.97)),
                radial-gradient(140% 140% at 100% 0%, rgba(var(--fa-accent-rgb), 0.16), rgba(var(--fa-accent-rgb), 0) 52%);
            box-shadow:
                0 32px 48px -24px rgba(2, 6, 23, 0.92),
                inset 0 1px 0 rgba(255, 255, 255, 0.18),
                inset 0 -16px 24px rgba(2, 6, 23, 0.34);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            display: flex;
            flex-direction: column;
        }
        .optimizer-help-body {
            overflow: auto;
            padding-right: 6px;
            font-size: 14px;
            line-height: 1.62;
            color: #9aa4b2;
        }
        .optimizer-help-body strong {
            color: #eef4fb;
            font-weight: 700;
        }
        .optimizer-help-section {
            border: 1px solid rgba(148, 163, 184, 0.24);
            border-radius: 12px;
            background:
                linear-gradient(165deg, rgba(71, 85, 105, 0.22), rgba(51, 65, 85, 0.18));
            padding: 10px 12px;
        }
        .optimizer-help-heading {
            color: #f1f5f9;
            font-weight: 700;
            font-size: 14px;
            letter-spacing: 0.01em;
            margin-bottom: 4px;
        }
        .optimizer-help-list {
            display: grid;
            gap: 8px;
            margin-top: 4px;
        }
        .node-meta { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #cbd5e1; }
        .drop-hint { position: absolute; top: 16px; left: 16px; z-index: 60; padding: 8px 10px; border-radius: 10px; background: rgba(15, 23, 42, 0.85); border: 1px solid rgba(148, 163, 184, 0.35); font-size: 11px; color: #9aa4b2; }
        .node-inline-list { margin-top: 6px; display: flex; flex-direction: column; gap: 5px; }
        .node-inline-row { display: grid; grid-template-columns: 1fr 62px auto; gap: 5px; align-items: center; }
        .node-inline-add {
            margin-top: 5px;
            width: 100%;
            border: 1px dashed rgba(148, 163, 184, 0.42);
            border-radius: 8px;
            padding: 4px 6px;
            font-size: 10px;
            color: #cbd5e1;
            background: rgba(15, 23, 42, 0.45);
        }
        .node-inline-add:hover { border-color: rgba(var(--fa-accent-soft-rgb), 0.6); color: #e2e8f0; }
        .node-inline-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #9aa4b2; }



