:root {
  --bg-main: #060d16;
  --bg-deep: #04080f;
  --bg-panel: #0b1523;
  --bg-panel-soft: #0f1e32;
  --bg-panel-raise: #13263d;
  --line: rgba(165, 208, 255, 0.2);
  --line-green: rgba(90, 180, 255, 0.32);
  --line-gold: rgba(98, 168, 235, 0.34);
  --text-main: #deedff;
  --text-dim: #a8c2de;
  --text-muted: #6f89a5;
  --green: #00c16a;
  --yellow: #d7a93e;
  --red: #d94a4a;
  --cyan: #58b9ff;
  --amber: #6aaeff;
  --glow-cyan: rgba(88, 185, 255, 0.28);
  --glow-amber: rgba(106, 174, 255, 0.2);
  --glow-red: rgba(217, 74, 74, 0.28);
  --shadow-soft: 0 16px 36px rgba(1, 6, 14, 0.5);
  --shadow-panel: 0 24px 52px rgba(1, 5, 12, 0.56);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Bahnschrift", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(1180px 560px at 10% -8%, rgba(88, 185, 255, 0.14) 0%, rgba(6, 13, 22, 0) 62%),
    radial-gradient(980px 520px at 84% 6%, rgba(76, 150, 230, 0.12) 0%, rgba(6, 13, 22, 0) 58%),
    radial-gradient(1400px 800px at 50% 50%, rgba(88, 185, 255, 0.04) 0%, rgba(6, 13, 22, 0) 70%),
    linear-gradient(148deg, var(--bg-deep) 0%, var(--bg-main) 56%, #081424 100%);
  color: var(--text-main);
}

body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  width: 2px;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

body::before {
  left: 16px;
  box-shadow: 0 0 18px 2px var(--glow-cyan);
  background: rgba(88, 185, 255, 0.34);
}

body::after {
  right: 16px;
  box-shadow: 0 0 18px 2px var(--glow-amber);
  background: rgba(106, 174, 255, 0.28);
}

body.runtime-locked #runtime-shell {
  filter: blur(2px) saturate(0.85);
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}

#runtime-shell {
  transition: filter 380ms ease, opacity 380ms ease;
}

h1, h2, h3, p {
  margin: 0;
}

ul {
  margin: 0;
  padding-left: 18px;
}

.topbar,
.timeline,
.phase-status-wrap,
.phase-log-wrap,
.scene-panel,
.controls,
.evidence,
.footer-note {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  position: relative;
  z-index: 1;
}

.entry-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 18px;
  background: radial-gradient(circle at 50% 16%, rgba(88, 185, 255, 0.2) 0%, rgba(8, 16, 28, 0.95) 48%, rgba(7, 13, 23, 0.99) 100%);
  overflow-y: auto;
}

.entry-card {
  position: relative;
  width: min(640px, 100%);
  border: 1px solid rgba(90, 180, 255, 0.38);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(11, 23, 39, 0.94) 0%, rgba(9, 19, 33, 0.97) 100%);
  padding: 24px;
  box-shadow: 0 22px 48px rgba(2, 7, 15, 0.52), inset 0 0 0 1px rgba(142, 197, 255, 0.08);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.entry-icon {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 1.25rem;
  opacity: 0.9;
}

.entry-label {
  color: var(--cyan);
  font-family: "Consolas", "Courier New", monospace;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.entry-title {
  margin-top: 8px;
  font-size: 1.35rem;
}

.entry-copy {
  margin-top: 10px;
  color: var(--text-dim);
  max-width: 52ch;
}

.entry-copy-note {
  margin-top: 6px;
  color: #b4cbe5;
  font-size: 0.9rem;
}

.entry-input-label {
  display: block;
  margin-top: 14px;
  margin-bottom: 8px;
  font-size: 0.84rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.entry-input {
  width: 100%;
  border: 1px solid rgba(102, 157, 212, 0.58);
  background: rgba(9, 18, 30, 0.82);
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 0.95rem;
  border-radius: 10px;
}

.entry-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.entry-context-guide {
  margin-top: 10px;
  color: #cce3fb;
  font-size: 0.86rem;
}

.entry-clarity-box,
.entry-deliverables-box {
  margin-top: 12px;
  border: 1px solid rgba(90, 180, 255, 0.38);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 22, 36, 0.88) 0%, rgba(8, 18, 30, 0.94) 100%);
  padding: 12px;
}

.entry-clarity-box h3,
.entry-deliverables-box h3 {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #8fd3ff;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.entry-clarity-copy {
  margin: 0;
  color: #d6ebff;
  font-size: 0.82rem;
  line-height: 1.45;
}

.entry-deliverables-box ul {
  margin: 0;
  padding-left: 18px;
  color: #d6ebff;
  font-size: 0.8rem;
  line-height: 1.45;
}

.entry-input-help {
  margin-top: 8px;
  color: #b8d7f2;
  font-size: 0.8rem;
  line-height: 1.4;
}

.entry-context-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.entry-context-chip {
  border: 1px solid rgba(108, 179, 244, 0.5);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(10, 22, 37, 0.86);
  color: #d7ecff;
  font-size: 0.76rem;
  font-family: "Consolas", "Courier New", monospace;
}

.entry-context-risk {
  margin-top: 8px;
  color: #ffd79f;
  font-size: 0.82rem;
}

.assistant-box {
  margin-top: 12px;
  border: 1px solid rgba(90, 180, 255, 0.42);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 22, 36, 0.9) 0%, rgba(8, 18, 30, 0.96) 100%);
  padding: 12px;
}

.assistant-box h3 {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #8fd3ff;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.assistant-box p {
  color: #d6ebff;
  font-size: 0.82rem;
  line-height: 1.45;
}

.entry-activate {
  margin-top: 12px;
  width: 100%;
  border: 1px solid #ff2a4a;
  background: linear-gradient(180deg, rgba(255, 42, 74, 0.18), rgba(255, 42, 74, 0.06));
  color: #ff6b7a;
  padding: 11px 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.24), 0 0 12px rgba(255,42,74,0.22);
  font-family: "Consolas", monospace;
  text-transform: uppercase;
}
.entry-activate:hover,
.entry-activate:focus {
  border-color: #ff3f5f;
  color: #ff3f5f;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.24), 0 0 18px rgba(255,63,95,0.34);
  background: rgba(20,6,8,0.6);
  outline: none;
}

/* Visual override specifically for the runtime activation button
   MODO CIRUGÍA: change only visual appearance for #activate-runtime */
#activate-runtime {
  background: rgba(255, 0, 60, 0.25) !important;
  border: 2px solid #ff2a4a !important; /* double the previous 1px */
  color: #ffffff !important;
  box-shadow: 0 0 28px rgba(255, 42, 74, 0.42), inset 0 0 6px rgba(255, 42, 74, 0.12) !important;
  /* keep size, radius, layout and hover behavior unchanged */
}
#activate-runtime:hover,
#activate-runtime:focus {
  border-color: #ff3f5f !important;
  box-shadow: 0 0 36px rgba(255, 63, 95, 0.44), inset 0 0 8px rgba(255,108,136,0.18) !important;
}

.runtime-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.context-pill {
  background: linear-gradient(180deg, rgba(16, 37, 58, 0.82) 0%, rgba(13, 28, 46, 0.92) 100%);
  color: #d8eeff;
  border: 1px solid rgba(90, 180, 255, 0.62);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.78rem;
  max-width: 42ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(120, 190, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(142, 203, 255, 0.14), 0 0 14px rgba(90, 180, 255, 0.2);
}

.context-pill-pending {
  background: linear-gradient(180deg, rgba(8, 32, 24, 0.96) 0%, rgba(6, 24, 18, 0.98) 100%);
  color: #c8ffe0;
  border-color: rgba(80, 255, 180, 0.32);
  text-shadow: 0 0 8px rgba(120, 255, 180, 0.18);
  box-shadow: inset 0 0 0 1px rgba(80, 255, 180, 0.12), 0 0 20px rgba(80, 255, 180, 0.12);
}

.context-pill-declared {
  background: linear-gradient(180deg, rgba(17, 59, 74, 0.94) 0%, rgba(12, 42, 58, 0.98) 100%);
  color: #e1fcff;
  border-color: rgba(108, 233, 211, 0.94);
  text-shadow: 0 0 8px rgba(160, 245, 235, 0.34);
  box-shadow: inset 0 0 0 1px rgba(172, 247, 240, 0.24), 0 0 20px rgba(95, 221, 204, 0.34);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-bottom: 1px solid rgba(90, 180, 255, 0.28);
  padding-bottom: 20px;
  box-shadow: inset 0 -1px 0 rgba(122, 195, 255, 0.18), 0 18px 36px rgba(2, 8, 18, 0.52);
}

#demo-title {
  font-size: 1.8rem;
  letter-spacing: 0.45px;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(136, 207, 255, 0.16);
}

#demo-subtitle {
  margin-top: 6px;
  color: #b8d4f0;
  font-size: 0.96rem;
  font-weight: 500;
}

.motor-pill {
  background: linear-gradient(180deg, rgba(12, 34, 54, 0.84) 0%, rgba(10, 26, 44, 0.95) 100%);
  color: #d8ecff;
  border: 1px solid rgba(90, 180, 255, 0.6);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.82rem;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(90, 180, 255, 0.16), 0 0 16px rgba(90, 180, 255, 0.2);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-family: "Consolas", "Courier New", monospace;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: linear-gradient(180deg, rgba(10, 20, 34, 0.9) 0%, rgba(8, 16, 28, 0.96) 100%);
  border: 1px solid rgba(96, 158, 220, 0.38);
  border-radius: 999px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.34);
}

.progress-fill {
  height: 100%;
  width: 14%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f9fe3 0%, #8ad8ff 100%);
  transition: width 240ms ease;
}

.observation-phase {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-family: "Consolas", "Courier New", monospace;
  letter-spacing: 0.3px;
}

.runtime-flow {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.runtime-flow-chip {
  border: 1px solid rgba(90, 180, 255, 0.42);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: #b8d6f2;
  background: rgba(8, 19, 31, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  opacity: 0.72;
  transition: box-shadow 220ms ease, border-color 220ms ease, opacity 220ms ease, transform 220ms ease;
}

.runtime-flow-chip.is-on {
  color: #def3ff;
  border-color: rgba(121, 204, 255, 0.9);
  box-shadow: 0 0 12px rgba(90, 180, 255, 0.22);
  opacity: 1;
}

.runtime-flow-chip.is-active {
  border-color: rgba(150, 222, 255, 1);
  box-shadow: 0 0 20px rgba(90, 180, 255, 0.38), inset 0 0 0 1px rgba(187, 232, 255, 0.22);
  transform: translateY(-1px);
  opacity: 1;
}

.runtime-process-note {
  margin-top: 8px;
  color: #b9dbfb;
  font-size: 0.78rem;
  font-family: "Consolas", "Courier New", monospace;
  letter-spacing: 0.3px;
  text-shadow: 0 0 8px rgba(108, 188, 255, 0.2);
}

#activate-analysis.is-processing,
#activate-runtime.is-processing {
  border-color: rgba(145, 215, 255, 0.96);
  color: #e7f7ff;
  box-shadow: inset 0 1px 0 rgba(215, 236, 255, 0.2), 0 0 22px rgba(90, 180, 255, 0.34);
}

.anatomy-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 28px 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  position: relative;
  z-index: 1;
}

.band {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(11, 22, 37, 0.94) 0%, rgba(9, 18, 31, 0.98) 100%);
  padding: 24px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(157, 205, 255, 0.1), 0 22px 48px rgba(2, 7, 16, 0.58);
}

.band-top {
  border-color: rgba(90, 180, 255, 0.28);
  background: linear-gradient(180deg, rgba(13, 28, 46, 0.95) 0%, rgba(9, 20, 36, 0.98) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(90, 180, 255, 0.08),
    0 20px 44px rgba(2, 7, 15, 0.54);
}

.band-mid {
  border-color: rgba(90, 180, 255, 0.34);
  background: linear-gradient(180deg, rgba(13, 30, 48, 0.96) 0%, rgba(10, 22, 38, 0.99) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(90, 180, 255, 0.1),
    0 22px 48px rgba(2, 7, 16, 0.58);
}

.band-core {
  border-color: rgba(106, 174, 255, 0.44);
  background: linear-gradient(180deg, rgba(15, 32, 50, 0.99) 0%, rgba(9, 20, 34, 1) 100%);
  padding: 28px;
  box-shadow:
    inset 0 0 0 1px rgba(106, 174, 255, 0.16),
    inset 0 0 32px rgba(90, 180, 255, 0.12),
    0 28px 64px rgba(1, 4, 10, 0.66),
    0 0 24px rgba(90, 180, 255, 0.2);
}

.band-bottom {
  border-color: rgba(99, 157, 214, 0.34);
  background: linear-gradient(180deg, rgba(12, 25, 40, 0.92) 0%, rgba(8, 18, 31, 0.96) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(114, 174, 232, 0.07),
    0 18px 38px rgba(2, 7, 14, 0.5);
}

.band h2 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  margin-top: 0;
  color: #d5e9ff;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(120, 190, 255, 0.12);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, rgba(15, 32, 52, 0.92) 0%, rgba(12, 25, 42, 0.97) 100%);
  border: 1px solid rgba(97, 165, 229, 0.3);
  border-left: 3px solid rgba(90, 180, 255, 0.62);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 128px;
  animation: entryRise 500ms ease both;
  box-shadow: inset 0 0 0 1px rgba(148, 199, 255, 0.1), 0 16px 34px rgba(2, 8, 18, 0.5);
}

.band-top .card {
  background: linear-gradient(180deg, rgba(14, 29, 47, 0.9) 0%, rgba(11, 23, 38, 0.96) 100%);
  border-color: rgba(97, 165, 229, 0.24);
  border-left-color: rgba(90, 180, 255, 0.48);
}

.card h3 {
  font-size: 1.02rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #eef7ff;
  letter-spacing: 0.2px;
}

.domain-name {
  display: inline-block;
  transform: translateY(1px);
}

.card p {
  font-size: 0.84rem;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.4;
}

.card-metric {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.card-metric strong {
  color: #d7ebff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 0.72rem;
}

.metric-value {
  color: #9fc2e5;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-metric-tension .metric-value {
  color: #eaf6ff;
  font-weight: 700;
}

.card-docstring {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(90, 180, 255, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(9, 20, 33, 0.96) 0%, rgba(7, 17, 28, 0.98) 100%);
  box-shadow: inset 0 0 0 1px rgba(122, 195, 255, 0.06), 0 8px 16px rgba(2, 7, 15, 0.32);
}

.card-docstring .docstring-row {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.75rem;
  line-height: 1.35;
}

.card-docstring .docstring-row:not(:last-child) {
  border-bottom: 1px solid rgba(90, 180, 255, 0.12);
}

.card-docstring .docstring-label {
  color: #7fd3ff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.card-docstring .docstring-text {
  color: #a8c2de;
  font-weight: 500;
}

.domain-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-size: 0.98rem;
  opacity: 0.92;
  background: radial-gradient(circle at 50% 45%, rgba(140, 204, 255, 0.16) 0%, rgba(19, 40, 64, 0.08) 72%);
  box-shadow: inset 0 0 0 1px rgba(138, 200, 255, 0.14), 0 0 14px rgba(76, 155, 228, 0.12);
}

.concept-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  min-width: 1rem;
  font-size: 0.82rem;
  opacity: 0.82;
}

.concept-icon-tension {
  width: 0.62rem;
  min-width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(231, 241, 255, 0.95) 0%, rgba(115, 154, 190, 0.82) 100%);
  box-shadow: 0 0 10px rgba(163, 212, 255, 0.22);
  transform: translateY(1px);
}

.tension-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  white-space: nowrap;
  background: rgba(5, 10, 18, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 12px rgba(0, 0, 0, 0.18);
}

.tension-chip::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tension-baja {
  color: #5FD35C;
}

.tension-baja::before {
  background-color: #5FD35C;
  box-shadow: 0 0 8px rgba(95, 211, 92, 0.48);
}

.tension-media {
  color: #D4A84F;
}

.tension-media::before {
  background-color: #D4A84F;
  box-shadow: 0 0 8px rgba(212, 168, 79, 0.48);
}

.tension-alta {
  color: #D84747;
}

.tension-alta::before {
  background-color: #D84747;
  box-shadow: 0 0 8px rgba(216, 71, 71, 0.48);
}

.convergence-lane {
  position: relative;
  margin-top: 18px;
  height: 38px;
  border-top: 1px dashed rgba(90, 180, 255, 0.28);
  overflow: hidden;
}

.flow {
  position: absolute;
  top: 2px;
  width: 2px;
  height: 30px;
  background: linear-gradient(180deg, rgba(90, 180, 255, 0.06) 0%, rgba(90, 180, 255, 0.64) 100%);
  transform-origin: top center;
  animation: convergePulse 2400ms ease-in-out infinite;
}

.flow-1 { left: 12.5%; animation-delay: 0ms; }
.flow-2 { left: 37.5%; animation-delay: 280ms; }
.flow-3 { left: 62.5%; animation-delay: 560ms; }
.flow-4 { left: 87.5%; animation-delay: 840ms; }

.mid-content,
.core-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.adapter-box,
.validator-box,
.gate-box,
.discipline-box {
  background: linear-gradient(180deg, rgba(14, 30, 48, 0.94) 0%, rgba(10, 21, 36, 0.98) 100%);
  border: 1px solid rgba(100, 162, 220, 0.4);
  border-radius: 12px;
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(145, 198, 255, 0.1), 0 14px 32px rgba(2, 8, 17, 0.5);
}

.band-core .gate-box,
.band-core .discipline-box {
  background: linear-gradient(180deg, rgba(15, 31, 48, 0.94) 0%, rgba(10, 21, 35, 0.98) 100%);
  border-color: rgba(106, 174, 255, 0.46);
  border-left: 3px solid rgba(90, 180, 255, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(106, 174, 255, 0.16),
    inset 0 0 14px rgba(90, 180, 255, 0.08),
    0 18px 40px rgba(2, 7, 15, 0.58);
}

.adapter-box h3,
.validator-box h3,
.gate-box h3,
.discipline-box h3 {
  margin-bottom: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.adapter-stream {
  display: grid;
  gap: 10px;
  font-family: "Consolas", "Courier New", monospace;
}

.stream-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(90, 180, 255, 0.28);
  border-radius: 10px;
  background: rgba(8, 20, 33, 0.6);
}

.stream-row .src {
  color: var(--text-dim);
}

.stream-row .arrow {
  color: var(--cyan);
  opacity: 0.8;
}

.stream-row .dst {
  color: #9fd7ff;
  text-align: right;
}

.adapter-live .stream-row {
  border-color: rgba(90, 180, 255, 0.54);
}

.adapter-live .arrow {
  animation: arrowBeat 1200ms ease-in-out infinite;
}

.gate-status {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.gate-meter {
  width: 100%;
  height: 8px;
  border: 1px solid rgba(104, 162, 220, 0.52);
  background: #101f32;
  border-radius: 999px;
  margin-bottom: 8px;
}

.gate-meter-fill {
  height: 100%;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3f95de 0%, #80d0ff 100%);
  transition: width 280ms ease, filter 280ms ease;
}

.gate-box.gate-evaluating .gate-meter-fill {
  filter: saturate(1.3);
  animation: meterSweep 1400ms ease-in-out infinite;
}

.gate-box.gate-regulated .gate-meter-fill {
  width: 68%;
}

.gate-box.gate-contained .gate-meter-fill {
  width: 88%;
}

.state-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-family: "Consolas", "Courier New", monospace;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.state-green {
  color: var(--green);
}

.state-yellow {
  color: var(--yellow);
}

.state-red {
  color: var(--red);
}

.chip.state-green { background: linear-gradient(180deg, rgba(25, 122, 48, 0.72), rgba(8, 58, 28, 0.92)); border: 1px solid rgba(94, 255, 130, 0.68); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 12px rgba(34, 197, 94, 0.14); }
.chip.state-yellow { background: linear-gradient(180deg, rgba(126, 101, 20, 0.72), rgba(53, 42, 8, 0.95)); border: 1px solid rgba(255, 213, 91, 0.72); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 0 12px rgba(216, 168, 78, 0.14); }
.chip.state-red { background: linear-gradient(180deg, rgba(168, 47, 34, 0.76), rgba(82, 18, 12, 0.94)); border: 1px solid rgba(239, 68, 68, 0.72); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 14px rgba(217, 74, 74, 0.16); }

.chip-active {
  animation: breathe 1800ms ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 18px rgba(90, 180, 255, 0.22);
}

.module-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.memory-timeline {
  position: relative;
  height: 16px;
  margin-bottom: 10px;
  border: 1px solid rgba(100, 162, 220, 0.46);
  border-radius: 8px;
  background: rgba(8, 20, 33, 0.8);
}

.memory-timeline .ticks {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.memory-timeline .ticks span {
  border-right: 1px dashed rgba(164, 198, 231, 0.35);
}

.memory-timeline .ticks span:last-child {
  border-right: 0;
}

.memory-cursor {
  position: absolute;
  top: 1px;
  left: 10%;
  width: 2px;
  height: 12px;
  background: #8fd3ff;
  box-shadow: 0 0 10px rgba(90, 180, 255, 0.58);
  transition: left 320ms ease;
}

.module-row {
  border: 1px solid rgba(101, 164, 222, 0.46);
  background: linear-gradient(180deg, rgba(13, 29, 47, 0.92) 0%, rgba(9, 20, 34, 0.98) 100%);
  border-radius: 10px;
  padding: 8px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.78rem;
  transition: transform 220ms ease, border-color 220ms ease;
}

.band-bottom .module-row {
  background: linear-gradient(180deg, rgba(12, 27, 44, 0.86) 0%, rgba(9, 20, 33, 0.94) 100%);
  border-color: rgba(102, 165, 222, 0.4);
}

.module-row.module-live {
  border-color: rgba(111, 181, 247, 0.86);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(90, 180, 255, 0.24), 0 0 14px rgba(90, 180, 255, 0.2);
}

.canonical {
  color: rgba(166, 215, 255, 0.94);
  font-weight: 600;
}

.scene-panel {
  border-top: 1px solid rgba(92, 151, 209, 0.36);
  border-bottom: 1px solid rgba(92, 151, 209, 0.36);
  background: linear-gradient(180deg, rgba(11, 21, 35, 0.72) 0%, rgba(9, 18, 30, 0.84) 100%);
}

#scene-title {
  font-size: 1.05rem;
}

#scene-narrative {
  margin-top: 8px;
  color: var(--text-dim);
}

.revealed {
  margin-top: 10px;
  color: var(--cyan);
  font-size: 0.88rem;
}

#scene-points {
  margin-top: 8px;
  color: var(--text-main);
  font-size: 0.86rem;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.phase-log {
  border: 1px solid rgba(90, 180, 255, 0.34);
  background: linear-gradient(180deg, rgba(7, 18, 30, 0.96) 0%, rgba(8, 24, 42, 0.98) 100%);
  padding: 18px 20px;
  font-family: "Consolas", "Courier New", monospace;
  box-shadow: 0 0 16px rgba(90, 180, 255, 0.14), inset 0 0 18px rgba(90, 180, 255, 0.05);
}

.phase-log-title {
  margin: 0;
  color: #8fd3ff;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(120, 190, 255, 0.18);
}

.phase-log-line {
  margin-top: 6px;
  color: #d8ecff;
  font-size: 0.8rem;
  text-shadow: 0 0 6px rgba(120, 190, 255, 0.18);
}

button {
  border: 1px solid rgba(90, 180, 255, 0.5);
  background: linear-gradient(180deg, rgba(12, 33, 53, 0.86) 0%, rgba(8, 22, 38, 0.95) 100%);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;  font-size: 0.9rem;  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(197, 224, 255, 0.14), 0 12px 24px rgba(2, 7, 16, 0.46);
}

button:hover {
  border-color: rgba(125, 199, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(208, 231, 255, 0.16), 0 0 16px rgba(90, 180, 255, 0.2);
}

#toggle-evidence[aria-expanded="true"] {
  border-color: rgba(145, 215, 255, 0.96);
  color: #e7f7ff;
  box-shadow: inset 0 1px 0 rgba(215, 236, 255, 0.2), 0 0 22px rgba(90, 180, 255, 0.34);
}

button:disabled {
  cursor: not-allowed;
  color: #8aa5c0;
  border-color: rgba(115, 146, 176, 0.4);
  background: linear-gradient(180deg, rgba(13, 28, 44, 0.74) 0%, rgba(10, 22, 36, 0.88) 100%);
  box-shadow: inset 0 0 0 1px rgba(155, 189, 221, 0.06);
}

button:disabled:hover {
  border-color: rgba(115, 146, 176, 0.4);
  box-shadow: inset 0 0 0 1px rgba(155, 189, 221, 0.06);
}

#next-scene {
  background: linear-gradient(180deg, rgba(168, 47, 34, 0.94) 0%, rgba(102, 23, 18, 1) 100%);
  border-color: rgba(239, 68, 68, 0.78);
  color: #ffe9e9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 14px rgba(217, 74, 74, 0.32), 0 12px 26px rgba(58, 10, 10, 0.45);
}

#next-scene:hover {
  border-color: rgba(255, 110, 110, 0.9);
}

.evidence {
  border: 1px solid rgba(90, 180, 255, 0.44);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(11, 24, 39, 0.9) 0%, rgba(8, 19, 33, 0.95) 100%);
  padding: 18px 20px;
  margin: 12px auto 0;
  max-width: 1200px;
  box-shadow: inset 0 0 0 1px rgba(150, 203, 255, 0.12), 0 0 18px rgba(90, 180, 255, 0.2), 0 18px 36px rgba(2, 8, 16, 0.5);
}

.evidence h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
  font-weight: 700;
  color: #b5e2ff;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.evidence ul {
  margin: 0;
  padding-left: 18px;
  color: #e0f2ff;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}

.evidence li + li {
  margin-top: 4px;
}

.operation-output {
  max-width: 1200px;
  margin: 14px auto 0;
  padding: 16px 20px;
  border: 1px solid rgba(90, 180, 255, 0.44);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 22, 36, 0.9) 0%, rgba(7, 17, 29, 0.96) 100%);
  box-shadow: inset 0 0 0 1px rgba(152, 205, 255, 0.09), 0 14px 32px rgba(2, 8, 16, 0.5);
}

.operation-output h3 {
  margin-bottom: 10px;
  color: #b8e0ff;
  font-size: 0.98rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.operation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.operation-grid p {
  margin: 0;
  font-size: 0.84rem;
  color: #d4e8fb;
  line-height: 1.45;
}

.hidden {
  display: none;
}

.footer-note {
  text-align: center;
  color: #9fb5cd;
  font-size: 0.87rem;
  padding-bottom: 32px;
  margin-top: 16px;
}

@keyframes convergePulse {
  0% { transform: translateY(-4px) scaleY(0.8); opacity: 0.2; }
  45% { transform: translateY(0) scaleY(1); opacity: 0.9; }
  100% { transform: translateY(4px) scaleY(0.8); opacity: 0.2; }
}

@keyframes arrowBeat {
  0%, 100% { transform: translateX(0); opacity: 0.55; }
  50% { transform: translateX(2px); opacity: 1; }
}

@keyframes meterSweep {
  0%, 100% { filter: brightness(0.95); }
  50% { filter: brightness(1.2); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.05); opacity: 1; }
}

@keyframes entryRise {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .flow,
  .adapter-live .arrow,
  .chip-active,
  .card,
  .gate-box.gate-evaluating .gate-meter-fill {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  .cards,
  .module-table,
  .mid-content,
  .core-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
  }

  .runtime-pills {
    justify-content: flex-start;
  }

  .cards,
  .module-table,
  .mid-content,
  .core-content,
  .operation-grid {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════════════════════════════════ */
/* WCOR BRAND — SELLO INSTITUCIONAL DEL RUNTIME */
/* ════════════════════════════════════════════════════════════ */
.wcor-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.wcor-logo {
  width: 64px;
  height: auto;
  object-fit: contain;
  opacity: 0.96;
  transition: transform 0.18s ease, opacity 0.18s ease;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.28));
}

.wcor-logo:hover {
  transform: scale(1.03);
  opacity: 1;
}

@media (max-width: 768px) {
  .wcor-logo {
    width: 46px;
  }
}
