/* edda dashboard, light theme.
   Colors: teal = edda quote, amber = agent, violet/blue = outside price feeds, pink = Uniswap pool. */

:root {
  --paper: #F5F6FA;
  --card: #FFFFFF;
  --ink: #0C1233;
  --ink-2: #454D70;
  --ink-3: #5C6486;
  --rule: #DEE2EC;
  --track: #E7EAF2;
  --teal: #10B89D;
  --teal-ink: #036B5B;
  --amber: #F5A623;
  --amber-ink: #8A4F00;
  --red: #E5484D;
  --red-ink: #B42830;
  --grey: #9AA1BE;
  --grey-ink: #576082;
  --violet: #7754F6;
  --blue: #2B79F0;
  --pink: #E3448F;
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgb(12 18 51 / .05), 0 12px 28px -16px rgb(12 18 51 / .22);
  --gutter: 40px;
  --icon-ext: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.5 2.5h5v5M9.5 2.5l-7 7' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Crect x='4.5' y='4.5' width='7.5' height='7.5' rx='1.6' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3Cpath d='M9.5 2.4V2.2A1.2 1.2 0 0 0 8.3 1H3.2A1.2 1.2 0 0 0 2 2.2v5.1a1.2 1.2 0 0 0 1.2 1.2h.2' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.4l3 3 6-6.6' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 12px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.45 var(--display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
a { color: var(--teal-ink); }
:focus-visible { outline: 2px solid var(--teal-ink); outline-offset: 2px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); font-size: 14px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 60;
  padding: 10px 14px; border-radius: 8px; background: var(--ink); color: #fff; text-decoration: none;
}
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1520px; margin-inline: auto; padding-inline: var(--gutter); }
.h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.h3 { font-size: 14px; font-weight: 600; }

/* Tones: every state has a fill color and a text color with enough contrast */
[data-tone="teal"] { --tone: var(--teal); --tone-ink: var(--teal-ink); }
[data-tone="amber"] { --tone: var(--amber); --tone-ink: var(--amber-ink); }
[data-tone="red"] { --tone: var(--red); --tone-ink: var(--red-ink); }
[data-tone="grey"] { --tone: var(--grey); --tone-ink: var(--grey-ink); }
[data-tone="ink"] { --tone: var(--ink); --tone-ink: var(--ink); }

.mark {
  display: inline-block; flex: none; width: 9px; height: 9px;
  border-radius: 50%;
}
.mark[data-shape="dot"] { background: var(--tone, var(--grey)); }
.mark[data-shape="ring"] { border: 1.75px solid var(--tone, var(--grey)); }
.mark[data-shape="dash"] { border: 1.75px dashed var(--tone, var(--grey)); }
.mark[data-shape="square"] { border-radius: 2px; background: var(--tone, var(--grey)); }
.mark.is-pulse { animation: breathe 2.4s ease-in-out infinite; }

/* External links (explorer, Uniswap, venues, news), open in a new tab with a small arrow */
.ref {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: rgb(12 18 51 / .24); text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
a.ref:not([href]) { color: var(--ink-3); text-decoration: none; }
a.ref[href]:hover, .ext[href]:hover { color: var(--teal-ink); text-decoration-color: currentColor; }
a.ref[href]::after, .ext[href]::after {
  content: ''; display: inline-block; width: .68em; height: .68em; margin-left: .28em;
  background: currentColor; opacity: .45; transition: opacity .15s;
  -webkit-mask: var(--icon-ext) center / contain no-repeat; mask: var(--icon-ext) center / contain no-repeat;
}
a.ref[href]:hover::after, .ext[href]:hover::after { opacity: 1; }
.ref.is-new { animation: tx-flash 1.6s ease-out; border-radius: 4px; }

.copy {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 2px; padding: 0;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); vertical-align: middle;
  transition: background-color .15s, color .15s;
}
.copy::before {
  content: ''; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--icon-copy) center / contain no-repeat; mask: var(--icon-copy) center / contain no-repeat;
}
.copy:hover { background: var(--track); color: var(--ink); }
.copy.is-done { color: var(--teal-ink); }
.copy.is-done::before { -webkit-mask-image: var(--icon-check); mask-image: var(--icon-check); }

/* Header */
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; width: auto; height: 32px; }
.tagline { color: var(--ink-2); }
.top-meta {
  margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  font-size: 13px; color: var(--ink-3);
}
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--rule); background: var(--card);
  font: 500 12.5px/1 var(--display); color: var(--ink-2);
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--grey); }
.chip[data-state="live"]::before { background: var(--teal); animation: breathe 2.4s ease-in-out infinite; }
.chip[data-state="connecting"]::before { background: var(--amber); }
.chip[data-state="offline"]::before { background: var(--red); }
.top-block { color: inherit; text-decoration: none; }
.top-block[href]:hover { color: var(--teal-ink); text-decoration: underline; text-underline-offset: 3px; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--track); }
.seg-btn {
  min-height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: 0 1px 2px rgb(12 18 51 / .25); }
.role .seg-btn[data-role="operator"][aria-pressed="true"] { background: var(--teal); color: #04261F; }
.seg-btn[aria-busy="true"] { opacity: .55; }
.seg-sm .seg-btn { min-height: 30px; padding: 0 12px; font-size: 13px; }

.conn { border-block: 1px solid #F1D5A0; background: #FFF6E3; color: var(--amber-ink); font-size: 14px; }
.conn[data-state="offline"] { border-color: #F2C3C6; background: #FDEDEE; color: var(--red-ink); }
.conn-in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding-block: 10px; }
.link-btn {
  border: 0; background: none; padding: 0; color: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}

/* Pool strip */
.pools { position: relative; overflow: hidden; border-block: 1px solid var(--rule); }
.pools-in { padding-inline: calc(var(--gutter) - 12px); }
.pools-track { display: flex; }
.pool {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 13px 12px 11px; border: 0; border-bottom: 2px solid transparent; background: transparent;
  text-align: left; transition: background-color .2s, border-color .2s;
}
.pool:hover { background: rgb(255 255 255 / .75); }
.pool[aria-pressed="true"] { background: var(--card); border-bottom-color: var(--ink); }
.pool[data-idle] { cursor: default; opacity: .6; }
.pool[data-idle]:hover { background: transparent; }
.pool[data-idle] .pool-st { color: var(--grey-ink); }
.pool-sym { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.pool-px { font-size: 13px; color: var(--ink-2); }
.pool-st { font-size: 12px; color: var(--tone-ink); }
.pools::after {
  content: ''; position: absolute; left: 0; bottom: -1px; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal) 75%, transparent);
  transform: translateX(-100%); opacity: 0; pointer-events: none;
}
.pools.is-beat::after { animation: sweep .9s cubic-bezier(.3, .6, .3, 1); }

/* Market: quote and chart on the left, health on the right */
.market { display: grid; grid-template-columns: minmax(0, 1fr) 376px; }
.quote { min-width: 0; display: flex; flex-direction: column; padding: 28px 40px 22px 0; }
.quote-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 48px; }
.quote-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.quote-id { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pair { font-size: 17px; font-weight: 600; }
.quote-name { color: var(--ink-3); }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--tone); color: var(--tone-ink);
  font-size: 13px; font-weight: 500; background: var(--card);
}
.quote-note { font-size: 13px; color: var(--ink-3); }
.quote-mid {
  font-size: clamp(64px, 7.4vw, 108px); font-weight: 300; line-height: .92;
  letter-spacing: -0.045em; font-variant-numeric: tabular-nums;
}
.quote-mid[data-stale] { color: var(--ink-3); }
.figs { display: flex; gap: 36px; margin-bottom: 10px; }
.fig dt { font-size: 13px; color: var(--ink-3); }
.fig-note { font-size: 12px; }
.fig dd { font-size: 20px; }
.fig dd[data-tone] { color: var(--tone-ink); }

/* Where the quote lives on chain: its Uniswap pool and the transaction that set it */
.onchain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 36px; margin-top: 22px; font-size: 13px; }
.oc { display: flex; align-items: center; gap: 9px; min-height: 26px; }
.oc dt { color: var(--ink-3); }
.oc dd { display: flex; align-items: center; }
.oc .ref { padding: 1px 4px; margin: -1px -4px; }
.oc-note { margin-left: 12px; font: 12px var(--mono); color: var(--ink-3); }

.chart-tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 20px; margin-top: 18px;
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 7px; }
.sw { display: inline-block; flex: none; width: 18px; height: 2px; background: var(--c, var(--ink)); }
.sw-band { height: 10px; border-block: 1.5px solid #0E9F87; background: rgb(16 184 157 / .26); }
.sw-fair { height: 2.5px; background: var(--ink); }
.sw-uni { background: var(--pink); }
.sw-fill { width: 9px; height: 9px; border-radius: 50%; border: 1.75px solid var(--pink); background: var(--card); }

/* The chart takes the height the health panel leaves, at least 480 px */
.chart { position: relative; flex: 1 0 480px; min-height: 480px; margin-top: 14px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); }

.c-gridline { stroke: var(--rule); stroke-width: 1; }
.c-vline { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 5; }
.c-ylabel, .c-xlabel {
  font: 12px var(--mono); fill: var(--ink-3);
  paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round;
}
.c-xlabel { text-anchor: middle; }
.c-band-normal { fill: url(#edda-band); }
.c-band-wide { fill: url(#edda-wide); }
.c-band-stale { fill: url(#edda-stale); }
.c-edge { fill: none; stroke-width: 1.3; stroke-linejoin: round; }
.c-edge-normal { stroke: #0E9F87; }
.c-edge-wide { stroke: #DB8B08; }
.c-edge-stale { stroke: var(--grey); stroke-dasharray: 3 3; }
.c-edge-noinv { stroke-dasharray: 4 3; opacity: .6; }
.c-ref { fill: none; stroke-width: 1.3; stroke-linejoin: round; }
.c-uni { fill: none; stroke: var(--pink); stroke-width: 1.5; stroke-linejoin: round; }
.c-fair { fill: none; stroke: var(--ink); stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.c-fill { fill: var(--card); stroke: var(--pink); stroke-width: 1.6; }
.c-mark-line { stroke: var(--amber-ink); stroke-width: 1; stroke-dasharray: 4 4; opacity: .55; }
.c-mark-line[data-mode="stale"] { stroke: var(--grey-ink); }
.c-mark-title, .c-mark-sub {
  font: 600 13px var(--display); fill: var(--amber-ink);
  paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round;
}
.c-mark-title[data-mode="stale"] { fill: var(--grey-ink); }
.c-mark-sub { font-weight: 400; fill: var(--ink-2); }
.c-now-halo { fill: rgb(16 184 157 / .26); }
.c-now-ping {
  fill: none; stroke: var(--teal); stroke-width: 1.5;
  transform-box: fill-box; transform-origin: center; animation: ping 2.4s cubic-bezier(.2, .6, .3, 1) infinite;
}
.c-now-dot { fill: var(--ink); }
.c-pill { fill: var(--ink); }
.c-pill-text { font: 600 13px var(--mono); fill: #fff; dominant-baseline: central; }
.c-now.is-off .c-now-halo, .c-now.is-off .c-now-ping { display: none; }
.c-now.is-off .c-now-dot, .c-now.is-off .c-pill { fill: var(--grey-ink); }
.c-cross-line { stroke: var(--ink); stroke-width: 1; opacity: .3; }
.c-cross-dot { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; }
.c-sel-col { fill: rgb(12 18 51 / .045); }
.c-sel-box { fill: rgb(255 255 255 / .18); stroke: var(--ink); stroke-width: 1.5; }
.chart-svg.is-pickable { cursor: pointer; }

.chart-tip {
  position: absolute; left: 0; top: 0; z-index: 2; min-width: 200px; padding: 10px 12px;
  border-radius: 12px; background: var(--card); box-shadow: var(--shadow), 0 0 0 1px var(--rule);
  font-size: 13px; pointer-events: none;
}
.tip-time { display: block; margin-bottom: 6px; font-size: 12px; color: var(--ink-3); }
.tip-rows { display: flex; flex-direction: column; gap: 3px; }
.tip-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.tip-row dt { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.tip-row dd { font-family: var(--mono); }
.tip-tx { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--rule); }
.tip-hint { margin-top: 3px; font-size: 12px; color: var(--ink-3); }

/* Health panel */
.side { display: flex; flex-direction: column; gap: 24px; padding: 28px 0 26px 32px; border-left: 1px solid var(--rule); }
.panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.side > .panel + .panel { padding-top: 22px; border-top: 1px solid var(--rule); }

.hb-row { display: flex; align-items: center; gap: 22px; }
.hb-ring { position: relative; flex: none; width: 148px; height: 148px; --hb: var(--teal); }
.hb-ring[data-tone="amber"] { --hb: var(--amber); }
.hb-ring[data-tone="red"] { --hb: var(--red); }
.hb-ring[data-tone="grey"] { --hb: var(--grey); }
.hb-ring svg { display: block; width: 100%; height: 100%; }
.hb-ticks { fill: none; stroke: rgb(12 18 51 / .26); stroke-width: 5; stroke-dasharray: 1.4 38.39; }
.hb-track { fill: none; stroke: var(--track); stroke-width: 8; }
.hb-arc { fill: none; stroke: var(--hb); stroke-width: 8; stroke-linecap: round; transition: stroke .3s; }
.hb-ping {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-radius: 50%; border: 1.5px solid var(--hb); opacity: 0;
}
.hb-ring.is-beat .hb-ping { animation: ping 1.3s cubic-bezier(.2, .6, .3, 1); }
.hb-ring.is-beat .hb-age { animation: beat .5s ease-out; }
.hb-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hb-age { font-size: 40px; font-weight: 300; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hb-age small { font-size: 17px; letter-spacing: 0; color: var(--ink-3); }
.hb-cap { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.hb-counts { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.hb-counts li { display: flex; align-items: center; gap: 9px; }
.hb-note { font-size: 14px; color: var(--ink-2); }
.writes { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.write-list { display: flex; flex-direction: column; font-size: 13px; }
.write {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--rule); animation: arrive .5s ease-out;
}
.write:last-child { border-bottom: 0; }
.write-time { color: var(--ink-3); }
.write-gas { color: var(--ink-2); font-size: 12px; text-align: right; }

.bar-row { display: flex; flex-direction: column; gap: 5px; }
.bar-lbl { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.bar-lbl .num { color: var(--ink); }
.bar { height: 10px; border-radius: 5px; background: var(--track); }
.bar-fill { display: block; height: 100%; border-radius: 5px; }
.bar-edda { min-width: 8px; background: var(--teal); box-shadow: 0 0 14px rgb(16 184 157 / .75); }
.bar-base { width: 100%; background: #C8CDE0; }
.gas-big { margin-top: 6px; font-size: 34px; font-weight: 300; line-height: 1.05; letter-spacing: -0.03em; }
.gas-note { font-size: 13px; color: var(--ink-3); }
.gas-note .num { color: var(--ink); }

.feed-list { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.feed-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; }
.feed-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-weight: 500; }
.feed-mkt { font-size: 12.5px; font-weight: 400; }
.feed-state { display: flex; align-items: center; gap: 7px; color: var(--tone-ink); }
.feed-note { grid-column: 1 / -1; font-size: 13px; color: var(--ink-3); }

/* Agent plan */
.plan { border-top: 1px solid var(--rule); }
.plan-in { display: flex; flex-direction: column; gap: 16px; padding-block: 24px 26px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; }
.sec-sub { font-size: 14px; color: var(--ink-3); }
.restarts { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.restarts .num { color: var(--ink); }
.pips { display: flex; gap: 5px; }
.pip { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--ink-2); }
.pip.is-used { background: var(--ink-2); }
.pip.is-over { border-color: var(--red); background: var(--red); }

.tl { position: relative; height: 98px; }
.tl-axis span { position: absolute; top: 0; font-size: 11px; color: var(--ink-3); white-space: nowrap; transform: translateX(-50%); }
.tl-axis .tl-day { transform: none; padding-left: 0; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tl-axis .tl-day + .tl-day { padding-left: 8px; }
.tl-track { position: absolute; left: 0; right: 0; top: 22px; height: 24px; border-radius: 6px; background: var(--track); overflow: hidden; }
.tl-past { position: absolute; left: 0; top: 0; bottom: 0; background: rgb(12 18 51 / .05); }
.tl-bar { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.tl-bar[data-state="active"], .win-sw[data-state="active"] { background: var(--amber); }
.tl-bar[data-state="approved"], .win-sw[data-state="approved"] { background: rgb(245 166 35 / .55); }
.tl-bar[data-state="pending"], .win-sw[data-state="pending"] {
  background: repeating-linear-gradient(135deg, rgb(245 166 35 / .7) 0 4px, transparent 4px 8px);
  box-shadow: inset 0 0 0 1px #D98A0B;
}
.tl-bar[data-state="rejected"], .win-sw[data-state="rejected"] { box-shadow: inset 0 0 0 1px var(--grey); background: transparent; }
.tl-bar[data-state="done"], .win-sw[data-state="done"] { background: rgb(245 166 35 / .28); }
.tl-restart {
  position: absolute; top: 7px; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--track);
}
.tl-now { position: absolute; top: 16px; height: 36px; width: 2px; margin-left: -1px; background: var(--ink); }
.tl-now-pill {
  position: absolute; top: -17px; left: 50%; transform: translateX(-50%);
  padding: 0 5px; border-radius: 4px; background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 16px;
}
.tl-labels { position: absolute; inset: 0; pointer-events: none; }
.tl-label { position: absolute; top: 56px; display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; white-space: nowrap; }
.tl-label b { font-weight: 600; }
.tl-label a, .win-title a { color: inherit; text-decoration: none; }
.tl-label a[href], .win-title a[href] {
  pointer-events: auto; text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: rgb(12 18 51 / .24); text-underline-offset: 3px;
}
.tl-label a[href]::after, .win-title a[href]::after {
  content: ''; display: inline-block; width: .68em; height: .68em; margin-left: .28em;
  background: currentColor; opacity: .45;
  -webkit-mask: var(--icon-ext) center / contain no-repeat; mask: var(--icon-ext) center / contain no-repeat;
}
.tl-label a[href]:hover, .win-title a[href]:hover { color: var(--teal-ink); text-decoration-color: currentColor; }
.tl-label span { color: var(--ink-3); }
.tl-label[data-state="active"] b { color: var(--amber-ink); }
.tl-label[data-state="pending"] span { color: var(--amber-ink); font-weight: 500; }

.win-list { display: none; flex-direction: column; }
.win {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 14px;
}
.win:first-child { border-top: 1px solid var(--rule); }
.win-sw { grid-row: 1 / span 2; align-self: start; margin-top: 4px; width: 14px; height: 14px; border-radius: 4px; }
.win-title { font-weight: 600; }
.win-state { font-size: 13px; color: var(--ink-3); text-align: right; }
.win[data-state="pending"] .win-state, .win[data-state="active"] .win-state { color: var(--amber-ink); font-weight: 600; }
.win-when { grid-column: 2 / -1; font-size: 13px; color: var(--ink-3); }

/* Agent and book */
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); border-top: 1px solid var(--rule); }
.feed { min-width: 0; padding: 26px 36px 30px 0; }
.feed-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.feed-filter { margin-left: auto; }
.activity { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--teal-ink); }
.breathe { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: breathe 2.4s ease-in-out infinite; }
.src-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.src-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border: 1px solid var(--rule); border-radius: 999px;
  font-size: 12.5px; color: var(--ink-2); text-decoration: none; }
.src-chip[href]:hover { border-color: var(--ink-3); }
.src-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.src-chip[data-ok] .src-dot { background: var(--teal); }
.events { display: flex; flex-direction: column; margin-top: 18px; }
.ev { position: relative; display: grid; grid-template-columns: 50px 14px minmax(0, 1fr); column-gap: 14px; padding-bottom: 16px; }
.ev-time { padding-top: 3px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.ev-rail { position: relative; display: flex; justify-content: center; }
.ev-rail .mark { position: relative; z-index: 1; margin-top: 6px; box-shadow: 0 0 0 3px var(--paper); }
.ev-rail::after { content: ''; position: absolute; top: 16px; bottom: -18px; width: 1px; background: var(--rule); }
.ev:last-child .ev-rail::after { display: none; }
.ev-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ev-title { font-weight: 600; }
.ev-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ev-who { padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5; }
.ev-who[data-who="agent"] { color: var(--amber-ink); background: rgb(245 166 35 / .16); }
.ev-who[data-who="operator"] { color: var(--ink-2); background: rgb(154 161 190 / .18); }
.ev-detail { font-size: 14px; color: var(--ink-2); }
.ev-refs { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 4px; font-size: 13px; }
.ev-refs .ref { color: var(--ink-2); }
.ev-tx { font-size: 12.5px; }
.ev.is-new { animation: arrive .7s cubic-bezier(.2, .7, .2, 1); }
.ev.is-new .ev-title { animation: glow 2.6s ease-out; }
.more {
  margin-top: 2px; padding: 8px 0; border: 0; background: none;
  color: var(--teal-ink); font-size: 14px; font-weight: 600;
}
.more:hover { text-decoration: underline; text-underline-offset: 3px; }

.book { min-width: 0; display: flex; flex-direction: column; gap: 22px; padding: 26px 0 30px 36px; border-left: 1px solid var(--rule); }
.pnl { display: flex; flex-direction: column; gap: 2px; }
.pnl-value { font-size: 38px; font-weight: 300; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--teal-ink); }
.pnl-value[data-sign="neg"] { color: var(--red-ink); }
.pnl-note { font-size: 13px; color: var(--ink-3); }
.inv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; }
.inv-head .num { font-size: 13px; color: var(--ink-2); }
.inv-bar { position: relative; height: 8px; margin-top: 9px; border-radius: 4px; background: var(--track); }
.inv-fill { position: absolute; top: 0; height: 100%; border-radius: 4px; background: var(--ink-2); transition: left .4s, width .4s; }
.inv-target { position: absolute; left: 50%; top: -4px; width: 2px; height: 16px; margin-left: -1px; background: var(--ink); }
.inv-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 7px; font-size: 12.5px; color: var(--ink-3); }
.fills { display: flex; flex-direction: column; gap: 6px; }
.fill-list { display: flex; flex-direction: column; font-size: 13px; }
.fill {
  display: grid; grid-template-columns: 66px 54px minmax(0, 1fr) auto 112px; gap: 10px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--rule); animation: arrive .5s ease-out;
}
.fill:last-child { border-bottom: 0; }
.fill-time { color: var(--ink-3); }
.fill-side { font-weight: 600; }
.fill-side[data-side="buy"] { color: var(--teal-ink); }
.fill-side[data-side="sell"] { color: #A4246A; }
.fill-qty { color: var(--ink-2); }
.fill-px { color: var(--ink); text-align: right; }
.fill-tx { font-size: 12.5px; text-align: right; }

/* Operator settings */
.settings { border-top: 1px solid var(--rule); }
.settings-in { display: flex; flex-direction: column; gap: 16px; padding-block: 24px 26px; }
.lock-note { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.lock-note[data-unlocked] { color: var(--teal-ink); }
.lock { width: 14px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.controls { min-width: 0; margin: 0; padding: 0; border: 0; }
.controls-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.card {
  flex: 1 1 230px; min-width: 0; display: flex; flex-direction: column; gap: 12px;
  padding: 16px 18px 18px; border-radius: 16px; background: var(--card);
  border: 1px solid rgb(12 18 51 / .05); box-shadow: var(--shadow);
  transition: opacity .25s, box-shadow .25s;
}
.controls:disabled .card { opacity: .62; box-shadow: none; }
.card[aria-busy="true"] { opacity: .72; }
.pause[aria-busy="true"] { pointer-events: none; }
.ctl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ctl-head label, .ctl-label { font-size: 14px; color: var(--ink-2); }
.ctl-value { font-size: 20px; }
.ctl-hint { font-size: 12.5px; color: var(--ink-3); }

.slider {
  --pct: 50%; --tone: var(--teal);
  -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0;
  background: transparent; cursor: pointer;
}
.slider[data-tone="amber"] { --tone: var(--amber); }
.slider:disabled { cursor: not-allowed; }
.slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--tone) var(--pct), var(--track) var(--pct));
}
.slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track); }
.slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--tone); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%;
  background: #fff; border: 1px solid rgb(12 18 51 / .16);
  box-shadow: 0 1px 3px rgb(12 18 51 / .25), 0 0 0 5px color-mix(in srgb, var(--tone) 22%, transparent);
  transition: box-shadow .15s;
}
.slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid rgb(12 18 51 / .16);
  box-shadow: 0 1px 3px rgb(12 18 51 / .25), 0 0 0 5px color-mix(in srgb, var(--tone) 22%, transparent);
}
.slider:not(:disabled):hover::-webkit-slider-thumb,
.slider:not(:disabled):active::-webkit-slider-thumb {
  box-shadow: 0 1px 3px rgb(12 18 51 / .25), 0 0 0 9px color-mix(in srgb, var(--tone) 22%, transparent);
}
.slider:focus-visible { outline: none; }
.slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--teal-ink); }
.slider:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--teal-ink); }

.stepper { display: flex; align-items: center; gap: 16px; }
.step-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--card); font-size: 20px; line-height: 1;
  transition: background-color .15s, border-color .15s, transform .06s;
}
.step-btn:not(:disabled):hover { border-color: var(--ink-3); background: var(--paper); }
.step-btn:not(:disabled):active { transform: scale(.94); }
.step-btn[data-edge] { opacity: .4; cursor: default; }
.step-val { min-width: 28px; font-size: 26px; text-align: center; }

.approvals { flex: 1.6 1 320px; }
.appr-list { display: flex; flex-direction: column; gap: 12px; }
.appr { display: flex; flex-direction: column; gap: 4px; }
.appr + .appr { padding-top: 12px; border-top: 1px solid var(--rule); }
.appr[aria-busy="true"] { opacity: .6; pointer-events: none; }
.appr-title { font-weight: 600; }
.appr-when { font-size: 13px; color: var(--ink-3); }
.appr-src { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 13px; color: var(--ink-3); }
.appr-src .ref { color: var(--ink-2); }
.appr-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.btn {
  min-height: 40px; padding: 0 18px; border-radius: 20px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; transition: filter .15s, background-color .15s, border-color .15s, transform .06s;
}
.btn:not(:disabled):active { transform: translateY(1px); }
.btn-go { background: var(--teal); color: #04261F; }
.btn-go:not(:disabled):hover { filter: brightness(1.06) saturate(1.1); }
.btn-ghost { border-color: var(--rule); background: var(--card); color: var(--ink); }
.btn-ghost:not(:disabled):hover { border-color: var(--ink-3); }
.btn-danger { background: #C22F38; color: #fff; }
.btn-danger:not(:disabled):hover { background: #A9252D; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.pause { flex: 1 1 260px; }
.pause-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pause-text { display: flex; flex-direction: column; gap: 2px; }
.pause-title { font-size: 14px; font-weight: 600; }
.pause-confirm { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 14px; }
.switch {
  position: relative; flex: none; width: 54px; height: 30px; padding: 0; border: 0; border-radius: 15px;
  background: #CDD3E2; transition: background-color .2s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(12 18 51 / .3); transition: transform .2s;
}
.switch[aria-checked="true"] { background: var(--red); }
.switch[aria-checked="true"]::after { transform: translateX(24px); }

/* On-chain: contracts and pool IDs */
.chainfoot { border-top: 1px solid var(--rule); }
.chainfoot-in { display: flex; flex-direction: column; gap: 18px; padding-block: 24px 44px; }
.chainfoot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 24px 64px; align-items: start; }
.addr-list { display: flex; flex-direction: column; gap: 14px; }
.addr { display: flex; flex-direction: column; gap: 2px; }
.addr dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.addr-label { font-size: 14px; font-weight: 600; }
.addr-hint { font-size: 13px; color: var(--ink-3); }
.addr dd { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; font-size: 13px; }
.addr dd .copy { margin-left: -10px; }
.pid { display: flex; flex-direction: column; gap: 6px; }
.pid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); column-gap: 32px; font-size: 13px; }
.pid-row { display: flex; align-items: center; gap: 10px; min-height: 38px; border-bottom: 1px solid var(--rule); }
.pid-pair { min-width: 94px; font-weight: 500; }
.pid-row .copy { margin-left: -6px; }

/* Toasts */
.toasts {
  position: fixed; z-index: 40; right: 20px; bottom: 20px; display: flex; flex-direction: column;
  align-items: flex-end; gap: 8px; pointer-events: none;
}
.toast {
  max-width: min(400px, calc(100vw - 32px)); padding: 11px 15px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow);
  animation: toast-in .25s ease-out;
}
.toast[data-tone="error"] { background: #B42830; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }

.tabbar { display: none; }

/* Motion */
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.8); opacity: 0; } }
@keyframes beat { 0% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes sweep { 0% { transform: translateX(-100%); opacity: 1; } 100% { transform: translateX(100%); opacity: 0; } }
@keyframes arrive { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes glow { 0%, 30% { color: var(--teal-ink); } 100% { color: inherit; } }
@keyframes tick-up { 0%, 35% { color: var(--teal-ink); } }
@keyframes tick-down { 0%, 35% { color: var(--red-ink); } }
.is-tick[data-dir="up"] { animation: tick-up 1.2s ease-out; }
.is-tick[data-dir="down"] { animation: tick-down 1.2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tx-flash { 0%, 25% { background-color: rgb(16 184 157 / .24); } 100% { background-color: transparent; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .c-now-ping, .hb-ping { display: none; }
}

/* Tablet: health moves under the chart */
@media (max-width: 1179px) {
  .tagline { display: none; }
  .market { grid-template-columns: minmax(0, 1fr); }
  .quote { padding-right: 0; }
  .side {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
    padding: 24px 0; border-left: 0; border-top: 1px solid var(--rule);
  }
  .side > .panel { padding-inline: 28px; }
  .side > .panel:first-child { padding-left: 0; }
  .side > .panel:last-child { padding-right: 0; }
  .side > .panel + .panel { padding-top: 0; border-top: 0; border-left: 1px solid var(--rule); }
  .hb-row { flex-wrap: wrap; }
}

@media (max-width: 859px) {
  :root { --gutter: 24px; }
  .side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side > .panel.gas { padding-right: 0; }
  .side > .panel.feeds { grid-column: 1 / -1; margin-top: 22px; padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--rule); }
  .chart { flex-basis: 380px; min-height: 380px; }
  .tl { height: 60px !important; }
  .tl-labels { display: none; }
  .win-list { display: flex; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .feed { padding-right: 0; }
  .book { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .chainfoot-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Phone */
@media (max-width: 639px) {
  :root { --gutter: 16px; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .top-in { gap: 10px 12px; padding-block: 12px 10px; }
  .brand-logo { height: 29px; }
  .tagline { display: none; }
  .role { order: 2; margin-left: auto; }
  .role .seg-btn { min-height: 38px; padding: 0 14px; }
  .top-meta { order: 3; width: 100%; margin-left: 0; gap: 6px 14px; font-size: 12px; }
  .pools-in { padding-inline: 0; }
  .pools-track {
    overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-inline: 6px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
  }
  .pools-track::-webkit-scrollbar { display: none; }
  .pool { flex: 0 0 auto; min-width: 100px; padding: 12px 12px 10px; scroll-snap-align: start; }
  .quote { padding-top: 20px; }
  .quote-head { gap: 14px; }
  .quote-mid { font-size: 64px; }
  .figs { gap: 24px; margin-bottom: 0; }
  .fig dd { font-size: 17px; }
  .chart-tools { display: contents; }
  .range { order: 1; align-self: flex-end; margin-top: 18px; }
  .range .seg-btn { min-height: 36px; }
  .chart { order: 2; flex-basis: 270px; min-height: 270px; margin-top: 10px; }
  .legend { order: 3; margin-top: 14px; gap: 6px 14px; font-size: 12.5px; }
  .chart-tip { min-width: 180px; }
  .side { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
  .side > .panel { padding-inline: 0 !important; }
  .side > .panel + .panel { margin-top: 22px; padding-top: 22px; border-left: 0; border-top: 1px solid var(--rule); }
  .side > .panel.feeds { margin-top: 22px; }
  .hb-ring { width: 128px; height: 128px; }
  .hb-age { font-size: 34px; }
  .restarts { margin-left: 0; width: 100%; }
  .tl-hour:not([data-h="12"]) { display: none; }
  .top-block { display: none; }
  .card { flex-basis: 100%; }
  .approvals, .pause { flex-basis: 100%; }
  .onchain { gap: 2px 24px; margin-top: 18px; }
  .fill { grid-template-columns: 62px 48px minmax(0, 1fr) auto; row-gap: 1px; }
  .fill-tx { grid-column: 3 / -1; }
  .chainfoot-grid { grid-template-columns: minmax(0, 1fr); }
  .btn { min-height: 44px; }
  .toasts { left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }

  .tabbar {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--rule); background: rgb(255 255 255 / .96);
    -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  }
  .tab {
    position: relative; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; border-radius: 12px; color: var(--ink-3); font-size: 11px; font-weight: 500; text-decoration: none;
  }
  .tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tab[aria-current="true"] { color: var(--ink); }
  .tab[aria-current="true"]::before {
    content: ''; position: absolute; top: -7px; left: 32%; right: 32%; height: 2.5px;
    border-radius: 0 0 3px 3px; background: var(--teal);
  }
  .badge {
    position: absolute; top: 3px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--amber); color: var(--ink); font: 700 11px/18px var(--display); text-align: center;
  }
}
