:root {
  --paper: #f7f1e6;
  --paper-2: #fff9ef;
  --ink: #111421;
  --ink-soft: #394156;
  --ink-faint: #6a7287;
  --panel: rgba(255, 249, 239, 0.86);
  --panel-strong: rgba(255, 249, 239, 0.94);
  --stroke: rgba(20, 24, 38, 0.1);
  --shadow-1:
    0 1px 0 rgba(17, 20, 33, 0.06),
    0 10px 30px rgba(17, 20, 33, 0.08);
  --shadow-2:
    0 1px 0 rgba(17, 20, 33, 0.08),
    0 20px 50px rgba(17, 20, 33, 0.12);

  --teal: #0ea5a4;
  --teal-dark: #0b7f7f;
  --blue: #1463ff;
  --blue-deep: #07379f;
  --coral: #ef5b44;
  --coral-deep: #c8402c;
  --lime: #2ea86f;
  --gold: #f1b400;
  --gold-deep: #ce8f00;
  --violet: #7458ff;
  --rose: #ff6178;
  --slate: #5c6477;
  --urgent: #d43232;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max-width: 1920px;
  --top-row-height: 760px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(
      circle at 12% 14%,
      rgba(20, 99, 255, 0.08),
      transparent 42%
    ),
    radial-gradient(
    circle at 84% 22%,
    rgba(239, 91, 68, 0.08),
    transparent 48%
  ),
    radial-gradient(
    circle at 72% 86%,
    rgba(14, 165, 164, 0.08),
    transparent 40%
  ),
    linear-gradient(180deg, #faf4ea, #f7f1e6 35%, #f3ecdd 100%);
}

.page-shell {
  position: relative;
  width: min(var(--max-width), calc(100vw - 24px));
  margin: 10px auto 24px;
  display: grid;
  gap: 14px;
}

.background-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.45;
  animation: orbFloat 18s ease-in-out infinite;
}

.orb-a {
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(20, 99, 255, 0.35),
    rgba(20, 99, 255, 0)
  );
  top: -30px;
  right: 14%;
}

.orb-b {
  width: 260px;
  height: 260px;
  background: radial-gradient(
    circle at 40% 40%,
    rgba(239, 91, 68, 0.28),
    rgba(239, 91, 68, 0)
  );
  bottom: 4%;
  left: 4%;
  animation-duration: 22s;
  animation-delay: -4s;
}

.orb-c {
  width: 220px;
  height: 220px;
  background: radial-gradient(
    circle at 40% 40%,
    rgba(14, 165, 164, 0.28),
    rgba(14, 165, 164, 0)
  );
  top: 40%;
  left: 62%;
  animation-duration: 20s;
  animation-delay: -7s;
}

.panel {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: clip;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 255, 255, 0.7), transparent 28%),
    radial-gradient(
    circle at 92% 8%,
    rgba(255, 255, 255, 0.45),
    transparent 25%
  );
  opacity: 0.7;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 14px;
  padding: 18px;
}

.hero-copy,
.hero-side {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
}

.hero h1 {
  margin: 8px 0 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 2.7vw, 3rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.hero-lede {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 72ch;
}

.hero-lede p {
  margin: 0;
}

.hero-lede p + p {
  margin-top: 10px;
}

.hero-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.84rem;
}

.hero-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.live-status-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(17, 20, 33, 0.08);
  background:
    linear-gradient(135deg, rgba(20, 99, 255, 0.07), rgba(14, 165, 164, 0.04)),
    rgba(255, 255, 255, 0.66);
}

.live-status-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 10px;
}

.live-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--slate);
  box-shadow: 0 0 0 0 rgba(92, 100, 119, 0.35);
}

.live-dot.running {
  background: var(--teal);
  animation: ping 1.4s infinite;
}

.live-dot.paused {
  background: var(--gold);
}

.live-dot.error {
  background: var(--urgent);
}

.live-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-label,
.small-label {
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.mini-value {
  margin-top: 2px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.controls-panel {
  border: 1px solid rgba(17, 20, 33, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.controls-panel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-weight: 700;
}

.controls-panel > summary::-webkit-details-marker {
  display: none;
}

.summary-hint {
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-weight: 600;
}

.controls-inner {
  padding: 0 14px 14px;
  display: grid;
  gap: 12px;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.control-btn {
  border: 1px solid rgba(17, 20, 33, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.control-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(17, 20, 33, 0.08);
}

.control-btn.primary {
  background: linear-gradient(
    180deg,
    rgba(20, 99, 255, 0.12),
    rgba(20, 99, 255, 0.06)
  );
  border-color: rgba(20, 99, 255, 0.22);
  color: var(--blue-deep);
}

.control-btn.active,
.speed-presets button.active {
  background: linear-gradient(
    180deg,
    rgba(14, 165, 164, 0.16),
    rgba(14, 165, 164, 0.08)
  );
  border-color: rgba(14, 165, 164, 0.25);
  color: var(--teal-dark);
}

.speed-control {
  display: grid;
  gap: 8px;
}

.speed-control label {
  font-weight: 600;
  font-size: 0.9rem;
}

#speed-range {
  width: 100%;
  accent-color: var(--blue);
}

.speed-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.speed-presets button {
  border: 1px solid rgba(17, 20, 33, 0.1);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
}

.control-meta {
  display: grid;
  gap: 7px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 12px 14px;
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 4px;
}

.metric-label {
  color: var(--ink-faint);
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.metric-value {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-value small {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.metric-foot {
  margin-top: auto;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.28;
}

.micro-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-height: 26px;
  margin-top: 2px;
  align-content: flex-start;
  max-width: 100%;
  overflow: hidden;
}

.micro-icon {
  width: 3px;
  height: 3px;
  flex: 0 0 3px;
  box-sizing: border-box;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(20, 99, 255, 0.75),
    rgba(14, 165, 164, 0.75)
  );
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.micro-icons.handoff .micro-icon,
.node-mini-icons.handoff .micro-icon,
.micro-icon.handoff {
  background: linear-gradient(
    180deg,
    rgba(239, 91, 68, 0.82),
    rgba(241, 180, 0, 0.8)
  );
}

.accent-teal {
  border-color: rgba(14, 165, 164, 0.17);
}
.accent-blue {
  border-color: rgba(20, 99, 255, 0.18);
}
.accent-coral {
  border-color: rgba(239, 91, 68, 0.18);
}
.accent-lime {
  border-color: rgba(46, 168, 111, 0.2);
}
.accent-gold {
  border-color: rgba(241, 180, 0, 0.2);
}
.accent-violet {
  border-color: rgba(116, 88, 255, 0.18);
}
.accent-rose {
  border-color: rgba(255, 97, 120, 0.18);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 12px;
  align-items: stretch;
}

.flow-panel,
.processing-panel,
.outcome-panel,
.viz-card,
.page-footer {
  padding: 14px;
}

.dashboard-grid > .panel:not(.outcome-panel) {
  min-width: 0;
  height: var(--top-row-height);
}

.panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.panel-head > * {
  min-width: 0;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.panel-head.compact h2 {
  font-size: 1.15rem;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--ink-soft);
  line-height: 1.32;
  font-size: 0.85rem;
}

.viz-lede {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.35;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(17, 20, 33, 0.06);
  background: rgba(17, 20, 33, 0.02);
}

.panel-badge {
  align-self: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(17, 20, 33, 0.1);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
  max-width: min(44ch, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.flow-map {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(20, 99, 255, 0.07),
      transparent 38%
    ),
    radial-gradient(
    circle at 80% 70%,
    rgba(239, 91, 68, 0.06),
    transparent 42%
  ),
    linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.85),
    rgba(253, 248, 239, 0.9)
  );
  overflow: hidden;
}

.flow-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(17, 20, 33, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 20, 33, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at 50% 50%, black 62%, transparent 100%);
  opacity: 0.55;
}

.flow-paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.flow-paths path {
  fill: none;
  stroke: url(#pathGlowA);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-dasharray: 4 10;
  opacity: 0.85;
  animation: dash 18s linear infinite;
}

.flow-paths path.agent-out {
  stroke: url(#pathGlowB);
  stroke-width: 2.6;
  stroke-dasharray: 5 11;
}

.flow-paths path.agent-out.alt {
  stroke-width: 2.1;
  opacity: 0.7;
}

.flow-region.channel-region {
  position: absolute;
  inset: 16px auto 16px 14px;
  width: 210px;
  z-index: 2;
}

.channel-node {
  position: absolute;
  left: 0;
  width: 180px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 16px rgba(17, 20, 33, 0.04);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease;
}

.channel-node .icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: white;
  background: linear-gradient(180deg, #20283e, #131929);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.channel-node .label {
  font-weight: 700;
  font-size: 0.84rem;
}

.channel-node .count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.channel-node:hover {
  transform: translateX(2px);
  box-shadow: 0 10px 22px rgba(17, 20, 33, 0.08);
}

.channel-node.is-active {
  border-color: rgba(20, 99, 255, 0.28);
  background: rgba(20, 99, 255, 0.07);
  transform: translateX(3px) scale(1.01);
}

.channel-node[data-channel="email"] {
  top: 22px;
}
.channel-node[data-channel="web_chat"] {
  top: 78px;
}
.channel-node[data-channel="web_form"] {
  top: 136px;
}
.channel-node[data-channel="sms"] {
  top: 194px;
}
.channel-node[data-channel="whatsapp"] {
  top: 252px;
}
.channel-node[data-channel="phone_voicemail"] {
  top: 310px;
}
.channel-node[data-channel="facebook_messenger"] {
  top: 368px;
}
.channel-node[data-channel="instagram_dm"] {
  top: 426px;
}

.channel-node[data-channel="email"] .icon {
  background: linear-gradient(180deg, #3279ff, #114dcc);
}
.channel-node[data-channel="web_chat"] .icon {
  background: linear-gradient(180deg, #00a9b0, #0c7c7f);
}
.channel-node[data-channel="web_form"] .icon {
  background: linear-gradient(180deg, #7e69ff, #5b40cf);
}
.channel-node[data-channel="sms"] .icon {
  background: linear-gradient(180deg, #f08b35, #d56815);
}
.channel-node[data-channel="whatsapp"] .icon {
  background: linear-gradient(180deg, #31b66f, #1b9155);
}
.channel-node[data-channel="phone_voicemail"] .icon {
  background: linear-gradient(180deg, #ef5b44, #c8402c);
}
.channel-node[data-channel="facebook_messenger"] .icon {
  background: linear-gradient(180deg, #0c72ff, #0952bb);
}
.channel-node[data-channel="instagram_dm"] .icon {
  background: linear-gradient(180deg, #ff6ca8, #dd3f90);
}

.agent-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 178px;
  height: 178px;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: grid;
  place-items: center;
}

.agent-core-ring,
.agent-core-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.agent-core-ring {
  background:
    radial-gradient(
      circle at 35% 30%,
      rgba(255, 255, 255, 0.7),
      rgba(255, 255, 255, 0) 45%
    ),
    conic-gradient(
    from 180deg,
    rgba(20, 99, 255, 0.18),
    rgba(14, 165, 164, 0.25),
    rgba(239, 91, 68, 0.22),
    rgba(20, 99, 255, 0.18)
  );
  padding: 10px;
  box-shadow:
    inset 0 0 0 1px rgba(17, 20, 33, 0.08),
    0 18px 30px rgba(17, 20, 33, 0.12);
}

.agent-core-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: rgba(250, 245, 236, 0.95);
  box-shadow: inset 0 0 0 1px rgba(17, 20, 33, 0.06);
}

.agent-core-inner {
  position: relative;
  z-index: 2;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 14px;
  text-align: center;
  background:
    radial-gradient(
      circle at 40% 30%,
      rgba(20, 99, 255, 0.1),
      rgba(20, 99, 255, 0) 65%
    ),
    rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(17, 20, 33, 0.08);
}

.agent-core-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.agent-core-sub {
  margin-top: 5px;
  font-size: 0.64rem;
  color: var(--ink-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.agent-core-stats {
  margin-top: 9px;
  display: grid;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.agent-core-stats strong {
  color: var(--ink);
  font-family: var(--font-mono);
}

.agent-core-pulse {
  border: 1px solid rgba(20, 99, 255, 0.16);
  animation: corePulse 2.4s ease-out infinite;
}

.agent-core-pulse.pulse-b {
  animation-delay: 1.2s;
  border-color: rgba(239, 91, 68, 0.14);
}

.outcome-node {
  position: absolute;
  right: 18px;
  width: 185px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 9px;
  align-items: center;
  border-radius: 14px;
  border: 1px solid rgba(17, 20, 33, 0.1);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(17, 20, 33, 0.06);
  z-index: 2;
}

.outcome-node.auto {
  top: 108px;
}
.outcome-node.handoff {
  top: 320px;
}

.outcome-node-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background: linear-gradient(180deg, var(--teal), var(--teal-dark));
}

.outcome-node.handoff .outcome-node-icon {
  background: linear-gradient(180deg, var(--coral), var(--coral-deep));
}

.outcome-node-label {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.outcome-node-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.node-mini-icons {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  min-height: 28px;
  max-height: 28px;
  max-width: 100%;
  overflow: hidden;
}

.node-mini-icons .micro-icon {
  width: 3px;
  height: 3px;
  flex: 0 0 3px;
  border-radius: 999px;
}

.packet-layer,
.spark-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.flow-packet {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.15) 40%,
    color-mix(in srgb, var(--packet-color) 80%, black) 100%
  );
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.3) inset,
    0 0 14px color-mix(in srgb, var(--packet-color) 55%, white),
    0 3px 12px rgba(17, 20, 33, 0.12);
  transform: translate(var(--sx), var(--sy)) scale(0.6);
  animation: packetFlight var(--dur) cubic-bezier(0.18, 0.82, 0.2, 1) forwards;
}

.flow-packet::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--packet-color) 55%, white);
  opacity: 0.55;
  animation: ringEcho var(--dur) ease-out forwards;
}

.flow-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  transform: translate(var(--x), var(--y));
  border: 1px solid color-mix(in srgb, var(--spark-color) 60%, white);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  opacity: 0;
  animation: sparkPop 620ms ease-out forwards;
}

.flow-caption {
  margin-top: 10px;
  color: var(--ink-soft);
  line-height: 1.35;
  font-size: 0.86rem;
}

.processing-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.processing-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.1fr;
  gap: 12px;
  min-height: 0;
}

.card {
  position: relative;
  z-index: 1;
  border-radius: 16px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
  display: grid;
  gap: 10px;
  min-height: 0;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(17, 20, 33, 0.05);
  border: 1px solid rgba(17, 20, 33, 0.08);
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.message-meta-top {
  display: grid;
  text-align: right;
  gap: 2px;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.focus-persona {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(17, 20, 33, 0.03);
  border: 1px dashed rgba(17, 20, 33, 0.08);
}

.focus-persona > div > div:last-child {
  margin-top: 2px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}

.message-focus {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  min-height: 0;
}

.message-text-wrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
}

.message-text {
  margin: 0;
  min-height: 0;
  max-height: none;
  height: 100%;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(17, 20, 33, 0.07);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.88),
    rgba(247, 244, 237, 0.88)
  );
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.38;
}

.chip-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 8px;
  border: 1px solid rgba(17, 20, 33, 0.09);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.chip strong {
  color: var(--ink);
  font-weight: 700;
}

.chip.intent {
  border-color: rgba(20, 99, 255, 0.2);
}
.chip.queue {
  border-color: rgba(14, 165, 164, 0.2);
}
.chip.priority {
  border-color: rgba(239, 91, 68, 0.22);
}
.chip.ok {
  border-color: rgba(46, 168, 111, 0.2);
}
.chip.warn {
  border-color: rgba(241, 180, 0, 0.22);
}
.chip.danger {
  border-color: rgba(212, 50, 50, 0.24);
}

.raw-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.raw-meta-grid > div {
  padding: 8px;
  border-radius: 12px;
  background: rgba(17, 20, 33, 0.03);
  border: 1px solid rgba(17, 20, 33, 0.05);
}

.raw-meta-grid > div > div:last-child {
  margin-top: 2px;
  font-size: 0.84rem;
  font-weight: 700;
}

.agent-workbench {
  align-content: start;
  grid-template-rows: auto auto minmax(0, 1.1fr) minmax(0, 0.9fr) auto;
  min-height: 0;
}

.workbench-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.thinking-pill {
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.thinking-pill.active {
  color: var(--teal-dark);
  border-color: rgba(14, 165, 164, 0.25);
  background: rgba(14, 165, 164, 0.08);
}

.thinking-stage {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(17, 20, 33, 0.07);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.86),
    rgba(248, 245, 238, 0.86)
  );
}

.thinking-visual {
  position: relative;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
}

.thinking-ring,
.thinking-core {
  position: absolute;
  border-radius: 999px;
}

.thinking-ring {
  inset: 0;
  border: 2px dashed rgba(20, 99, 255, 0.28);
  animation: spin 5s linear infinite;
}

.thinking-ring.inner {
  inset: 12px;
  border-color: rgba(14, 165, 164, 0.28);
  animation-direction: reverse;
  animation-duration: 4s;
}

.thinking-core {
  inset: 26px;
  background: radial-gradient(
    circle at 32% 32%,
    rgba(255, 255, 255, 0.95),
    rgba(20, 99, 255, 0.2)
  );
  box-shadow: 0 0 0 1px rgba(17, 20, 33, 0.06), 0 0 20px rgba(20, 99, 255, 0.1);
  animation: breathe 1.4s ease-in-out infinite;
}

.thinking-copy {
  display: grid;
  gap: 8px;
}

.thinking-lines {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.thinking-lines span {
  position: relative;
  padding-left: 16px;
}

.thinking-lines span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38rem;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 20, 33, 0.12);
  box-shadow: inset 0 0 0 1px rgba(17, 20, 33, 0.04);
}

.thinking-stage.thinking .thinking-lines span.active::before {
  background: var(--teal);
  box-shadow: 0 0 12px rgba(14, 165, 164, 0.38);
}

.thinking-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(17, 20, 33, 0.06);
  background: rgba(17, 20, 33, 0.04);
  overflow: hidden;
}

.thinking-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(20, 99, 255, 0.75),
    rgba(14, 165, 164, 0.85)
  );
  transition: width 120ms linear;
}

.thinking-estimate {
  color: var(--ink-faint);
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.metadata-panel {
  display: grid;
  gap: 10px;
  opacity: 0.45;
  transition: opacity 220ms ease;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.metadata-panel.ready {
  opacity: 1;
}

.metadata-group {
  display: grid;
  gap: 6px;
  padding: 9px;
  border-radius: 12px;
  border: 1px solid rgba(17, 20, 33, 0.06);
  background: rgba(255, 255, 255, 0.65);
}

.metadata-group.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stacked-list {
  display: grid;
  gap: 5px;
}

.list-row {
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--ink-soft);
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(17, 20, 33, 0.03);
  border: 1px solid rgba(17, 20, 33, 0.04);
}

.list-row strong {
  color: var(--ink);
}

.response-stream-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background:
    linear-gradient(135deg, rgba(20, 99, 255, 0.04), rgba(14, 165, 164, 0.03)),
    rgba(255, 255, 255, 0.7);
}

.response-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.response-subtitle,
.response-status {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.response-status {
  border-radius: 999px;
  padding: 5px 8px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

.response-stream {
  margin: 0;
  min-height: 0;
  max-height: none;
  height: 100%;
  overflow: auto;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(17, 20, 33, 0.06);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(249, 246, 239, 0.95)
  );
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.42;
  font-family: var(--font-body);
  font-size: 0.89rem;
}

.stream-caret {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 10px;
  height: 18px;
  background: linear-gradient(
    180deg,
    rgba(20, 99, 255, 0.8),
    rgba(14, 165, 164, 0.8)
  );
  border-radius: 2px;
  opacity: 0;
}

.stream-caret.visible {
  opacity: 1;
  animation: blink 1s steps(1) infinite;
}

.escalation-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(239, 91, 68, 0.2);
  background: linear-gradient(
    180deg,
    rgba(239, 91, 68, 0.06),
    rgba(255, 255, 255, 0.72)
  );
}

.escalation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.escalation-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 0.76rem;
  background: rgba(239, 91, 68, 0.1);
  border: 1px solid rgba(239, 91, 68, 0.2);
  color: var(--coral-deep);
}

#escalation-priority {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.outcome-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-column: 1 / -1;
  height: 360px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 252, 245, 0.95),
      rgba(249, 243, 233, 0.92)
    ),
    linear-gradient(135deg, rgba(20, 99, 255, 0.03), rgba(14, 165, 164, 0.03));
}

.feed-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: min-content;
  gap: 8px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
  align-content: start;
}

.feed-item {
  border-radius: 12px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.75);
  padding: 8px;
  display: grid;
  gap: 5px;
  animation: cardSlide 280ms ease-out;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
  min-width: 0;
}

.feed-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(17, 20, 33, 0.07);
}

.feed-item:focus-visible {
  outline: 2px solid rgba(20, 99, 255, 0.45);
  outline-offset: 2px;
}

.feed-item.escalated {
  border-color: rgba(239, 91, 68, 0.22);
  background: linear-gradient(
    180deg,
    rgba(239, 91, 68, 0.05),
    rgba(255, 255, 255, 0.78)
  );
}

.feed-item.auto {
  border-color: rgba(14, 165, 164, 0.2);
  background: linear-gradient(
    180deg,
    rgba(14, 165, 164, 0.04),
    rgba(255, 255, 255, 0.78)
  );
}

.feed-item-head {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.73rem;
}

.feed-channel,
.feed-outcome,
.feed-time {
  border-radius: 999px;
  padding: 3px 7px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.75);
  font-weight: 700;
  color: var(--ink-soft);
}

.feed-message-line {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.3;
}

.feed-meta-row {
  color: var(--ink-faint);
  font-size: 0.73rem;
  line-height: 1.25;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.viz-card {
  min-height: 320px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.viz-card.special {
  grid-column: span 2;
}

.viz-svg {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(17, 20, 33, 0.06);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.85),
    rgba(248, 245, 238, 0.82)
  );
}

.viz-note {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.viz-inline-stat {
  margin-left: auto;
  color: var(--ink-faint);
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.viz-note.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 4px;
}

.legend-dot.teal {
  background: var(--teal);
}
.legend-dot.coral {
  background: var(--coral);
}
.legend-dot.blue {
  background: var(--blue);
}
.legend-dot.slate {
  background: var(--slate);
}

.donut-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
}

.donut-svg {
  width: min(220px, 100%);
  aspect-ratio: 1;
}

.donut-center {
  position: absolute;
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
}

.donut-label {
  font-size: 0.73rem;
  color: var(--ink-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.donut-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.bar-viz {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 8px;
  align-items: center;
}

.bar-row .bar-label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.2;
}

.bar-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(17, 20, 33, 0.06);
  background: rgba(17, 20, 33, 0.04);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(20, 99, 255, 0.85),
    rgba(14, 165, 164, 0.85)
  );
  transition: width 240ms ease;
}

.bar-fill.handoff {
  background: linear-gradient(
    90deg,
    rgba(239, 91, 68, 0.9),
    rgba(241, 180, 0, 0.9)
  );
}

.bar-fill.channel {
  background: linear-gradient(
    90deg,
    rgba(116, 88, 255, 0.85),
    rgba(20, 99, 255, 0.85)
  );
}

.bar-value {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.bar-viz.compact .bar-row {
  grid-template-columns: 150px 1fr auto;
}

.impact-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 12px;
  align-items: start;
}

.impact-funnel {
  display: grid;
  gap: 9px;
  align-content: start;
}

.funnel-row {
  display: grid;
  gap: 5px;
}

.funnel-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
}

.funnel-head .label {
  font-weight: 700;
  color: var(--ink-soft);
}

.funnel-head .value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink);
}

.funnel-track {
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(17, 20, 33, 0.06);
  background: rgba(17, 20, 33, 0.04);
  overflow: hidden;
  position: relative;
}

.funnel-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 260ms ease;
  background: linear-gradient(
    90deg,
    rgba(20, 99, 255, 0.82),
    rgba(14, 165, 164, 0.82)
  );
}

.funnel-fill.warn {
  background: linear-gradient(
    90deg,
    rgba(241, 180, 0, 0.88),
    rgba(239, 91, 68, 0.82)
  );
}

.funnel-fill.success {
  background: linear-gradient(
    90deg,
    rgba(46, 168, 111, 0.88),
    rgba(14, 165, 164, 0.82)
  );
}

.impact-meters {
  display: grid;
  gap: 10px;
}

.impact-meter {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(17, 20, 33, 0.06);
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 6px;
}

.gauge {
  position: relative;
  width: 144px;
  height: 144px;
  margin: 2px auto;
  border-radius: 50%;
  background: conic-gradient(rgba(17, 20, 33, 0.08) 0 100%);
  display: grid;
  place-items: center;
}

.gauge::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 20, 33, 0.06);
}

.gauge-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    var(--teal) 0deg,
    var(--blue) 0deg,
    rgba(17, 20, 33, 0.08) 0deg 360deg
  );
  transition: background 220ms ease;
}

.gauge-center {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 0.9;
  font-weight: 800;
}

.impact-big-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.impact-subtext {
  font-size: 0.78rem;
  color: var(--ink-faint);
  line-height: 1.25;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.detail-modal {
  border: none;
  padding: 0;
  width: min(980px, calc(100vw - 28px));
  max-height: min(86vh, 940px);
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
}

.detail-modal::backdrop {
  background: rgba(10, 14, 22, 0.48);
  backdrop-filter: blur(8px);
}

.detail-modal-shell {
  margin: 0;
  width: 100%;
  max-height: inherit;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 20px;
  border: 1px solid rgba(17, 20, 33, 0.12);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 241, 0.98),
    rgba(250, 244, 234, 0.97)
  );
  box-shadow: 0 22px 70px rgba(17, 20, 33, 0.24);
  overflow: hidden;
}

.detail-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.detail-modal-head h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.detail-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(17, 20, 33, 0.12);
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.detail-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 14px 14px;
  display: grid;
  gap: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.detail-card {
  border-radius: 14px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.detail-card.full {
  grid-column: 1 / -1;
}

.detail-card pre {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid rgba(17, 20, 33, 0.06);
  background: rgba(247, 244, 237, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
  font-family: var(--font-body);
  font-size: 0.84rem;
}

.detail-kv {
  display: grid;
  gap: 6px;
}

.detail-kv-row {
  display: grid;
  grid-template-columns: 135px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.82rem;
  line-height: 1.3;
}

.detail-kv-row .k {
  color: var(--ink-faint);
  font-weight: 700;
}

.detail-kv-row .v {
  color: var(--ink);
  min-width: 0;
}

.detail-json {
  max-height: 340px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(17, 20, 33, 0.07);
  background: rgba(248, 245, 238, 0.88);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

#footer-status {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  white-space: nowrap;
}

.page-shell.is-paused .flow-packet,
.page-shell.is-paused .flow-packet::after,
.page-shell.is-paused .flow-spark,
.page-shell.is-paused .thinking-ring,
.page-shell.is-paused .thinking-core,
.page-shell.is-paused .live-dot.running,
.page-shell.is-paused .agent-core-pulse,
.page-shell.is-paused .flow-paths path,
.page-shell.is-paused .stream-caret.visible {
  animation-play-state: paused !important;
}

.reveal-stagger {
  animation: fadeUp 500ms ease both;
}

/* SVG chart classes injected by JS */
.viz-svg .axis {
  stroke: rgba(17, 20, 33, 0.12);
  stroke-width: 1;
}

.viz-svg .grid {
  stroke: rgba(17, 20, 33, 0.06);
  stroke-width: 1;
}

.viz-svg .line-main {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

#throughput-chart .line-main {
  stroke: var(--teal) !important;
}

.viz-svg .line-alt {
  fill: none;
  stroke: var(--slate);
  stroke-width: 2;
  stroke-dasharray: 4 5;
  stroke-linecap: round;
}

.viz-svg .line-backlog {
  fill: none;
  stroke: var(--coral);
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.viz-svg .area-main {
  fill: rgba(14, 165, 164, 0.14);
}

.viz-svg .area-backlog {
  fill: rgba(239, 91, 68, 0.12);
}

.viz-svg .point {
  fill: white;
  stroke: var(--blue);
  stroke-width: 1.8;
}

.viz-svg text {
  font-family: var(--font-body);
  fill: var(--ink-faint);
  font-size: 10px;
}

/* Animations */
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 165, 164, 0.35);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(14, 165, 164, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 164, 0);
  }
}

@keyframes dash {
  to {
    stroke-dashoffset: -120;
  }
}

@keyframes corePulse {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  25% {
    opacity: 0.35;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes packetFlight {
  0% {
    transform: translate(var(--sx), var(--sy)) scale(0.6);
    opacity: 0;
  }
  7% {
    opacity: 1;
  }
  58% {
    transform: translate(var(--mx), var(--my)) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--ex), var(--ey)) scale(0.7);
    opacity: 0.12;
  }
}

@keyframes ringEcho {
  0% {
    transform: scale(0.7);
    opacity: 0.65;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

@keyframes sparkPop {
  0% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.5);
  }
  18% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(1.7);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes breathe {
  0%, 100% {
    transform: scale(0.92);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

@keyframes cardSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes orbFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(12px, -10px, 0);
  }
}

/* Scrollbars */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(17, 20, 33, 0.15);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: rgba(17, 20, 33, 0.03);
  border-radius: 999px;
}

/* Responsive */
@media (max-width: 1320px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid > .panel {
    height: auto;
  }

  .processing-layout {
    grid-template-columns: 1fr;
  }

  .outcome-panel,
  .processing-panel {
    min-height: unset;
  }

  .outcome-panel {
    grid-column: auto;
    height: auto;
  }

  .feed-list {
    max-height: 380px;
    grid-template-columns: 1fr;
  }

  .viz-grid {
    grid-template-columns: 1fr 1fr;
  }

  .viz-card.special {
    grid-column: span 2;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    grid-template-columns: 1fr 1fr;
  }

  .flow-map {
    min-height: 560px;
  }

  .channel-node {
    width: 170px;
  }

  .impact-layout {
    grid-template-columns: 1fr;
  }

  .viz-grid {
    grid-template-columns: 1fr;
  }

  .viz-card.special {
    grid-column: span 1;
  }

  .page-footer {
    flex-direction: column;
    align-items: start;
  }

  .micro-icon {
    width: 3px;
    height: 3px;
    flex-basis: 3px;
  }

  .node-mini-icons .micro-icon {
    width: 3px;
    height: 3px;
    flex-basis: 3px;
  }

  .detail-kv-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(var(--max-width), calc(100vw - 12px));
    gap: 10px;
    margin: 6px auto 14px;
  }

  .hero,
  .flow-panel,
  .processing-panel,
  .outcome-panel,
  .viz-card,
  .page-footer {
    padding: 10px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .channel-node {
    width: 158px;
    grid-template-columns: 30px 1fr auto;
    padding: 6px 8px;
  }

  .channel-node .icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 0.74rem;
  }

  .outcome-node {
    width: 156px;
    grid-template-columns: 30px 1fr;
    padding: 8px;
  }

  .outcome-node-icon {
    width: 30px;
    height: 30px;
  }

  .agent-core {
    width: 154px;
    height: 154px;
  }

  .agent-core-inner {
    width: 122px;
    height: 122px;
  }

  .focus-persona,
  .metadata-group.two-col,
  .raw-meta-grid {
    grid-template-columns: 1fr;
  }

  .bar-row,
  .bar-viz.compact .bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
  }

  .viz-svg {
    min-height: 210px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
