:root { --navy:#17365d; --blue:#2f66f5; --ink:#1f2937; --muted:#64748b; --line:#d9e2ef; --panel:#ffffff; --wash:#f3f6fb; --amber:#fff3cd; --green:#16834b; --red:#b42318; }
* { box-sizing:border-box; }
body { margin:0; background:var(--wash); color:var(--ink); font-family:"Pretendard","Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",Arial,sans-serif; }
button,select,input { font:inherit; }
button { cursor:pointer; }
.topbar { min-height:90px; padding:17px 28px; background:linear-gradient(105deg,#17365d,#204c7d); color:white; display:flex; align-items:center; justify-content:space-between; gap:20px; box-shadow:0 8px 24px rgba(23,54,93,.14); }
.topbar h1 { margin:3px 0 0; font-size:25px; letter-spacing:-.04em; }
.eyebrow { margin:0; font-size:12px; opacity:.76; letter-spacing:.03em; }
.status-pill { border:1px solid rgba(255,255,255,.35); border-radius:999px; padding:8px 12px; font-size:12px; white-space:nowrap; }
.workspace { padding:14px; display:grid; gap:11px; max-width:1680px; margin:auto; }
.mode-tabs,.controls,.scenario-summary,.aux-strip,.comparison-card,.caveat,.method-strip { border:1px solid var(--line); background:var(--panel); border-radius:14px; }
.mode-tabs { padding:10px 12px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.mode-tabs > span { font-size:12px; color:var(--muted); margin-right:2px; }
.mode-tabs button { border:1px solid #c8d4e3; background:white; color:#334155; padding:10px 15px; border-radius:10px; font-weight:700; }
.mode-tabs button.active { border-color:var(--blue); background:var(--blue); color:white; box-shadow:0 6px 15px rgba(47,102,245,.22); }
.controls { padding:11px; display:grid; grid-template-columns:repeat(4,minmax(120px,160px)) minmax(240px,1fr) 100px auto; gap:9px; align-items:end; }
.current-controls { grid-template-columns:repeat(4,minmax(110px,150px)) minmax(220px,1fr) 88px 158px auto; }
.controls label { display:grid; gap:5px; font-size:11px; color:var(--muted); }
.controls select { border:1px solid #cbd5e1; background:white; border-radius:9px; padding:9px 10px; color:var(--ink); }
.time-control { grid-template-columns:auto auto; }
.time-control span { text-align:right; color:var(--navy); font-weight:800; }
.time-control input { grid-column:1 / -1; accent-color:var(--blue); }
.play-button,.peak-button { border:0; border-radius:9px; padding:10px; color:white; font-weight:800; white-space:nowrap; }
.play-button { background:var(--navy); }
.peak-button { background:#4f6590; }
.layer-toggle { min-height:39px; display:flex !important; grid-template-columns:auto 1fr; align-items:center; gap:7px !important; padding:0 4px; color:var(--ink) !important; white-space:nowrap; }
.layer-toggle input { width:17px; height:17px; accent-color:var(--blue); }
.scenario-summary { padding:13px 16px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.scenario-summary p,.comparison-card header p { margin:0; color:var(--navy); font-size:13px; font-weight:800; }
.scenario-summary h2,.comparison-card header h2 { margin:3px 0; font-size:16px; letter-spacing:-.02em; }
.scenario-summary small { color:var(--muted); }
.scenario-summary > span,.comparison-card header > span { background:#eef3ff; color:#3158bd; border-radius:999px; padding:7px 11px; font-size:11px; font-weight:800; white-space:nowrap; }
.scope-label { margin:1px 2px -5px; color:var(--muted); font-size:11px; }
.metrics-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; }
.metric-card { background:white; border:1px solid var(--line); border-radius:14px; padding:13px; }
.metric-card p { margin:0 0 8px; font-size:12px; color:var(--muted); }
.metric-values strong { font-size:20px; letter-spacing:-.04em; }
.metric-card small { display:block; margin-top:7px; color:var(--muted); font-weight:800; }
.aux-strip { display:grid; grid-template-columns:repeat(4,1fr); overflow:hidden; }
.aux-strip span { padding:10px 13px; color:var(--muted); font-size:11px; border-right:1px solid var(--line); }
.aux-strip span:last-child { border:0; }
.aux-strip strong { float:right; color:var(--ink); }
.graphs-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.graph-card { min-width:0; background:white; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.graph-card.wide { width:100%; }
.graph-card header { padding:11px 13px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--line); gap:10px; }
.graph-card header div { display:grid; gap:2px; }
.graph-card header strong { font-size:14px; }
.graph-card header span,.graph-card header small { font-size:11px; color:var(--muted); }
.graph-card svg { display:block; width:100%; height:auto; background:linear-gradient(#fbfdff,#f7faff); }
.current-svg { min-height:480px; }
.external-svg { min-height:390px; background:#eef2f5; }
.base-edge { stroke:#dbe3ee; stroke-width:1.05; opacity:.92; }
.occupied-edge { stroke:#f59e0b; opacity:.72; stroke-linecap:round; }
.p95-edge { stroke:#b42318; opacity:.9; stroke-linecap:round; }
.corridor-node { fill:#8fa0b7; }
.stair-node { fill:#f59e0b; stroke:white; stroke-width:1; }
.connector-node { fill:#7c3aed; stroke:white; stroke-width:1; }
.exit-node { fill:#16834b; stroke:white; stroke-width:1; }
.space-node { stroke:white; stroke-width:1.1; }
.room-label { font-size:7.5px; fill:#334155; font-weight:700; }
.floor-label { font-size:10px; font-weight:800; fill:#64748b; }
.building-label { font-size:12px; font-weight:800; fill:#17365d; }
.class-agent circle,.external-agent { stroke:white; stroke-width:1.5; filter:drop-shadow(0 1px 2px rgba(15,23,42,.24)); }
.class-agent rect { fill:white; stroke:#cbd5e1; stroke-width:.75; opacity:.96; }
.class-agent text { font-size:8px; fill:#24364b; font-weight:800; }
.dimmed { opacity:.10; }
.graph-live { display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid var(--line); background:#fbfcfe; }
.graph-live span { padding:8px 10px; font-size:10px; color:var(--muted); border-right:1px solid var(--line); }
.graph-live span:last-child { border:0; }
.graph-live strong { display:block; margin-top:2px; color:var(--ink); font-size:12px; }
.legend { display:flex; gap:11px; padding:9px 12px; border-top:1px solid var(--line); font-size:9.5px; color:var(--muted); flex-wrap:wrap; }
.legend span { display:flex; align-items:center; gap:5px; }
.legend i { display:inline-block; width:11px; height:9px; border-radius:3px; }
.legend .special-key { background:#e8eef5; border:1px solid #bdc9d8; }
.legend .agent-key { width:10px; height:10px; border-radius:50%; background:var(--navy); border:2px solid white; box-shadow:0 0 0 1px #8fa1b6; }
.legend .external-agent-key { width:10px; height:10px; border-radius:50%; background:#7c3aed; border:2px solid white; box-shadow:0 0 0 1px #8fa1b6; }
.legend .occupied-key,.legend .hot-key,.legend .shared-key { height:3px; width:17px; border-radius:999px; }
.legend .occupied-key { background:#f59e0b; }
.legend .hot-key { background:#b42318; }
.legend .shared-key { background:#7c3aed; }
.legend .density-legend-row { flex:1 0 100%; display:flex; align-items:center; gap:11px; flex-wrap:wrap; padding-top:2px; }
.legend .density-key { height:8px; width:16px; border:1px solid rgba(120,88,20,.16); }
.legend .density-label { font-weight:800; color:#475569; }
.plan-image { opacity:.54; filter:contrast(.88) brightness(1.08); }
.plan-wash { fill:rgba(255,255,255,.16); }
.scenario-path { fill:none; stroke:#2f66f5; stroke-width:22; stroke-linecap:round; stroke-linejoin:round; }
.shared-edge { fill:none; stroke:#7c3aed; stroke-width:42; opacity:.32; stroke-linecap:round; stroke-linejoin:round; }
.control-branch { fill:none; stroke:#b42318; stroke-width:9; stroke-dasharray:22 16; }
.safe-branch { fill:none; stroke:#16834b; stroke-width:9; stroke-dasharray:22 16; }
.route-node { fill:white; stroke:#17365d; stroke-width:8; }
.gate-node { fill:#17365d; }
.inactive-gate { fill:#94a3b8; stroke:white; stroke-width:7; opacity:.86; }
.facility-node { fill:#2f66f5; stroke:white; stroke-width:8; }
.external-label,.plan-label { font-size:34px; paint-order:stroke; stroke:white; stroke-width:9px; stroke-linejoin:round; fill:#24364b; font-weight:850; }
.minor-plan-label { font-size:27px; paint-order:stroke; stroke:white; stroke-width:8px; fill:#475569; font-weight:750; }
.risk-label { font-size:28px; paint-order:stroke; stroke:white; stroke-width:8px; fill:#b42318; font-weight:850; }
.safe-label { font-size:28px; paint-order:stroke; stroke:white; stroke-width:8px; fill:#16834b; font-weight:850; }
.north-arrow { fill:#17365d; stroke:white; stroke-width:5; }
.north-text { font-size:34px; fill:#17365d; font-weight:900; paint-order:stroke; stroke:white; stroke-width:8px; }
.forbidden-zone { fill:#b42318; opacity:.12; stroke:#b42318; stroke-width:8; stroke-dasharray:22 14; }
.floor-badge { fill:white; stroke:#17365d; stroke-width:7; }
.floor-badge-text { font-size:28px; fill:#17365d; font-weight:900; }
.comparison-card { overflow:hidden; }
.comparison-card header { padding:13px 16px; display:flex; justify-content:space-between; align-items:center; gap:16px; border-bottom:1px solid var(--line); }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; font-size:12px; }
th,td { padding:10px 14px; border-bottom:1px solid #e7edf5; text-align:right; }
th:first-child,td:first-child,td.text-left { text-align:left; }
thead { background:#f7f9fc; }
th { color:#475569; }
.decision-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; padding:12px; background:#fbfcfe; }
.decision-grid article { border-left:3px solid #9fb4d2; padding:4px 10px; }
.decision-grid strong { font-size:12px; color:var(--navy); }
.decision-grid p { margin:5px 0 0; font-size:12px; line-height:1.65; color:#526175; }
.caveat { padding:12px 14px; display:flex; gap:12px; background:var(--amber); border-color:#ebcd71; color:#765e12; font-size:11px; line-height:1.6; }
.caveat strong { white-space:nowrap; }
.method-strip { padding:10px 14px; display:flex; justify-content:space-between; gap:14px; font-size:11px; color:var(--muted); }
.method-strip strong { color:var(--navy); }
.state-page { min-height:100vh; display:grid; place-content:center; text-align:center; gap:12px; }
.loader { width:34px; height:34px; border:3px solid #d9e2ef; border-top-color:#2f66f5; border-radius:50%; animation:spin .8s linear infinite; margin:auto; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (max-width:1180px) { .controls { grid-template-columns:repeat(3,1fr); } .time-control { grid-column:1 / 3; } .graphs-grid { grid-template-columns:1fr; } .external-svg { min-height:620px; } .metrics-grid { grid-template-columns:1fr 1fr; } }
@media (max-width:720px) { .topbar { padding:16px; align-items:flex-start; flex-direction:column; } .topbar h1 { font-size:20px; } .status-pill { font-size:10px; } .workspace { padding:8px; } .mode-tabs button { flex:1 1 100%; text-align:left; } .controls { grid-template-columns:1fr 1fr; } .time-control { grid-column:1 / -1; } .metrics-grid,.aux-strip,.graph-live { grid-template-columns:1fr 1fr; } .aux-strip span,.graph-live span { border-right:0; border-bottom:1px solid var(--line); } .scenario-summary,.comparison-card header { align-items:flex-start; flex-direction:column; } .metric-values strong { font-size:18px; } .caveat,.method-strip { flex-direction:column; } .decision-grid { grid-template-columns:1fr; } .current-svg { min-height:360px; } }
