/* Sovereign Leads. Palette and type follow sovereignplanning.co.uk: coral #E8825B,
   the #F22C5B -> #F28A60 gradient, charcoal #454545 text, Poppins headings, Inter body. */
:root {
  --bg: #faf8f7;
  --surface: #ffffff;
  --surface-2: #fdf4f0;
  --border: #ece5e1;
  --text: #454545;
  --text-soft: #6f6a68;
  --muted: #a29b98;
  --brand: #E8825B;
  --brand-hover: #d96b41;
  --accent: #F22C5B;
  --gradient: linear-gradient(135deg, #F22C5B 0%, #F28A60 70%);
  --good: #23805a;
  --good-bg: #e6f5ee;
  --warn: #a45a05;
  --warn-bg: #fdf1dd;
  --bad: #b83333;
  --bad-bg: #fdecec;
  --info: #2a62a8;
  --info-bg: #e8f1fb;
  --shadow: 0 1px 2px rgb(69 69 69 / .06), 0 4px 12px rgb(69 69 69 / .05);
  --shadow-lg: 0 10px 30px rgb(69 69 69 / .10), 0 2px 6px rgb(69 69 69 / .05);
  --heading: 'Poppins', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --radius: 16px;
  color-scheme: light;
}

*, ::before, ::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 .9rem/1.55 'Inter', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--heading); color: var(--text); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1rem; font-weight: 600; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .8rem; }
a { color: var(--brand-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: .08rem .35rem; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---- Header --------------------------------------------------------------- */
.top { background: rgb(255 255 255 / .86); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; height: 62px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font: 600 1.05rem var(--heading); }
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
.tabs { display: flex; gap: 4px; flex: 1; align-self: stretch; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; display: flex; align-items: center; padding: 0 .8rem; white-space: nowrap;
  font: 500 .86rem var(--heading); color: var(--text-soft); transition: color .15s ease;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a::after { content: ''; position: absolute; left: .8rem; right: .8rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--gradient); transform: scaleX(0); transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.tabs a:hover::after { transform: scaleX(.35); }
.tabs a.is-active { color: var(--text); }
.tabs a.is-active::after { transform: scaleX(1); }
.top-user { display: flex; align-items: center; gap: 12px; margin: 0; }
.top-name { font-size: .82rem; color: var(--text-soft); }

/* ---- Layout --------------------------------------------------------------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 30px 20px 72px; }
.wrap-narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--text-soft); }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-actions form { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-wide-left { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.narrow { max-width: 680px; }
.inline-filter { margin: 0; }
.inline-filter select { width: auto; padding: .45rem 2rem .45rem .75rem; font: 500 .8rem var(--heading); border-radius: .7rem; }
.price-list { border: 1px solid var(--border); border-radius: .8rem; margin-bottom: 14px; }
.price-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.price-row:last-child { border-bottom: 0; }
.price-row .check { flex: 1; margin: 0 !important; }
.price-row .price { display: flex; align-items: center; gap: 6px; color: var(--text-soft); font-size: .84rem; }
.price-row .price input { width: 110px; margin: 0 !important; text-align: right; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head p { margin: 2px 0 0; font-size: .84rem; }
.link { font-size: .82rem; font-weight: 600; }

/* ---- Stat tiles ----------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.tile {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 16px;
  display: flex; flex-direction: column; gap: 2px; transition: transform .2s ease, box-shadow .2s ease;
}
.tile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gradient); opacity: 0; transition: opacity .2s ease; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile:hover::before { opacity: 1; }
.tile-label { font-size: .78rem; font-weight: 600; color: var(--text-soft); }
.tile-value { font: 700 1.9rem/1.2 var(--heading); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: .78rem; color: var(--muted); }

/* ---- Buttons, pills, badges ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; white-space: nowrap;
  padding: .58rem 1rem; border-radius: .6rem; border: 1px solid transparent; cursor: pointer;
  font: 600 .84rem/1 var(--heading); text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .08s ease, filter .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { color: #fff; background: var(--gradient); box-shadow: 0 2px 8px rgb(242 44 91 / .22); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 4px 14px rgb(242 44 91 / .28); }
.btn-ghost { color: var(--text-soft); background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); border-color: var(--brand); }
.btn-sm { padding: .42rem .7rem; font-size: .76rem; }
.btn-block { width: 100%; padding: .78rem 1rem; font-size: .92rem; margin-top: .4rem; }

.pills { display: inline-flex; padding: 3px; gap: 2px; background: #f3eeeb; border-radius: .7rem; }
.pills a { padding: .38rem .75rem; border-radius: .5rem; font: 500 .78rem var(--heading); color: var(--text-soft); white-space: nowrap; transition: background-color .15s ease, color .15s ease; }
.pills a:hover { color: var(--text); text-decoration: none; }
.pills a.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(69 69 69 / .12); }

.badge { display: inline-block; padding: .16rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge-good { color: var(--good); background: var(--good-bg); }
.badge-bad { color: var(--bad); background: var(--bad-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-neutral { color: var(--text-soft); background: #f1ecea; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 9px; vertical-align: baseline; }

/* ---- Tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th { text-align: left; padding: 0 12px 10px; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table tbody tr { transition: background-color .12s ease; }
.table tbody tr:hover { background: #fdfaf8; }
.table tr[data-href] { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table a { color: var(--text); }
.table a.link { color: var(--brand-hover); }
.table-compact td { padding: 8px 12px; }
.reason { font-size: .74rem; color: var(--bad); margin-top: 3px; max-width: 260px; }
.reason-plain { color: var(--muted); }
.route-row { display: grid; grid-template-columns: 1.3fr .8fr .8fr 1.7fr 1.5fr; gap: 8px; margin-bottom: 8px; }
.route-row input { margin: 0 !important; }
.route-head { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.rule-list { margin: 0 0 14px; padding-left: 1.1rem; }
.rule-list li { margin-bottom: 2px; }
@media (max-width: 640px) { .route-row { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--border); } .route-head { display: none; } }
.subform { border: 1px solid var(--border); border-radius: .8rem; padding: 14px 16px 2px; margin: 4px 0 16px; }
.subform legend { padding: 0 6px; font: 600 .84rem var(--heading); color: var(--text); }
.subform .hint { margin: 0 0 12px; }
.postback-test { margin: 0 0 14px; }
.postback-result { margin: 12px 0 14px; padding: 12px 14px; border-radius: .7rem; font-size: .86rem; border: 1px solid; }
.postback-result.is-ok { color: var(--good); background: var(--good-bg); border-color: #c6e8d7; }
.postback-result.is-bad { color: #8a2020; background: var(--bad-bg); border-color: #f6d3d3; }
.postback-result pre.code { margin: 10px 0 0; max-height: 220px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 18px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed li:first-child { padding-top: 0; }
.feed a { color: inherit; min-width: 0; }
.feed a:hover { text-decoration: none; }
.feed a:hover .feed-main { color: var(--brand-hover); }
.feed-main { display: block; font-weight: 500; transition: color .15s ease; overflow-wrap: anywhere; }
.feed-sub { display: block; font-size: .76rem; color: var(--muted); }
.feed-top { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

.empty { text-align: center; color: var(--text-soft); padding: 34px 16px; }
.empty h2 { margin-bottom: 6px; }
.empty .btn { margin-top: 8px; }

/* ---- Forms ---------------------------------------------------------------- */
.form label, .filters label { display: block; margin: 0 0 5px; font-size: .78rem; font-weight: 600; color: var(--text-soft); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: .62rem .8rem; border-radius: .6rem; border: 1px solid var(--border);
  background: #fff; color: var(--text); font: 400 .9rem/1.4 'Inter', sans-serif; outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form input:not([type=checkbox]):not([type=file]), .form select, .form textarea { margin-bottom: 14px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(232 130 91 / .18); }
textarea { resize: vertical; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
input[type=file] { margin-bottom: 14px; font-size: .84rem; max-width: 100%; }
.hint { margin: -8px 0 14px; font-size: .76rem; color: var(--muted); }
.card > .hint, .guide .hint { margin-top: 8px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.check { display: flex !important; align-items: flex-start; gap: 10px; margin: 4px 0 16px !important; cursor: pointer; font-weight: 500 !important; color: var(--text) !important; font-size: .88rem !important; }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.check small { display: block; font-weight: 400; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.check-inline { margin: 0 !important; align-items: center; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; }
.filters input[type=search] { flex: 2 1 260px; width: auto; }
.filters select { flex: 1 1 150px; width: auto; }

.alert { margin-bottom: 16px; padding: 10px 12px; border-radius: .6rem; font-size: .84rem; line-height: 1.45; color: #8a2020; background: var(--bad-bg); border: 1px solid #f6d3d3; }
.alert-info { color: #6b4a12; background: var(--warn-bg); border-color: #f3dfb8; }
.flash { margin-bottom: 18px; padding: 12px 16px; border-radius: .8rem; font-size: .86rem; font-weight: 500; border: 1px solid; }
.flash-demo { color: #6b4a12; background: var(--warn-bg); border-color: #f3dfb8; }
.flash-demo a { font-weight: 600; margin-left: 6px; }
.flash-ok { color: var(--good); background: var(--good-bg); border-color: #c6e8d7; }
.flash-error { color: #8a2020; background: var(--bad-bg); border-color: #f6d3d3; }

/* ---- Key/value lists, code, guide ----------------------------------------- */
.kv { margin: 0; }
.kv > div { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--text-soft); font-size: .84rem; }
.kv dt small { display: block; color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: .7rem; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 6px; font-size: .76rem; font-weight: 600; color: var(--text-soft); }
pre.code { margin: 0 0 12px; padding: 12px 14px; background: #2f2b2a; color: #f6efec; border-radius: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 380px; overflow: auto; line-height: 1.6; }
.share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 20px; background: var(--surface-2); border: 1px solid var(--border); border-radius: .8rem; }
.share code { flex: 1 1 260px; background: none; border: 0; padding: 0; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 22px 46px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -3px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--gradient); font: 600 .82rem var(--heading);
}
.steps > li::after { content: ''; position: absolute; left: 14.5px; top: 33px; bottom: 6px; width: 1px; background: var(--border); }
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps h3 { margin-bottom: 8px; }
.danger-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.danger-row form { margin: 0; }
.attempt { border: 1px solid var(--border); border-radius: .8rem; padding: 10px 12px; margin-bottom: 10px; }
.attempt summary { cursor: pointer; font-size: .84rem; }
.guide-brand { margin-bottom: 22px; }

/* ---- Charts --------------------------------------------------------------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #efe9e5; stroke-width: 1; }
.chart .axis { stroke: #d8cfca; stroke-width: 1; }
.chart text { font: 400 11px 'Inter', sans-serif; fill: var(--muted); }
.chart .end-label { fill: var(--text-soft); font-weight: 500; }
.chart .band { fill: transparent; }
.chart .band.is-on { fill: rgb(69 69 69 / .05); }
.chart .seg, .chart .line, .chart .pt { transition: opacity .15s ease; }
.chart.is-hover .seg { opacity: .55; }
.chart.is-hover .seg.is-on { opacity: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: .78rem; color: var(--text-soft); }
.chart-legend span { display: inline-flex; align-items: center; }
.chart-tip {
  position: fixed; z-index: 50; pointer-events: none; min-width: 150px; max-width: 280px; padding: 10px 12px;
  background: #fff; border: 1px solid var(--border); border-radius: .7rem; box-shadow: var(--shadow-lg); font-size: .78rem;
}
.chart-tip b { display: block; margin-bottom: 5px; font: 600 .78rem var(--heading); color: var(--text); }
.chart-tip div { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--text-soft); }
.chart-tip div span:last-child { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- Sign in -------------------------------------------------------------- */
body.plain { min-height: 100vh; min-height: 100dvh; background: linear-gradient(170deg, #fdf4f0 0%, #faf8f7 45%); }
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 34px 32px 28px; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.auth-logo { height: 46px; width: auto; margin-bottom: 16px; }
.auth-sub { margin: 8px 0 22px; font-size: .88rem; color: var(--text-soft); }
.auth-card .form, .auth-card .alert { text-align: left; }

/* ---- Motion: subtle fade and slide in ------------------------------------- */
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.reveal { animation: reveal .55s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart .seg { transform-box: fill-box; transform-origin: bottom; animation: grow .6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .line { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw .9s ease-out .15s forwards; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .chart .seg, .chart .line { animation: none; }
  .chart .line { stroke-dashoffset: 0; }
  .tile, .btn { transition: none; }
}

/* ---- Small screens -------------------------------------------------------- */
@media (max-width: 960px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-wide-left { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .top-inner { height: auto; padding: 10px 16px 0; flex-wrap: wrap; gap: 8px 16px; }
  .top-user { margin-left: auto; }
  .top-name { display: none; }
  .tabs { order: 3; flex-basis: 100%; }
  .tabs a { height: 42px; }
  .wrap { padding: 22px 16px 56px; }
  .card { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .tiles { gap: 12px; }
  .tile-value { font-size: 1.5rem; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .steps > li { padding-left: 40px; }
}

/* ---- Live pipeline -------------------------------------------------------- */
.live-status { display: inline-flex; align-items: center; gap: 8px; font: 500 .8rem var(--heading); color: var(--good); }
.live-status i { width: 9px; height: 9px; border-radius: 50%; background: #2f9e6b; box-shadow: 0 0 0 0 rgb(47 158 107 / .5); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 10px rgb(47 158 107 / 0); } }
.tile-value.bump { animation: bump .5s cubic-bezier(.2, .7, .2, 1); }
@keyframes bump { 30% { transform: scale(1.14); color: var(--accent); } }

.pipeline { position: relative; padding: 26px 22px 30px; overflow: hidden; background: linear-gradient(180deg, #fff 0%, #fffaf7 100%); }
.lane { position: relative; height: 64px; }
.packet {
  position: absolute; top: 4px; left: 12.5%; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; white-space: nowrap;
  background: #fff; border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-lg);
  transition: left .8s cubic-bezier(.65, 0, .25, 1), opacity .4s ease, transform .5s cubic-bezier(.2, .7, .2, 1), border-color .3s ease, box-shadow .3s ease;
  opacity: 0;
}
.packet .dot { margin: 0; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.packet b { display: block; font: 600 .86rem/1.2 var(--heading); color: var(--text); }
.packet small { display: block; font-size: .72rem; color: var(--muted); }
.packet.no-anim, .track-fill.no-anim { transition: none; }
.packet.no-anim { transform: translateX(-50%) translateY(-18px) scale(.9); }
.packet.is-in { opacity: 1; }
.packet.is-good { border-color: #bfe5d2; box-shadow: 0 10px 30px rgb(47 158 107 / .22); }
.packet.is-bad { border-color: #f1c1c1; box-shadow: 0 10px 30px rgb(214 69 69 / .2); animation: shake .45s ease; }
.packet.is-out { opacity: 0; transform: translateX(-50%) translateY(36px) scale(.92); }
@keyframes shake { 20%, 60% { margin-left: -6px; } 40%, 80% { margin-left: 6px; } }

.track { position: absolute; left: 12.5%; right: 12.5%; top: 118px; height: 4px; border-radius: 4px; background: #f1e9e5; }
.track-fill { height: 100%; width: 0; border-radius: 4px; background: var(--gradient); transition: width .8s cubic-bezier(.65, 0, .25, 1); }
.nodes { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); z-index: 2; }
.node { text-align: center; padding: 0 10px; }
.node-icon {
  position: relative; width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid #eadfd9; color: var(--muted);
  transition: border-color .35s ease, color .35s ease, background .35s ease, transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
}
.node-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.node h3 { font-size: .9rem; color: var(--text-soft); transition: color .3s ease; }
.node-text { margin: 4px auto 0; max-width: 220px; min-height: 2.6em; font-size: .78rem; line-height: 1.3; color: var(--muted); transition: color .3s ease; }
.node.is-active .node-icon { border-color: var(--brand); color: var(--brand-hover); transform: scale(1.12); box-shadow: 0 0 0 8px rgb(232 130 91 / .14); animation: breathe 1.1s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 13px rgb(232 130 91 / .05); } }
.node.is-active h3, .node.is-done h3 { color: var(--text); }
.node.is-active .node-text, .node.is-done .node-text { color: var(--text-soft); font-weight: 500; }
.node.is-done .node-icon { border-color: transparent; color: #fff; background: var(--gradient); box-shadow: 0 6px 16px rgb(242 44 91 / .25); }
.node.is-fail .node-icon { border-color: var(--bad); color: #fff; background: var(--bad); }
.node.is-fail .node-text { color: var(--bad); font-weight: 500; }
.node.is-wait .node-icon { border-color: #e2a53a; color: var(--warn); background: var(--warn-bg); }
.node.is-wait .node-text { color: var(--warn); font-weight: 500; }
.node.is-burst .node-icon { background: linear-gradient(135deg, #2f9e6b, #58c08e); box-shadow: 0 6px 18px rgb(47 158 107 / .35); animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst i { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; opacity: 0; }
.burst i:nth-child(odd) { background: #F22C5B; } .burst i:nth-child(even) { background: #F2A860; } .burst i:nth-child(3n) { background: #2f9e6b; }
.node.is-burst .burst i { animation: spark .9s cubic-bezier(.1, .7, .3, 1) forwards; }
.burst i:nth-child(1) { --dx: 0px; --dy: -46px; } .burst i:nth-child(2) { --dx: 33px; --dy: -33px; }
.burst i:nth-child(3) { --dx: 46px; --dy: 0px; } .burst i:nth-child(4) { --dx: 33px; --dy: 33px; }
.burst i:nth-child(5) { --dx: 0px; --dy: 46px; } .burst i:nth-child(6) { --dx: -33px; --dy: 33px; }
.burst i:nth-child(7) { --dx: -46px; --dy: 0px; } .burst i:nth-child(8) { --dx: -33px; --dy: -33px; }
@keyframes spark { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }

.live-feed li { transition: background-color 1.2s ease; }
.live-feed li.is-new { animation: feed-in .6s cubic-bezier(.2, .7, .2, 1) both, glow 2.4s ease-out; }
@keyframes feed-in { from { opacity: 0; transform: translateY(-14px); max-height: 0; } to { opacity: 1; transform: none; max-height: 90px; } }
@keyframes glow { 0% { background: #fdf0ea; } 100% { background: transparent; } }
.feed-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.live-feed .dot { border-radius: 50%; }
@media (max-width: 640px) {
  .packet { padding: 7px 12px 7px 10px; }
  .node h3 { font-size: .78rem; } .node-text { font-size: .68rem; } .node { padding: 0 3px; }
  .node-icon { width: 44px; height: 44px; } .track { top: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .packet, .track-fill, .node-icon { transition: none; }
  .node.is-active .node-icon, .node.is-burst .node-icon, .node.is-burst .burst i, .live-status i, .tile-value.bump, .live-feed li.is-new, .packet.is-bad { animation: none; }
}
