* { box-sizing: border-box; }

:root {
  --sim-glass-bg:       rgba(255, 255, 255, 0.04);
  --sim-glass-bg-mid:   rgba(255, 255, 255, 0.065);
  --sim-glass-bg-strong: rgba(255, 255, 255, 0.09);
  --sim-glass-border:   rgba(255, 255, 255, 0.10);
  --sim-glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.10), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --sim-glass-blur:     blur(22px) saturate(160%);
  --sim-shadow:         0 4px 20px rgba(0, 0, 0, 0.5);
}

body {
  margin: 0; padding: 0;
  background: #07080f;
  background-image:
    radial-gradient(ellipse 65% 50% at 10% 5%,  rgba(88,  166, 255, 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 55% 40% at 90% 95%, rgba(163, 113, 247, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 45% 35% at 55% 40%, rgba(46,  160,  67, 0.05) 0%, transparent 55%);
  background-attachment: fixed;
  color: #e6edf3;
  font-family: 'Segoe UI', system-ui, sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Simulator header strip ────────────────────────────── */
.sim-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(7, 8, 15, 0.60);
  backdrop-filter: var(--sim-glass-blur);
  -webkit-backdrop-filter: var(--sim-glass-blur);
  border-bottom: 1px solid var(--sim-glass-border);
  box-shadow: var(--sim-glass-specular), 0 2px 16px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.sim-back {
  color: #58a6ff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.sim-back:hover { opacity: 0.75; }

.sim-header-divider {
  width: 1px; height: 14px;
  background: var(--sim-glass-border);
  flex-shrink: 0;
}

.sim-title {
  font-size: 12px;
  color: #e6edf3;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.sim-header-sub {
  font-size: 11px;
  color: #8b949e;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-version {
  font-size: 10px;
  font-weight: 700;
  color: #58a6ff;
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Page content wrapper ──────────────────────────────── */
.sim-content {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 0;
  min-height: 0;
}

/* ── Main horizontal row — fills remaining space ───────── */
.main-row {
  display: flex;
  gap: 6px;
  flex: 1 1 0;
  min-height: 0;
  align-items: stretch;
}

/* ── Left side: controls row + action toolbar ──────────── */
.left-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 385px;
  min-width: 0;
}

/* ── Controls are a vertical flex column ───────────────── */
.controls-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.ctrl-group {
  background: var(--sim-glass-bg);
  backdrop-filter: var(--sim-glass-blur);
  -webkit-backdrop-filter: var(--sim-glass-blur);
  border: 1px solid var(--sim-glass-border);
  box-shadow: var(--sim-glass-specular), var(--sim-shadow);
  border-radius: 10px;
  padding: 6px 10px 7px;
  position: relative;
}

/* Panels fill the column width */
.ctrl-producer { flex: 0 0 auto; }
.ctrl-plan     { flex: 0 0 auto; }
.ctrl-sb       { flex: 0 0 auto; }
.ctrl-function { flex: 0 0 auto; }

.ctrl-group h3 {
  font-size: 10px; color: #8b949e;
  text-transform: uppercase; letter-spacing: 0.7px;
  font-weight: 700;
  margin: 0 0 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--sim-glass-border);
  display: flex; align-items: center; gap: 6px;
}

.ctrl-group h3::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ctrl-accent, #58a6ff);
  box-shadow: 0 0 6px var(--ctrl-accent, #58a6ff);
}

.ctrl-group.ctrl-producer  { --ctrl-accent: #f2cc60; }
.ctrl-group.ctrl-plan      { --ctrl-accent: #2ea043; }
.ctrl-group.ctrl-sb        { --ctrl-accent: #db61a2; }
.ctrl-group.ctrl-function  { --ctrl-accent: #58a6ff; }
.ctrl-group.ctrl-scenarios { --ctrl-accent: #a371f7; }

.ctrl-group-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 4px 12px;
}

/* Azure Function: 2-column grid so 6 sliders sit in 3 rows */
.ctrl-function .ctrl-group-body {
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 16px;
}

.ctrl-group.ctrl-scenarios .ctrl-group-body {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}

.ctrl {
  font-size: 10px; color: #8b949e; text-transform: uppercase;
  letter-spacing: 0.5px; display: flex; flex-direction: column; gap: 1px;
}
.ctrl .row { display: flex; justify-content: space-between; align-items: center; }
.ctrl-name { display: inline-flex; align-items: center; }
.ctrl .val {
  color: var(--ctrl-accent, #58a6ff); font-weight: 700; font-size: 12px;
  font-family: ui-monospace, monospace;
}
.ctrl input[type=range] {
  width: 100%; accent-color: var(--ctrl-accent, #58a6ff);
  height: 14px; margin: 0;
}

/* ── Help tooltip ──────────────────────────────────────── */
.help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--sim-glass-bg-mid); color: #8b949e;
  border: 1px solid var(--sim-glass-border);
  font-size: 9px; font-weight: 700;
  cursor: help; margin-left: 5px;
  position: relative;
  text-transform: none; letter-spacing: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.help-icon:hover { background: var(--ctrl-accent, #58a6ff); color: white; border-color: var(--ctrl-accent, #58a6ff); }
.help-icon .tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 12, 20, 0.82);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--ctrl-accent, #58a6ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 40px rgba(0, 0, 0, 0.75);
  border-radius: 10px;
  padding: 9px 12px 10px;
  font-size: 11px;
  color: #c9d1d9;
  width: 430px;
  text-transform: none; letter-spacing: 0; font-weight: 400;
  z-index: 999;
  pointer-events: auto;
  line-height: 1.45;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  text-align: left;
  display: block;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.help-icon .tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--ctrl-accent, #58a6ff);
}
.help-icon.tooltip-left .tooltip  { left: auto; right: -8px; transform: none; }
.help-icon.tooltip-left .tooltip::before { left: auto; right: 8px; transform: none; }
.help-icon.tooltip-right .tooltip { left: -8px; right: auto; transform: none; }
.help-icon.tooltip-right .tooltip::before { left: 8px; right: auto; transform: none; }
.help-icon:hover .tooltip { opacity: 1; visibility: visible; }

.help-icon .tt-text,
.help-icon .tt-block { display: block; }
.help-icon .tt-text { margin-bottom: 7px; color: #e6edf3; }
.help-icon .tt-block {
  margin-top: 5px; padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.help-icon .tt-block strong {
  color: var(--ctrl-accent, #58a6ff); font-weight: 700;
  display: inline-block; margin-right: 5px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px;
}
.help-icon .tooltip code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 10px; background: rgba(255, 255, 255, 0.10);
  padding: 1px 4px; border-radius: 3px; color: #e6edf3;
}
.help-icon .tooltip em { color: #adbac7; font-style: italic; }
.help-icon .tt-docs-link {
  display: inline-block;
  margin-top: 2px;
  color: var(--ctrl-accent, #58a6ff);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
}
.help-icon .tt-docs-link:hover { text-decoration: underline; }

/* ── Scenario buttons ──────────────────────────────────── */
.ctrl-scenarios .preset-btn {
  background: rgba(31, 111, 235, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #7cb8ff;
  border: 1px solid rgba(88, 166, 255, 0.30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  padding: 6px 10px;
  border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 11px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.ctrl-scenarios .preset-btn:hover {
  background: rgba(56, 139, 253, 0.35);
  border-color: rgba(88, 166, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 12px rgba(88, 166, 255, 0.20);
}

/* ── Action toolbar ────────────────────────────────────── */
.action-toolbar {
  display: flex; gap: 8px; align-items: center;
  flex-shrink: 0;
}
.action-toolbar .action-btn {
  background: rgba(35, 134, 54, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #3fb950;
  border: 1px solid rgba(46, 160, 67, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  padding: 6px 14px;
  border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 12px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.action-toolbar .action-btn:hover {
  background: rgba(46, 160, 67, 0.40);
  border-color: rgba(46, 160, 67, 0.60);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 12px rgba(46, 160, 67, 0.20);
}
.action-toolbar .action-btn.secondary {
  background: var(--sim-glass-bg-mid);
  color: #8b949e;
  border-color: var(--sim-glass-border);
}
.action-toolbar .action-btn.secondary:hover {
  background: var(--sim-glass-bg-strong, rgba(255,255,255,0.09));
  border-color: rgba(255, 255, 255, 0.20);
  color: #e6edf3;
}

/* ── Stage ─────────────────────────────────────────────── */
#stage {
  position: relative;
  flex: 1 1 0;
  min-width: 200px;
  min-height: 0;
  background: var(--sim-glass-bg);
  backdrop-filter: var(--sim-glass-blur);
  -webkit-backdrop-filter: var(--sim-glass-blur);
  border: 1px solid var(--sim-glass-border);
  box-shadow: var(--sim-glass-specular), var(--sim-shadow);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 10px;
}
#stage > .col.producer-col { flex: 0 0 110px; }
#stage > .col.sb-col       { flex: 0 0 300px; }
#stage > .col.done-col     { flex: 0 0 300px; }
#stage > .arrow            { flex: 0 0 22px; }
#stage > .instances-stack  { flex: 1 1 auto; }

/* ── Columns ───────────────────────────────────────────── */
.col {
  border-radius: 8px; padding: 8px;
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
}
.col-title {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.8px; font-weight: 700; text-align: center;
  margin-bottom: 4px;
}
.col-sub {
  text-align: center; font-size: 11px; color: #6e7681;
  font-family: ui-monospace, monospace; margin-bottom: 6px;
}
.zone-area {
  flex: 1; position: relative;
  border: 1px dashed rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.20);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
}
.col-footer {
  margin-top: 4px; text-align: center; font-size: 9px;
  color: #6e7681; text-transform: uppercase; letter-spacing: 0.3px;
}

.producer-col { background: rgba(247,213,107,0.06); border: 1px solid rgba(247,213,107,0.35); }
.producer-col .col-title { color: #f2cc60; }
.producer-area {
  border-color: rgba(247,213,107,0.2);
  display: flex; align-items: center; justify-content: center;
}
.producer-icon {
  font-size: 38px;
  animation: emit 1.4s infinite ease-in-out;
  pointer-events: none; z-index: 1;
}
@keyframes emit {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(247,213,107,0.5)); }
  50%       { transform: scale(1.2); filter: drop-shadow(0 0 14px rgba(247,213,107,0.9)); }
}

.sb-col { background: rgba(88,166,255,0.05); border: 1px solid rgba(88,166,255,0.3); }
.sb-col .col-title { color: #58a6ff; }
.sb-area { border-color: rgba(88,166,255,0.2); }

.done-col { background: rgba(46,160,67,0.05); border: 1px solid rgba(46,160,67,0.3); }
.done-col .col-title { color: #2ea043; }
.done-area { border-color: rgba(46,160,67,0.2); }

.arrow {
  display: flex; align-items: center; justify-content: center;
  color: #58a6ff; font-size: 22px; opacity: 0.7;
  user-select: none; font-weight: 700;
}

/* ── Instances stack ───────────────────────────────────── */
.instances-stack {
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto; overflow-x: hidden;
  min-width: 0; align-self: stretch; height: 100%;
  padding-right: 2px;
  scrollbar-width: thin; scrollbar-color: #30363d transparent;
}
.instances-stack::-webkit-scrollbar { width: 8px; }
.instances-stack::-webkit-scrollbar-track { background: transparent; }
.instances-stack::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
.instances-stack::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ── Function card ─────────────────────────────────────── */
.instance {
  flex: 1 0 auto; min-height: 100px;
  background: var(--sim-glass-bg-mid);
  backdrop-filter: var(--sim-glass-blur);
  -webkit-backdrop-filter: var(--sim-glass-blur);
  border: 1.5px solid rgba(88, 166, 255, 0.35);
  border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--sim-glass-specular), 0 0 24px rgba(88, 166, 255, 0.08) inset, var(--sim-shadow);
  overflow: hidden; position: relative;
}
.inst-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--sim-glass-border); padding-bottom: 6px;
}
.inst-name {
  font-size: 13px; color: #e6edf3; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.func-icon { font-size: 18px; color: #f2cc60; filter: drop-shadow(0 0 6px rgba(242,204,96,0.7)); }
.inst-sub  { color: #8b949e; font-family: ui-monospace, monospace; font-size: 10px; }

.inst-body {
  flex: 1 1 auto; display: flex; align-items: stretch; gap: 10px;
  min-height: 0; overflow: hidden;
}
.inst-body > .host-section  { flex: 0 0 320px; }
.inst-body > .inst-arrow    { flex: 0 0 28px; }
.inst-body > .workers-section { flex: 1 1 auto; min-width: 0; }

.host-section {
  background: rgba(88, 166, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(88, 166, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(88, 166, 255, 0.15);
  border-radius: 10px; padding: 8px 10px;
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}
.section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
  margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center;
  gap: 6px; flex-wrap: wrap;
}
.host-section .section-title { color: #58a6ff; }
.host-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; min-height: 0;
}
.sub-col { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.sub-col-label {
  font-size: 9px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.3px;
  text-align: center; margin-bottom: 3px; font-family: ui-monospace, monospace;
}
.sub-col-label b { color: #e6edf3; font-weight: 700; }
.slots-grid {
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; padding: 5px;
  border-radius: 6px; background: rgba(0, 0, 0, 0.22);
  border: 1px dashed rgba(255, 255, 255, 0.07);
  flex: 1; overflow: hidden; justify-content: center;
}

.inst-arrow { display: flex; align-items: center; justify-content: center; color: #58a6ff; font-size: 24px; opacity: 0.7; }

.workers-section {
  background: rgba(247, 129, 102, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px dashed rgba(247, 129, 102, 0.28);
  box-shadow: inset 0 1px 0 rgba(247, 129, 102, 0.10);
  border-radius: 10px; padding: 8px 10px;
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}
.workers-section .section-title { color: #f78166; }
.workers-list {
  flex: 1; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px; overflow-y: auto; align-content: start; min-height: 0;
}

.worker {
  background: rgba(247, 129, 102, 0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(247, 129, 102, 0.30);
  box-shadow: inset 0 1px 0 rgba(247, 129, 102, 0.12);
  border-radius: 8px; padding: 7px 8px;
  display: flex; flex-direction: column; overflow: hidden;
}
.worker .worker-head {
  font-size: 10px; color: #f78166; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 5px; gap: 6px; flex-wrap: wrap;
}
.thread-cols { display: grid; grid-template-columns: 1fr; gap: 6px; flex: 1; min-height: 0; }

.meta-counter { font-size: 10px; color: #8b949e; font-family: ui-monospace, monospace; font-weight: 600; white-space: nowrap; }
.meta-counter b      { color: #e6edf3; font-weight: 700; padding: 0 1px; }
.meta-counter .use-blue  { color: #58a6ff; }
.meta-counter .use-cpu   { color: #f78166; }
.meta-counter .use-green { color: #2ea043; }

.empty-hint { font-size: 9px; color: #6e7681; font-style: italic; text-align: center; width: 100%; align-self: center; padding: 4px 0; }

/* ── Slots ─────────────────────────────────────────────── */
.slot {
  border: 1px dashed #30363d; border-radius: 3px;
  background: rgba(255,255,255,0.02); flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}
.slot.prefetch { width: 16px; height: 16px; }
.slot.active   { width: 26px; height: 26px; }
.slot.thread   { width: 26px; height: 26px; }

.slot.prefetch[data-occupied="true"] { background: rgba(88,166,255,0.22); border-style: solid; border-color: rgba(88,166,255,0.6); }
.slot.active[data-occupied="true"]   { background: rgba(88,166,255,0.25); border-style: solid; border-color: #58a6ff; box-shadow: 0 0 8px rgba(88,166,255,0.55); }
.slot.thread[data-occupied="false"] { background: rgba(46,160,67,0.13); border-style: solid; border-color: rgba(46,160,67,0.45); }
.slot.thread[data-occupied="true"]  { background: rgba(247,129,102,0.25); border-style: solid; border-color: #f78166; box-shadow: 0 0 10px rgba(247,129,102,0.6); }

/* ── Messages ──────────────────────────────────────────── */
.msg {
  position: absolute; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.55);
  transition: left 0.5s cubic-bezier(0.4,0,0.2,1), top 0.5s cubic-bezier(0.4,0,0.2,1),
              width 0.25s ease, height 0.25s ease, opacity 0.35s ease, transform 0.35s ease,
              background 0.2s ease;
  z-index: 10; user-select: none; pointer-events: none; will-change: left, top;
}
.msg.no-anim { transition: none !important; }
.msg.queued         { background: linear-gradient(135deg, #58a6ff, #1f6feb); width: 22px; height: 22px; font-size: 9px; }
.msg.prefetch       { background: linear-gradient(135deg, #58a6ff, #1f6feb); width: 14px; height: 14px; font-size: 8px; }
.msg.active         { background: linear-gradient(135deg, #58a6ff, #1f6feb); width: 24px; height: 24px; font-size: 10px; }
.msg.processing-cpu { background: linear-gradient(135deg, #f78166, #db6d28); width: 24px; height: 24px; font-size: 10px; animation: pulseCpu 0.7s infinite alternate; }
.msg.done { background: linear-gradient(135deg, #2ea043, #238636); width: 22px; height: 22px; font-size: 9px; }
.msg.fade { opacity: 0; transform: scale(0.4) translateX(20px); }

@keyframes pulseCpu {
  from { box-shadow: 0 2px 6px rgba(247,129,102,0.4); }
  to   { box-shadow: 0 4px 14px rgba(247,129,102,0.95); }
}

/* ── Stats bar — horizontal strip below main-row ───────── */
.stats {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0;
  flex-shrink: 0;
  padding: 4px 8px;
  background: var(--sim-glass-bg);
  backdrop-filter: var(--sim-glass-blur);
  -webkit-backdrop-filter: var(--sim-glass-blur);
  border-radius: 10px;
  border: 1px solid var(--sim-glass-border);
  box-shadow: var(--sim-glass-specular), var(--sim-shadow);
}
.stat {
  display: flex; flex-direction: column; align-items: center;
  padding: 3px 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.stat:last-child { border-right: none; }
.stat-label { color: #8b949e; font-size: 9px; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-val   { color: #e6edf3; font-size: 13px; font-weight: 700; font-family: ui-monospace, monospace; }
.stat.completed .stat-val { color: #2ea043; }
.stat.processing .stat-val { color: #f78166; }
.stat.queued     .stat-val { color: #58a6ff; }
.stat.tput       .stat-val { color: #a371f7; }
.stat.dlq        .stat-val { color: #f85149; }
.stat.rejected   .stat-val { color: #ffa657; }

/* ── DLQ ───────────────────────────────────────────────── */
.done-col .zone-area + .col-title { margin-top: 6px; }
.dlq-title  { color: #f85149 !important; display: flex; align-items: center; justify-content: center; gap: 5px; }

.dlq-log-toggle {
  background: rgba(248, 81, 73, 0.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(248, 81, 73, 0.30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #f85149;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.6;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dlq-log-toggle:hover {
  background: rgba(248, 81, 73, 0.20);
  border-color: rgba(248, 81, 73, 0.55);
}

.dlq-log-panel {
  display: none;
  flex-direction: column;
  background: var(--sim-glass-bg);
  backdrop-filter: var(--sim-glass-blur);
  -webkit-backdrop-filter: var(--sim-glass-blur);
  border: 1px solid rgba(248, 81, 73, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--sim-shadow);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  max-height: 112px;
}
.dlq-log-panel.open { display: flex; }

.dlq-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  border-bottom: 1px solid rgba(248, 81, 73, 0.15);
  font-size: 9px;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.dlq-log-header span:last-child { color: #f85149; font-family: ui-monospace, monospace; font-weight: 700; }

.dlq-log-list {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #30363d transparent;
}
.dlq-log-list::-webkit-scrollbar { width: 6px; }
.dlq-log-list::-webkit-scrollbar-track { background: transparent; }
.dlq-log-list::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

.dlq-log-entry {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 10px;
  font-size: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.dlq-log-entry:last-child { border-bottom: none; }
.dlq-log-id    { color: #f85149; font-family: ui-monospace, monospace; font-weight: 700; flex-shrink: 0; min-width: 30px; }
.dlq-log-arrow { color: #484f58; flex-shrink: 0; }
.dlq-log-reason { color: #8b949e; }
.dlq-log-entry.ttl .dlq-log-reason { color: #f2cc60; }
.dlq-log-entry.mdc .dlq-log-reason { color: #f85149; }
.dlq-area   { border-color: rgba(248,81,73,0.25) !important; background: rgba(248,81,73,0.05) !important; }
.msg.dlq      { background: linear-gradient(135deg, #f85149, #b62324); width: 22px; height: 22px; font-size: 9px; }
.msg.rejected { background: linear-gradient(135deg, #ffa657, #d1791a); width: 20px; height: 20px; font-size: 13px; font-weight: 900; }

.sb-area.at-capacity {
  border-color: rgba(248,81,73,0.8) !important;
  background: rgba(248,81,73,0.08) !important;
  animation: capacityPulse 0.6s ease-in-out infinite alternate;
}
@keyframes capacityPulse {
  from { box-shadow: none; }
  to   { box-shadow: 0 0 12px rgba(248,81,73,0.45) inset; }
}
.done-col.has-dlq { background: rgba(46,160,67,0.05); }

/* ── Scenarios in left-side: horizontal wrapping buttons ── */
.ctrl-scenarios .ctrl-group-body {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ctrl-scenarios .preset-btn {
  padding: 5px 9px;
  font-size: 10px;
}

/* ── Scenario tooltips ──────────────────────────────────── */
.scenario-wrap {
  position: relative;
}
.scenario-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 280px;
  background: rgba(10, 12, 20, 0.82);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid #a371f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 40px rgba(0, 0, 0, 0.75);
  border-radius: 10px;
  padding: 9px 12px 10px;
  font-size: 11px;
  color: #c9d1d9;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  z-index: 999;
  pointer-events: none;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  text-align: left;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.scenario-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 14px;
  border: 6px solid transparent;
  border-top-color: #a371f7;
}
.scenario-wrap:hover .scenario-tooltip {
  opacity: 1;
  visibility: visible;
}
.scenario-tooltip .tt-text,
.scenario-tooltip .tt-block { display: block; }
.scenario-tooltip .tt-text { margin-bottom: 7px; color: #e6edf3; }
.scenario-tooltip .tt-block {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.scenario-tooltip .tt-block strong {
  color: #a371f7;
  font-weight: 700;
  display: inline-block;
  margin-right: 5px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
