:root {
  --cream: #fdf8f2;
  --ink: #2c2438;
  --ink-soft: #6b6178;
  --line: #e8dfd4;
  --mint: #9be8c8;
  --mint-deep: #2f9e73;
  --peach: #ffc9b0;
  --peach-deep: #e0703f;
  --lilac: #cdbcff;
  --lilac-deep: #7a5cf0;
  --lemon: #ffe89a;
  --card: #ffffff;
  --shadow: 0 10px 30px -18px rgba(60, 40, 80, .45);
  --radius: 26px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

.blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
}
.blob--mint { width: 380px; height: 380px; background: var(--mint); top: -120px; left: -80px; }
.blob--peach { width: 420px; height: 420px; background: var(--peach); top: 120px; right: -160px; }
.blob--lilac { width: 360px; height: 360px; background: var(--lilac); bottom: -140px; left: 30%; }

.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; position: relative; z-index: 1; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(253, 248, 242, .78); border-bottom: 1px solid var(--line); }
.top__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand__mark { font-size: 28px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.08)); }
.brand__text { font-family: "Baloo 2", cursive; font-weight: 700; font-size: 21px; line-height: 1.05; display: flex; flex-direction: column; }
.brand__text small { font-family: "Nunito", sans-serif; font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.top__right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.pill { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.pill--live { color: var(--mint-deep); display: inline-flex; align-items: center; gap: 7px; }
.pill--live i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint-deep); box-shadow: 0 0 0 0 rgba(47,158,115,.6); animation: ping 2.2s infinite; }
.pill--muted { color: var(--ink-soft); font-family: var(--mono); font-size: 11px; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(47,158,115,.5); }
  70% { box-shadow: 0 0 0 10px rgba(47,158,115,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,158,115,0); }
}

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.6fr .9fr; gap: 28px; align-items: center; padding: 46px 0 26px; }
.hero__copy h1 { font-family: "Baloo 2", cursive; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.05; margin: 0 0 14px; }
.hl { background: linear-gradient(180deg, transparent 58%, var(--lemon) 58%); padding: 0 4px; border-radius: 4px; }
.hero__copy p { margin: 0; color: var(--ink-soft); font-size: 16px; max-width: 46ch; }
.hero__mascot { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mascot {
  font-size: 62px; width: 132px; height: 132px; border-radius: 40px; display: grid; place-items: center;
  background: linear-gradient(150deg, #fff, var(--lilac)); box-shadow: var(--shadow);
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.mascot__bubble { background: #fff; border: 1px solid var(--line); padding: 8px 14px; border-radius: 16px; font-size: 13px; font-weight: 600; color: var(--ink-soft); box-shadow: var(--shadow); max-width: 230px; text-align: center; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; position: relative; overflow: hidden; }
.card--stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--lemon); opacity: .35; }
.card:nth-child(2).card--stat::after { background: var(--mint); }
.card:nth-child(3).card--stat::after { background: var(--peach); }
.card:nth-child(4).card--stat::after { background: var(--lilac); }
.card__label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
.card__value { font-family: "Baloo 2", cursive; font-size: 30px; line-height: 1.15; margin: 6px 0 4px; }
.card__value--sm { font-size: 22px; }
.card__value small { font-size: 15px; color: var(--ink-soft); }
.card__foot { font-size: 12px; color: var(--ink-soft); }
.spark { width: 100%; height: 40px; display: block; margin-top: 8px; }

/* ---------- panels ---------- */
.panel { background: rgba(255,255,255,.86); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 22px; }
.panel__head { margin-bottom: 16px; }
.panel__head h2 { font-family: "Baloo 2", cursive; font-size: 22px; margin: 0; }
.panel__head p { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }
.panel__head--row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }

/* ---------- flow ---------- */
.flow { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 0; padding: 0; counter-reset: step; }
.flow li { background: #fff; border: 1px dashed var(--line); border-radius: 18px; padding: 14px; position: relative; }
.flow li.is-active { border: 1px solid var(--mint-deep); background: linear-gradient(160deg, #fff, #eafff6); box-shadow: 0 0 0 4px rgba(155,232,200,.35); }
.flow li.is-done { border-style: solid; border-color: var(--mint); background: linear-gradient(160deg, #fff, #f4fffb); }
.flow__name { font-family: "Baloo 2", cursive; font-size: 15px; }
.flow__count { font-family: var(--mono); font-size: 22px; line-height: 1.1; margin-top: 4px; }
.flow__note { font-size: 11px; color: var(--ink-soft); }
.flow__arrow { position: absolute; right: -9px; top: 50%; transform: translateY(-50%); color: var(--line); font-size: 15px; }

/* ---------- agents ---------- */
.agents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.agent { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 16px; transition: transform .18s ease, box-shadow .18s ease; position: relative; overflow: hidden; }
.agent:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 18px 36px -22px rgba(60,40,80,.5); }
.agent__top { display: flex; align-items: center; gap: 12px; }
.agent__face { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: var(--cream); flex: none; overflow: hidden; }
.agent__face svg { display: block; width: 52px; height: 52px; }
.agent__name { font-family: "Baloo 2", cursive; font-size: 17px; line-height: 1.1; }
.agent__role { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.agent__task { font-size: 13px; margin: 12px 0 10px; min-height: 38px; color: #463d54; }
.agent__meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--ink-soft); font-family: var(--mono); }
.badge { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: lowercase; }
.badge--idle { background: #f1ece4; color: #8a7f70; }
.badge--working { background: var(--mint); color: #14654a; }
.badge--done { background: #e6f0ff; color: #2a5aa8; }
.badge--alert { background: #ffd9d2; color: #a83a22; }
.agent.is-working { border-color: var(--mint-deep); }
.agent.is-working .agent__face { animation: pulseFace 1.6s ease-in-out infinite; }
@keyframes pulseFace { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08) rotate(3deg); } }
.agent.is-alert { border-color: #e0703f; background: #fff6f3; }
.agent__chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.mini { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--cream); color: var(--ink-soft); font-family: var(--mono); }

/* ---------- split ---------- */
.split { display: grid; grid-template-columns: 1.35fr .95fr; gap: 22px; align-items: stretch; }
.chart { position: relative; min-height: 180px; }
.chart svg { width: 100%; height: 180px; display: block; }
.chart__empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--ink-soft); }

/* ---------- positions ---------- */
.positions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pos { border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; background: #fff; }
.pos__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pos__sym { font-family: "Baloo 2", cursive; font-size: 16px; }
.pos__pnl { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.pos__pnl.up { color: var(--mint-deep); }
.pos__pnl.down { color: var(--peach-deep); }
.pos__bar { height: 8px; border-radius: 999px; background: #f2ece4; margin: 10px 0 6px; position: relative; overflow: hidden; }
.pos__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--mint), var(--lilac)); }
.pos__legend { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-soft); font-family: var(--mono); }
.empty { font-size: 13px; color: var(--ink-soft); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 18px; }

/* ---------- feed ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-family: inherit; font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: all .15s ease; }
.chip:hover { transform: translateY(-1px); }
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 520px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 74px 118px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: 13.5px; animation: slideIn .3s ease both; }
@keyframes slideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.feed__time { font-family: var(--mono); font-size: 11px; color: #5f566d; }
.feed__bot { font-weight: 800; font-size: 12px; }
.feed__idea { color: #463d54; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed__status { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--cream); color: var(--ink-soft); font-family: var(--mono); }
.feed__status[data-s="APPROVED"], .feed__status[data-s="FILLED"] { background: var(--mint); color: #14654a; }
.feed__status[data-s="REJECTED"], .feed__status[data-s="STOP BREACH"] { background: #ffd9d2; color: #a83a22; }
.feed__status[data-s="CLOSED"] { background: #e6f0ff; color: #2a5aa8; }

/* ---------- foot ---------- */
.foot { display: flex; gap: 10px; justify-content: center; align-items: center; padding: 10px 0 46px; font-size: 12px; color: #5b5468; font-family: var(--mono); flex-wrap: wrap; }
.foot__dot { opacity: .5; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .agents { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero__mascot { flex-direction: row; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .flow { grid-template-columns: 1fr 1fr; }
  .agents { grid-template-columns: 1fr; }
  .feed li { grid-template-columns: 1fr; gap: 4px; }
  .feed__idea { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
