/* Professional three-panel planner shell */
.simulation-nav {
  border-left: 1px solid rgba(255,255,255,.13);
}

.simulation-view.active {
  display: flex;
  width: 100%;
  height: calc(100vh - 84px);
  min-height: 650px;
  flex-direction: column;
  padding: 18px 22px 22px;
  background: #eef3f8;
}

.simulation-page-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4px 14px;
}

.simulation-page-heading h2 {
  margin: 4px 0 3px;
  color: #14263d;
  font-size: 22px;
}

.simulation-page-heading p {
  margin: 0;
  color: #68798d;
  font-size: 12px;
}

.related-view-link {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid #bfd5e5;
  border-radius: 8px;
  background: #fff;
  color: #1769aa;
  font-size: 11px;
  font-weight: 700;
}

.related-view-link:hover {
  border-color: #1769aa;
  background: #f3f9fd;
}

.simulation-frame-shell {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #d4dee8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18,43,70,.1);
}

.simulation-frame-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media(max-width:1050px) {
  .simulation-view.active { height: calc(100vh - 132px); }
}

@media(max-width:720px) {
  .simulation-view.active { min-height: 720px; padding: 14px; }
  .simulation-page-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .simulation-page-heading p { line-height: 1.45; }
}

#view-planner.layout.active {
  display: grid;
  grid-template-columns: 330px minmax(520px, 1fr) 440px;
  height: calc(100vh - 84px);
  min-height: 650px;
  overflow: hidden;
  background: #eef3f8;
}

.planner-column,
.results-rail {
  min-width: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c7d2df transparent;
}

.planner-column {
  padding: 20px;
  border-right: 1px solid #dce4ec;
  background: #fff;
}

.results-rail {
  padding: 18px;
  border-left: 1px solid #dce4ec;
  background: #f7f9fc;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0 0 3px;
  color: #14263d;
  font-size: 17px;
}

.panel-heading p {
  margin: 0;
  color: #7a899b;
  font-size: 11px;
}

.step-number {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #1769aa, #0d4f85);
  box-shadow: 0 5px 13px rgba(23,105,170,.24);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.planner-form label {
  margin-top: 14px;
  color: #34465b;
  font-size: 11px;
}

.planner-form input,
.planner-form select,
.planner-form textarea {
  border-color: #d5dee8;
  background: #f9fbfd;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.planner-form input:focus,
.planner-form select:focus,
.planner-form textarea:focus {
  outline: 0;
  border-color: #4c94cc;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23,105,170,.1);
}

.planner-form textarea {
  height: 205px;
  font-size: 11px;
}

.planner-form .actions {
  position: sticky;
  bottom: -1px;
  z-index: 3;
  margin: 18px -4px -4px;
  padding: 10px 4px 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
}

.planner-form button {
  min-height: 42px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.planner-form button:not(:disabled):hover {
  transform: translateY(-1px);
}

.planner-form .primary {
  box-shadow: 0 6px 15px rgba(23,105,170,.24);
}

.map-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 14px;
  background: #eaf0f6;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  margin-bottom: 10px;
  padding: 9px 13px;
  border: 1px solid #d9e3ec;
  border-radius: 11px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 13px rgba(18,43,70,.06);
}

.map-toolbar>div:first-child {
  display: grid;
  grid-template-columns: 10px auto;
  column-gap: 8px;
}

.map-toolbar strong {
  color: #22374f;
  font-size: 12px;
}

.map-toolbar small {
  grid-column: 2;
  color: #7b8999;
  font-size: 9px;
}

.live-dot {
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10a37f;
  box-shadow: 0 0 0 4px rgba(16,163,127,.12);
}

.map-key {
  display: flex;
  gap: 12px;
}

.key-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #718096;
  font-size: 9px;
  white-space: nowrap;
}

.key-item b {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-size: 9px;
}

.key-d { background: #b71c1c; }
.key-e { background: #7c3aed; }
.key-p { background: #008f72; }

.map-column .map-shell,
.map-column .map-shell #map {
  height: 100%;
  min-height: 0;
  border-radius: 13px;
}

.map-column .map-shell {
  flex: 1;
  border: 1px solid #d5dfe8;
  box-shadow: 0 8px 24px rgba(18,43,70,.1);
}

.results-heading {
  margin-bottom: 13px;
}

.rail-summary-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 10px;
  margin-bottom: 14px;
}

.rail-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dfe6ee;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(18,43,70,.05);
}

.rail-card h2,
.result-pane h2 {
  margin: 0 0 10px;
  color: #21364e;
  font-size: 13px;
}

.rail-card .activity-row {
  grid-template-columns: 22px 1fr;
  min-height: 50px;
}

.rail-card .activity-node span {
  width: 17px;
  height: 17px;
  border-width: 4px;
}

.rail-card .activity-row:not(:last-child)::after {
  left: 7px;
  top: 20px;
}

.rail-card .activity-title { font-size: 10px; }
.rail-card .activity-detail { font-size: 9px; }

/* LIVE WORKFLOW — zoom the panel forward (spotlight) while the agent works. */
.activity-card{cursor:zoom-in;}
.activity-card .activity-row{cursor:pointer;}

/* In-place zoom: the panel enlarges where it sits (top of the rail) and lifts
   forward. It spans the full rail width, so the probability card reflows BELOW
   it and is never covered. */
.activity-card.workflow-zoom{
  grid-column:1 / -1;
  position:relative;z-index:30;cursor:default;
  border:1px solid #1769aa;border-radius:14px;background:#fff;
  box-shadow:0 22px 60px rgba(9,25,45,.32);
  padding:20px 22px;
  animation:workflow-zoom-in .35s cubic-bezier(.2,.7,.2,1);
}
@keyframes workflow-zoom-in{from{transform:scale(.95);transform-origin:top right;opacity:.55;}to{transform:none;opacity:1;}}
/* bigger, focused text while zoomed (overrides the compact rail sizes) */
.activity-card.workflow-zoom .section-eyebrow{font-size:11px;}
.activity-card.workflow-zoom h2{font-size:18px;margin-bottom:14px;}
.activity-card.workflow-zoom .activity-row{grid-template-columns:36px 1fr;min-height:74px;gap:12px;}
.activity-card.workflow-zoom .activity-node span{width:24px;height:24px;border-width:6px;}
.activity-card.workflow-zoom .activity-row:not(:last-child)::after{left:12px;top:28px;}
.activity-card.workflow-zoom .activity-title{font-size:16px;}
.activity-card.workflow-zoom .activity-detail{font-size:13.5px;line-height:1.5;margin-top:5px;}

/* highlight the row currently running (normal + zoomed) */
.activity-row.activity-focus{background:#eef6ff;border-radius:12px;box-shadow:inset 4px 0 0 #1769aa;}
.activity-card.workflow-zoom .activity-row.activity-focus{transform:none;}
.rail-card .prob-head { font-size: 9px; }
.rail-card .prob-track { height: 6px; }
.rail-card .empty { font-size: 10px; }

.result-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid #dce4ec;
  border-radius: 10px;
  background: #edf2f7;
}

.result-tab {
  padding: 9px 7px;
  border-radius: 7px;
  background: transparent;
  color: #66768a;
  font-size: 10px;
}

.result-tab span {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  margin-left: 3px;
  place-items: center;
  border-radius: 9px;
  background: #dbe4ed;
  font-size: 8px;
}

.result-tab.active {
  background: #fff;
  color: #1769aa;
  box-shadow: 0 2px 7px rgba(18,43,70,.1);
}

.result-tab.active span {
  background: #e5f1fa;
  color: #1769aa;
}

.result-tab-content {
  margin-top: 10px;
  padding: 15px;
  border: 1px solid #dfe6ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(18,43,70,.05);
}

.result-pane { display: none; }
.result-pane.active { display: block; animation: pane-in .25s ease-out; }
.results-rail .place-grid { grid-template-columns: 1fr; }
.results-rail .place { padding: 13px; border-radius: 10px; }
.results-rail .agent-markdown h3 { margin-top: 14px; }

@keyframes pane-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1250px) {
  #view-planner.layout.active {
    grid-template-columns: 300px minmax(480px, 1fr);
    height: auto;
    overflow: visible;
  }
  .planner-column { max-height: calc(100vh - 84px); }
  .map-column { min-height: calc(100vh - 84px); }
  .results-rail {
    grid-column: 1 / -1;
    border-top: 1px solid #dce4ec;
    border-left: 0;
  }
  .results-heading { margin-bottom: 12px; }
  .result-tab-content { margin-top: 10px; }
}

@media (max-width: 760px) {
  #view-planner.layout.active {
    display: flex;
    flex-direction: column;
  }
  .planner-column { max-height: none; border-right: 0; }
  .map-column { min-height: 560px; padding: 10px; }
  .map-toolbar { align-items: flex-start; }
  .map-key { gap: 5px; }
  .key-item { font-size: 0; }
  .results-rail { display: block; padding: 14px; }
  .results-heading { margin-bottom: 12px; }
  .rail-summary-grid { grid-template-columns: 1fr; }
  .result-tabs { position: sticky; top: 4px; z-index: 4; }
  .result-tab-content { margin-top: 10px; }
}
