﻿: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,
.summary-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);
}

.summary-card {
  background:
    linear-gradient(135deg, rgba(116, 88, 255, 0.06), rgba(255, 255, 255, 0.78)),
    rgba(255, 255, 255, 0.72);
}

.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-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;
}

.summary-note {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.35;
}

.summary-steps {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.summary-step {
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink-faint);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.summary-step.active {
  color: var(--blue-deep);
  border-color: rgba(20, 99, 255, 0.24);
  background: rgba(20, 99, 255, 0.08);
  transform: translateY(-1px);
}

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

.metric-card {
  padding: 14px;
  display: grid;
  gap: 8px;
  min-height: 132px;
}

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

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.55rem, 2.2vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 0.94;
}

.metric-value small {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--ink-faint);
}

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

.accent-blue {
  border-color: rgba(20, 99, 255, 0.18);
}

.accent-teal {
  border-color: rgba(14, 165, 164, 0.18);
}

.accent-lime {
  border-color: rgba(46, 168, 111, 0.18);
}

.accent-gold {
  border-color: rgba(241, 180, 0, 0.2);
}

.accent-coral {
  border-color: rgba(239, 91, 68, 0.2);
}

.accent-violet {
  border-color: rgba(116, 88, 255, 0.18);
}

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

.flow-panel,
.processing-panel,
.outcome-panel,
.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;
}

.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(#pathGlowIn);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-dasharray: 4 10;
  opacity: 0.85;
  animation: dash 18s linear infinite;
}

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

.flow-paths path.engine-out.warn {
  stroke: url(#pathGlowWarn);
  stroke-width: 2.35;
  stroke-dasharray: 5 11;
}

.flow-paths path.engine-out.fail {
  stroke: url(#pathGlowFail);
  stroke-width: 2.1;
  stroke-dasharray: 5 11;
  opacity: 0.74;
}

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

.source-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: default;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

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

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

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

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

.source-node.pulse-hit {
  box-shadow: 0 0 0 4px rgba(20, 99, 255, 0.08), 0 14px 24px rgba(17, 20, 33, 0.08);
}

.outcome-node.pulse-hit {
  box-shadow: 0 0 0 4px rgba(20, 99, 255, 0.08), 0 16px 28px rgba(17, 20, 33, 0.09);
}

.source-node[data-source="pdf_filing"] {
  top: 22px;
}

.source-node[data-source="spreadsheet"] {
  top: 78px;
}

.source-node[data-source="contract"] {
  top: 136px;
}

.source-node[data-source="receipt"] {
  top: 194px;
}

.source-node[data-source="certificate"] {
  top: 252px;
}

.source-node[data-source="inspection_log"] {
  top: 310px;
}

.source-node[data-source="scan_image"] {
  top: 368px;
}

.source-node[data-source="policy_plan"] {
  top: 426px;
}

.source-node[data-source="pdf_filing"] .icon {
  background: linear-gradient(180deg, #3279ff, #114dcc);
}

.source-node[data-source="spreadsheet"] .icon {
  background: linear-gradient(180deg, #00a9b0, #0c7c7f);
}

.source-node[data-source="contract"] .icon {
  background: linear-gradient(180deg, #7e69ff, #5b40cf);
}

.source-node[data-source="receipt"] .icon {
  background: linear-gradient(180deg, #f08b35, #d56815);
}

.source-node[data-source="certificate"] .icon {
  background: linear-gradient(180deg, #31b66f, #1b9155);
}

.source-node[data-source="inspection_log"] .icon {
  background: linear-gradient(180deg, #ef5b44, #c8402c);
}

.source-node[data-source="scan_image"] .icon {
  background: linear-gradient(180deg, #0c72ff, #0952bb);
}

.source-node[data-source="policy_plan"] .icon {
  background: linear-gradient(180deg, #ff6ca8, #dd3f90);
}

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

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

.engine-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);
}

.engine-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);
}

.engine-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);
}

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

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

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

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

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

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

.engine-core.is-busy .engine-core-inner {
  box-shadow: 0 0 0 8px rgba(20, 99, 255, 0.06), 0 0 32px rgba(20, 99, 255, 0.12);
}

.engine-core.pulse-hit .engine-core-inner {
  box-shadow: 0 0 0 10px rgba(20, 99, 255, 0.08), 0 0 36px rgba(14, 165, 164, 0.14);
}

.outcome-node {
  position: absolute;
  right: 18px;
  width: 190px;
  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;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.outcome-node.compliant {
  top: 108px;
}

.outcome-node.partial {
  top: 226px;
}

.outcome-node.non {
  top: 344px;
}

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

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

.outcome-node.non .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;
}

.outcome-node.is-active {
  transform: translateX(-2px) scale(1.01);
}

.outcome-node.compliant.is-active {
  border-color: rgba(46, 168, 111, 0.25);
  background: rgba(46, 168, 111, 0.07);
}

.outcome-node.partial.is-active {
  border-color: rgba(241, 180, 0, 0.25);
  background: rgba(241, 180, 0, 0.08);
}

.outcome-node.non.is-active {
  border-color: rgba(239, 91, 68, 0.25);
  background: rgba(239, 91, 68, 0.07);
}

.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);
}

.document-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 180ms linear;
}

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

.metadata-panel {
  display: grid;
  gap: 10px;
  opacity: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.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;
}

.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;
  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.fully {
  border-color: rgba(46, 168, 111, 0.22);
  background: linear-gradient(180deg, rgba(46, 168, 111, 0.05), rgba(255, 255, 255, 0.78));
}

.feed-item.partial {
  border-color: rgba(241, 180, 0, 0.22);
  background: linear-gradient(180deg, rgba(241, 180, 0, 0.06), rgba(255, 255, 255, 0.78));
}

.feed-item.non {
  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-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;
}

.page-footer {
  display: grid;
  gap: 12px;
}

.footer-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.footer-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(17, 20, 33, 0.08);
  background: rgba(255, 255, 255, 0.68);
}

.footer-card p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.4;
}

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

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

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

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

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

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

*::-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;
}

@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);
  }
}

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

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

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

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

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

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

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

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

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

@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,
  .page-footer {
    padding: 10px;
  }

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

  .summary-steps {
    grid-template-columns: 1fr 1fr;
  }

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

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

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

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

  .outcome-node-icon {
    width: 30px;
    height: 30px;
    font-size: 0.64rem;
  }

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

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

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

  .card-head,
  .response-head,
  .panel-head {
    flex-direction: column;
    align-items: start;
  }

  .panel-badge,
  .message-meta-top {
    text-align: left;
  }
}
