/* Run: KPIs, Gantt panel, Petri net player */
.run-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; margin-bottom: 18px; }
.run-head h1 { font-size: 30px; }
.run-head .sub { color: var(--ink-2); margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-panel); margin-bottom: 18px; }
.kpi { padding: 14px 18px; border-left: 1px solid var(--line-2); }
.kpi:first-child { border-left: 0; }
.kpi span { font-size: 12.5px; color: var(--ink-3); }
.kpi strong { display: block; font-family: var(--mono); font-weight: 600; font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi strong small { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.kpi.lead strong { color: var(--blue); }

.gantt-panel .panel-head { flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gantt-wrap { position: relative; padding: 8px 8px 4px; user-select: none; }
.gantt-wrap svg { display: block; width: 100%; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 20px 16px; }
.jobkey {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 12px; cursor: pointer; color: var(--ink-2);
}
.jobkey i { width: 10px; height: 10px; border-radius: 50%; }
.jobkey.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.zoom-hint { font-size: 12px; color: var(--ink-3); }

/* simulation theme (Petri net replay, inspector, home replay): dark by default, light with .theme-light.
   The SVG colors drawn by petri-player.js / policy-view.js come from js/core/sim-theme.js. */
.sim {
  --sim-bg: #1E2229; --sim-bg-2: #2A3039; --sim-line: #3A424D; --sim-dash: #5A636F;
  --sim-text: #E6EAF0; --sim-text-2: #C9D0DA; --sim-muted: #98A2AF; --sim-faint: #7E8894; --sim-strong: #fff;
  --sim-accent: #F2A93B; --sim-shadow: rgba(30, 34, 41, .7);
}
.sim.theme-light {
  --sim-bg: #FBFCFD; --sim-bg-2: #F1F3F6; --sim-line: #DDE2E8; --sim-dash: #A9B1BC;
  --sim-text: #1E2229; --sim-text-2: #3B4350; --sim-muted: #66707C; --sim-faint: #8A939F; --sim-strong: #1E2229;
  --sim-accent: #B8720B; --sim-shadow: rgba(30, 34, 41, .18);
}
.sim.theme-light .player-body, .sim.theme-light .transport { border-color: var(--sim-line); }
.player-tools { display: flex; gap: 10px; align-items: center; }
.player { margin-top: 20px; background: var(--sim-bg); border-radius: 18px; color: var(--sim-text); overflow: hidden; box-shadow: 0 30px 60px -36px var(--sim-shadow); border: 1px solid var(--sim-line); transition: background .3s, color .3s; }
.player-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; gap: 16px; flex-wrap: wrap; }
.player-top h2 { color: var(--sim-strong); font-size: 19px; }
.player-top p { color: var(--sim-muted); font-size: 13px; }
.player-body { display: grid; grid-template-columns: 1fr 300px; min-height: 560px; border-top: 1px solid var(--sim-line); }
.net-stage { position: relative; overflow: hidden; cursor: grab; }
.net-stage.dragging { cursor: grabbing; }
.net-stage svg { width: 100%; height: 100%; display: block; }
.net-zoom { display: flex; gap: 4px; }
.net-zoom button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--sim-line); background: var(--sim-bg-2); color: var(--sim-text-2); cursor: pointer; font-size: 16px; }
.net-zoom button:hover { color: var(--sim-strong); }
.inspector { border-left: 1px solid var(--sim-line); overflow: hidden; display: flex; flex-direction: column; min-height: 0; max-height: 760px; }
.clock-box { padding: 16px 18px; border-bottom: 1px solid var(--sim-line); }
.clock-box span { color: var(--sim-muted); font-size: 12.5px; }
.clock-box .clock { font-family: var(--mono); font-size: 36px; color: var(--sim-accent); line-height: 1.1; font-variant-numeric: tabular-nums; }
.clock-box .clock small { font-size: 15px; color: var(--sim-muted); }
.clock-stats { display: flex; gap: 16px; margin-top: 6px; font-size: 12.5px; color: var(--sim-muted); }
.clock-stats b { color: var(--sim-strong); font-family: var(--mono); font-weight: 600; }
.decision { padding: 14px 18px; border-bottom: 1px solid var(--sim-line); }
.decision h3 { font-size: 13px; color: var(--sim-muted); font-weight: 500; margin-bottom: 8px; }
.decision .chosen { font-size: 15px; color: var(--sim-strong); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.dlog { position: relative; overflow: auto; flex: 1; min-height: 0; padding: 6px 8px 12px; }
.dlog h3 { font-size: 13px; color: var(--sim-muted); font-weight: 500; padding: 8px 10px 4px; }
.dlog button {
  display: grid; grid-template-columns: 52px 14px 1fr; gap: 8px; align-items: center; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--sim-text-2); padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px;
}
.dlog button:hover { background: var(--sim-bg-2); }
.dlog button.now { background: var(--sim-line); color: var(--sim-strong); }
.dlog button .t { font-family: var(--mono); color: var(--sim-muted); }
.dlog button i { width: 10px; height: 10px; border-radius: 50%; }

.transport { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--sim-line); background: var(--sim-bg-2); }
.transport .keys { display: flex; gap: 6px; }
.tbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--sim-line); background: var(--sim-bg); color: var(--sim-text); cursor: pointer; display: grid; place-items: center; }
.tbtn:hover { border-color: var(--sim-dash); }
.tbtn.play { width: 48px; background: var(--amber); border-color: var(--amber); color: #1E2229; }
.tbtn svg { width: 16px; height: 16px; }
.scrub { position: relative; height: 34px; cursor: pointer; }
.scrub .track { position: absolute; left: 0; right: 0; top: 15px; height: 4px; border-radius: 99px; background: var(--sim-line); }
.scrub .fill { position: absolute; left: 0; top: 15px; height: 4px; border-radius: 99px; background: var(--amber); }
.scrub .knob { position: absolute; top: 9px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface); border: 1px solid var(--sim-dash); box-shadow: 0 0 0 4px rgba(242,169,59,.35); }
.scrub .ticks { position: absolute; left: 0; right: 0; top: 24px; height: 8px; }
.scrub .ticks i { position: absolute; width: 1px; height: 5px; background: var(--sim-dash); }
.speed { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--sim-muted); }
.speed select { background: var(--sim-bg); color: var(--sim-strong); border: 1px solid var(--sim-line); border-radius: 8px; height: 32px; padding: 0 8px; }
.net-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--sim-muted); padding: 0 22px 14px; }
.net-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kpi em { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.policy { margin-top: 10px; }
.policy svg { display: block; }
.conf { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.conf-label { font-size: 12.5px; color: var(--sim-muted); }
.conf-label b { font-weight: 700; }
.strip-box { padding: 4px 10px 8px; }
.strip-box h3 { padding: 4px 0 6px !important; }
.conf-strip { width: 100%; height: 34px; display: block; cursor: pointer; border-radius: 4px; }
/* agent transitions: enabled / masked states (petri-player.js) */
.ctl { transition: fill .3s, stroke .3s, opacity .3s; }
.ctl-halo { opacity: 0; transform-box: fill-box; transform-origin: center; pointer-events: none; }
.ctl-halo.pulse { animation: ctlpulse 1.4s ease-out infinite; }
@keyframes ctlpulse { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7, 2.6); } }
.ctl-cross { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.3); transition: opacity .25s, transform .25s; }
.ctl-cross.show { opacity: .9; transform: scale(1); }
.masked-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; font-size: 11.5px; }
.masked-title { color: var(--sim-muted); margin-right: 4px; }
.masked-chip {
  position: relative; padding: 1px 6px; border-radius: 4px; border: 1px dashed var(--sim-dash); color: var(--sim-faint);
  font-family: var(--mono); font-size: 11px;
}
.masked-chip::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 1.5px; background: #D2453B; opacity: .8; }
.masked-row.animate .masked-chip { animation: maskin .35s ease-out both; }
.masked-row.animate .masked-chip::after { animation: strike .3s ease-out both; animation-delay: inherit; }
@keyframes maskin { from { opacity: 0; transform: translateY(3px); } }
@keyframes strike { from { transform: scaleX(0); } }
.htag { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--sim-faint); margin-left: 8px; }
.htag.first { color: var(--sim-accent); }
.macro-line { font-size: 12.5px; color: var(--sim-muted); margin: -4px 0 4px; }
.macro-line b { color: var(--sim-accent); font-weight: 600; }
.cite-note { margin-top: 8px; font-size: 13px; color: var(--ink-3); max-width: 90ch; }
.cite-note a { color: var(--blue-ink); }
