/* Garden tokens — lifted from registry-manager-fe (src/index.css + DESIGN.md).
   Garden has one light look, so this page commits to it and paints every
   colour explicitly rather than shipping an invented dark theme. */
:root {
  --pink: #fc79c1;
  --pink-soft: #fde3f1;
  --iris: #473c75;
  --mist: #e4ebf2;
  --off-white: #f4f0fc;
  --white: #ffffff;
  --mid-grey: #908aad;
  --light-grey: #e3e0eb;
  --green: #46d3a2;
  --light-green: #b6fbe3;
  --yellow: #ffbd5f;
  --error: #ff005c;
  --blue: #1d6ea8;
  --light-blue: #c2e9ff;

  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --shadow: 0 0 16px #554b6a14;

  --font: Haffer, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--mist);
  color: var(--iris);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  padding-inline: 16px;
  padding-block: 24px 48px;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.muted {
  color: var(--mid-grey);
}
code {
  font-size: 12px;
}

/* ---------- header ---------- */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.top h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.top .sub {
  margin: 4px 0 0;
  color: var(--mid-grey);
  font-size: 13px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--off-white);
  border: 1px solid var(--light-grey);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.seg button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--iris);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.seg button:hover {
  background: var(--light-grey);
}
.seg button[aria-pressed="true"] {
  background: var(--pink);
  color: var(--white);
}
.seg button:focus-visible,
.linkish:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

/* ---------- at a glance ---------- */
.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

.answer {
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.q {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mid-grey);
  display: flex;
  align-items: center;
}
.big {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.big small {
  font-size: 14px;
  font-weight: 500;
  color: var(--mid-grey);
  letter-spacing: 0;
}
.say {
  font-size: 13px;
  margin: 0;
}

/* pie + legend */
.pie-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.pie {
  width: 104px;
  height: 104px;
  display: block;
}
.pie path,
.pie circle {
  stroke: var(--white);
  stroke-width: 1;
}
.pie [data-slice] {
  cursor: default;
  transition: opacity 120ms ease;
}
.pie:hover [data-slice] {
  opacity: 0.55;
}
.pie:hover [data-slice]:hover {
  opacity: 1;
}
.legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}
.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.legend b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.legend span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-routes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}
.mini-routes > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mini-routes .r {
  font-weight: 600;
}

/* ---------- takeaways ---------- */
.takeaways {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 800px) {
  .takeaways {
    grid-template-columns: minmax(0, 1fr);
  }
}
.take {
  background: var(--iris);
  color: var(--white);
  border-radius: var(--radius-2xl);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.take .q {
  color: var(--light-grey);
}
.take .tip {
  border-color: var(--light-grey);
  color: var(--light-grey);
}
.take .tip:hover,
.take .tip:focus-visible {
  border-color: var(--pink);
  color: var(--pink);
}
.take .big {
  color: var(--white);
}
.take .big small {
  color: var(--light-grey);
}
.take .say {
  color: var(--light-grey);
}
.rank {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.rank .step {
  background: var(--pink);
  color: var(--white);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
  font-size: 13px;
}
.rank .step.dim {
  background: #ffffff26;
}
.rank .arrow {
  color: var(--light-grey);
}

/* ---------- detail panels ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-2xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.panel h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.panel .lede {
  margin: 0;
  font-size: 13px;
}
.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 800px) {
  .two {
    grid-template-columns: minmax(0, 1fr);
  }
}
.two > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.sub-h {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mid-grey);
  display: flex;
  align-items: center;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.kpi {
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-xl);
  padding: 12px;
  min-width: 0;
}
.kpi .v {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi .l {
  font-size: 12px;
  color: var(--mid-grey);
  display: flex;
  align-items: center;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bar-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 128px;
  align-items: center;
  gap: 10px;
}
@media (max-width: 520px) {
  .bar-row {
    grid-template-columns: 96px minmax(0, 1fr) 100px;
  }
}
.bar-row .name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-row .track {
  height: 10px;
  background: var(--light-grey);
  border-radius: 999px;
  overflow: hidden;
}
.bar-row .fill {
  height: 100%;
  border-radius: 999px;
}
.bar-row .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.bar-row .num small {
  color: var(--mid-grey);
}

.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-xl);
  background: var(--white);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--light-grey);
  white-space: nowrap;
  vertical-align: top;
}
th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mid-grey);
  background: var(--off-white);
}
/* Header label + (i) share one centre line; a bare inline icon sits below uppercase text. */
.th-in {
  display: inline-flex;
  align-items: center;
}
tr:last-child td {
  border-bottom: 0;
}
td.n,
th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--light-grey);
  color: var(--iris);
  white-space: nowrap;
}
.chip i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.chip.warn {
  background: #ffe9c7;
  color: #8a5300;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stack {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-xl);
  background: var(--white);
  overflow: hidden;
}
.stack-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--light-grey);
}
.stack-row:last-child {
  border-bottom: 0;
}
.stack-row .who {
  font-weight: 600;
  display: flex;
  align-items: center;
}
.stack-row .why {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--mid-grey);
}
.stack-row .amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.stack-row.hl {
  background: var(--pink-soft);
}
.stack-row.zero .amt {
  color: var(--error);
}

.linkish {
  font: inherit;
  font-size: 12px;
  color: var(--iris);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
  align-self: flex-start;
}

.foot {
  margin: 0;
  font-size: 12px;
  color: var(--mid-grey);
}

/* ---------- "i" tooltips ---------- */
.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 5px;
  border-radius: 999px;
  border: 1px solid var(--mid-grey);
  color: var(--mid-grey);
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  cursor: help;
  flex: none;
}
.tip:hover,
.tip:focus-visible {
  border-color: var(--pink);
  color: var(--pink);
  outline: none;
}
/* One floating box, positioned by app.js, so tooltips inside scrolling
   tables and clipped cards are never cut off. */
#tipbox {
  position: fixed;
  z-index: 50;
  max-width: min(280px, calc(100vw - 32px));
  padding: 8px 10px;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: #16121f;
  border: 1px solid var(--light-grey);
  box-shadow: 0 4px 16px #554b6a26;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  white-space: pre-line;
}

@media (prefers-reduced-motion: no-preference) {
  .bar-row .fill {
    transition: width 240ms ease;
  }
}

/* ---------- routes table (Garden Lens style) ---------- */
table.routes td {
  vertical-align: middle;
  padding-block: 10px;
}
table.routes tbody tr:hover td {
  background: var(--off-white);
}
table.routes .idx {
  width: 32px;
  color: var(--mid-grey);
  font-size: 12px;
}
table.routes .strong {
  font-weight: 600;
}
.tokcell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ico {
  position: relative;
  width: 20px;
  height: 20px;
  flex: none;
}
.ico > img,
.ico > .ph {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: block;
  object-fit: cover;
}
.ico .badge {
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--white);
  padding: 1px;
}
.ico .badge img,
.ico .badge .ph {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: block;
  object-fit: cover;
}
.ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--light-grey);
  color: var(--iris);
  font-size: 9px;
  font-weight: 700;
}
.ico .badge .ph {
  font-size: 6px;
}
.tok {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.tok .sym {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
}
.tok .chain {
  font-size: 10px;
  color: var(--mid-grey);
}
.sbs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}
.sb b {
  font-weight: 700;
}
.sb .share {
  color: var(--mid-grey);
  font-weight: 500;
}
.sbs.fees {
  align-items: flex-end;
}
.sbs.fees .sb {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.more {
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pink);
  cursor: help;
  align-self: flex-start;
}
.more-spacer {
  height: 14px;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}
/* Fixed column widths so the fee columns sit next to "Solved by" instead of
   drifting to the far right. Fees read left-aligned, like the names beside them. */
table.routes {
  table-layout: fixed;
  min-width: 960px;
}
table.routes .fee .sbs.fees {
  align-items: flex-start;
}

/* Routes panel header: title left, grouping toggle right. */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.seg.small {
  box-shadow: none;
}
.seg.small button {
  font-size: 12px;
  padding: 6px 12px;
}
table.routes.nofee {
  min-width: 720px;
}
.tok .sym.nocase {
  text-transform: none;
}

table.routes.orders {
  min-width: 1000px;
}
.oid {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--mid-grey);
  cursor: help;
}

/* A section whose title and filters sit above its card, not inside it. */
.block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 4px;
}
.block-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.block-head .sub {
  margin: 4px 0 0;
  color: var(--mid-grey);
  font-size: 13px;
}

/* Footnotes for the starred fee columns. */
table.routes th a.star {
  color: inherit;
  text-decoration: none;
}
table.routes th a.star:hover {
  color: var(--iris);
}
.notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--mid-grey);
  max-width: 80ch;
}
.notes p {
  margin: 0;
}
.notes b {
  color: var(--iris);
  font-weight: 600;
}

/* More air between the page's sections. */
.wrap > .block {
  margin-top: 20px;
}
.wrap > .notes {
  margin-top: 12px;
}

/* Single date-range picker: one button, one calendar. */
.range {
  position: relative;
}
.range-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--iris);
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: 999px;
  padding: 7px 14px;
}
.range-btn:hover {
  border-color: var(--mid-grey);
}
.range-btn[aria-expanded="true"] {
  border-color: var(--pink);
}
.range-btn:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}
.range-btn em {
  font-style: normal;
  font-size: 11px;
  color: var(--mid-grey);
}
.cal {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: 264px;
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 32px rgba(71, 60, 117, 0.16);
  padding: 12px;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--iris);
}
.cal-head button {
  font: inherit;
  font-size: 16px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--iris);
  cursor: pointer;
}
.cal-head button:hover:not(:disabled) {
  background: var(--off-white);
}
.cal-head button:disabled {
  color: var(--light-grey);
  cursor: default;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
}
.cal-grid i {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: var(--mid-grey);
  text-align: center;
  padding-bottom: 4px;
}
.cal-grid button {
  font: inherit;
  font-size: 12px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--iris);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
}
.cal-grid button span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}
.cal-grid button:hover:not(:disabled) span {
  background: var(--off-white);
}
.cal-grid button:disabled {
  color: var(--light-grey);
  cursor: default;
}
/* Band: full cells in the middle, half cells under the two end circles. */
.cal-grid button.in {
  background: #fde4f2;
}
.cal-grid button.in.start {
  background: linear-gradient(to right, transparent 50%, #fde4f2 50%);
}
.cal-grid button.in.stop {
  background: linear-gradient(to left, transparent 50%, #fde4f2 50%);
}
.cal-grid button.in.row-a:not(.start) {
  border-radius: 999px 0 0 999px;
}
.cal-grid button.in.row-z:not(.stop) {
  border-radius: 0 999px 999px 0;
}
.cal-grid button.in.row-a.row-z:not(.start):not(.stop) {
  border-radius: 999px;
}
.cal-grid button.in.start.row-z,
.cal-grid button.in.stop.row-a {
  background: none;
}
.cal-grid button.start span,
.cal-grid button.stop span,
.cal-grid button.start:hover span,
.cal-grid button.stop:hover span {
  background: var(--pink);
  color: var(--white);
  font-weight: 600;
}
.cal-grid button:focus-visible {
  outline: none;
}
.cal-grid button:focus-visible span {
  outline: 2px solid var(--pink);
  outline-offset: 1px;
}
.cal-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--mid-grey);
  text-align: center;
}
table.routes .when {
  font-size: 11px;
  color: var(--mid-grey);
  font-variant-numeric: tabular-nums;
}

/* Orders pagination. */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}
.pager > div {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pager button {
  font: inherit;
  font-size: 12px;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  cursor: pointer;
  color: var(--iris);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.pager button:hover:not(:disabled) {
  background: var(--off-white);
}
.pager button[aria-current="page"] {
  background: var(--pink);
  color: var(--white);
  font-weight: 600;
}
.pager button:disabled {
  color: var(--light-grey);
  cursor: default;
}
.pager button:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 1px;
}
.pager .gap {
  color: var(--mid-grey);
  padding: 0 2px;
}
button.oid {
  background: none;
  border: 0;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 6px;
  cursor: copy;
}
button.oid:hover {
  background: var(--off-white);
  color: var(--iris);
}
button.oid:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 1px;
}
