:root {
  --bg: #110e08;
  --panel: #11110f;
  --ink: #f4f4ef;
  --muted: #96968f;
  --rule: #343431;
  --buy: #ccff00;
  --halt: #ff554d;
  --sans: "Hanken Grotesk", Arial, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  letter-spacing: 0;
}

html,
body {
  width: 100%;
  min-width: 280px;
  min-height: 360px;
  background: transparent;
}

body {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--halt);
  outline-offset: -2px;
}

.widget {
  width: 100%;
  height: 360px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg);
}

.widget > header,
.widget > footer {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 12px;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.widget > header {
  border-bottom: 1px solid var(--rule);
}

.widget > header a {
  color: var(--ink);
  font-weight: 600;
}

.widget > header span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-light {
  width: 7px;
  height: 7px;
  display: block;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--muted);
}

.widget[data-state="on"] .status-light { background: var(--buy); }
.widget[data-state="thin"] .status-light { background: var(--halt); }
.widget[data-state="on"] #stateShort { color: var(--buy); }
.widget[data-state="thin"] #stateShort { color: var(--halt); }

.quote-summary {
  height: 82px;
  display: grid;
  grid-template-columns: minmax(100px, 0.75fr) minmax(0, 1.25fr);
  border-bottom: 1px solid var(--rule);
}

.token-identity,
.best-output {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
}

.token-identity {
  border-right: 1px solid var(--rule);
}

.token-identity span,
.best-output span,
.best-output small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.token-identity strong {
  margin-top: 3px;
  overflow: hidden;
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.best-output strong {
  margin-block: 3px 1px;
  overflow: hidden;
  color: var(--buy);
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget[data-state="thin"] .best-output strong { color: var(--halt); }
.widget[data-state="unknown"] .best-output strong { color: var(--muted); }

.amounts {
  height: 36px;
  display: grid;
  grid-template-columns: 48px repeat(4, 52px) 1fr;
  align-items: stretch;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}

.amounts > span {
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-size: 8px;
}

.amounts button {
  border-left: 1px solid var(--rule);
  font-size: 9px;
}

.amounts button:hover,
.amounts button.active {
  background: var(--buy);
  color: #110e08;
}

.amounts .read-only {
  justify-content: flex-end;
  padding-right: 12px;
}

.route-list {
  height: 174px;
}

.route-list-head,
.embed-route {
  display: grid;
  grid-template-columns: minmax(115px, 1.4fr) 48px 55px minmax(85px, 1fr) 30px;
  align-items: center;
}

.route-list-head {
  height: 25px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 7px;
}

.route-list-head > *,
.embed-route > * {
  min-width: 0;
  padding-inline: 8px;
}

.embed-route {
  height: 42px;
  border-bottom: 1px solid var(--rule);
}

.embed-route:last-child { border-bottom: 0; }
.embed-route:hover { background: var(--panel); }
.embed-route strong,
.embed-route small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-route strong { font-family: var(--sans); font-size: 10px; }
.embed-route small { margin-top: 2px; color: var(--muted); font-size: 7px; text-transform: uppercase; }
.embed-route .number { font-family: var(--sans); font-size: 10px; font-weight: 700; text-align: right; }
.embed-route a { width: 25px; height: 25px; display: grid; place-items: center; border-left: 1px solid var(--rule); font-size: 13px; }
.embed-route a:hover { color: var(--buy); }

.loading {
  height: 148px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.widget > footer {
  height: 34px;
  border-top: 1px solid var(--rule);
}

.widget > footer a {
  color: var(--ink);
  font-weight: 600;
}

.widget > footer a:hover { color: var(--buy); }

body.theme-light {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #110e08;
  --muted: #65655f;
  --rule: #c7c7bf;
}

body.theme-light .amounts button:hover,
body.theme-light .amounts button.active { color: #110e08; }

@media (max-width: 400px) {
  .amounts { grid-template-columns: repeat(4, 1fr); }
  .amounts > span { display: none; }
  .route-list-head,
  .embed-route { grid-template-columns: minmax(105px, 1.35fr) 42px 50px minmax(74px, 1fr) 28px; }
  .route-list-head > *,
  .embed-route > * { padding-inline: 5px; }
  .widget > footer span { display: none; }
  .widget > footer { justify-content: flex-end; }
}
