.entity-tracker,
.entity-block-page {
  --entity-panel: #0c151d;
  --entity-border: color-mix(in srgb, var(--surface-b, #58b9e1) 15%, #283a48);
  --entity-muted: #a7b6c6;
  --entity-in: #79ccc3;
  --entity-out: #f19cae;
  --entity-gold: #eed29b;
  --entity-control: #111d28;
  --entity-selected: linear-gradient(115deg,
    color-mix(in srgb, var(--site-glow-left-color, #775cce) 42%, #142035),
    color-mix(in srgb, var(--site-glow-accent-color, #58b9e1) 30%, #142035),
    color-mix(in srgb, var(--site-glow-right-color, #ffa690) 22%, #142035));
}

body[data-network-appearance='entity-x'] > .site-ambience {
  opacity: max(.16, var(--entity-glow-opacity, 0));
}

body[data-network-appearance='entity-x']:not([data-entity-ambient='on']) > .site-ambience {
  display: none;
}

.entity-tracker {
  width: min(1120px, calc(100% - 48px));
  padding-block: clamp(32px, 5vw, 68px);
  color: #eef4fa;
}

.entity-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.entity-title h1 {
  margin: 0;
  font: 500 clamp(2.4rem, 5.6vw, 4.1rem)/1.05 var(--font);
  letter-spacing: -.055em;
}

.entity-mark {
  display: grid;
  place-items: center;
  width: clamp(44px, 7vw, 58px);
  aspect-ratio: 1;
  background: #171a20;
  border: 1px solid #827253;
  border-radius: 10px;
  color: var(--entity-gold);
  font: 500 1.35rem var(--font);
}

.entity-description,
.entity-status,
.entity-coverage,
.entity-chart-summary {
  color: var(--entity-muted);
}

.entity-description {
  margin: 11px 0 0;
}

.entity-status {
  min-height: 1.5em;
  margin: 1px 0 12px;
  font-size: .88rem;
}

.entity-panel {
  background: var(--entity-panel);
  border: 1px solid var(--entity-border);
  border-radius: 13px;
  min-width: 0;
  padding: clamp(15px, 2.5vw, 22px);
}

.entity-panel h2 {
  margin: 0;
  font: 500 1.25rem/1.26 var(--font);
  letter-spacing: -.025em;
}

.entity-balance {
  background: linear-gradient(132deg, #121b2c, #0b151e 72%);
}

.entity-balance h2 {
  color: var(--entity-muted);
  font: 500 .9rem var(--font);
}

.entity-balance-number {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  align-items: baseline;
  margin: 5px 0;
  font-variant-numeric: tabular-nums;
}

.entity-balance-number strong {
  font: 500 clamp(2.05rem, 6vw, 3.2rem)/1.13 var(--font);
  letter-spacing: -.04em;
}

.entity-balance-number span {
  color: var(--entity-muted);
  font-size: .89rem;
}

.entity-balance-meta,
.entity-end {
  display: flex;
  gap: 12px 20px;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
}

.entity-balance-meta {
  align-items: center;
  font-size: .92rem;
}

.entity-balance-meta > p {
  margin: 0;
  color: var(--entity-in);
}

.entity-balance-meta a,
.entity-end details a {
  text-decoration: underline;
  text-underline-offset: .23em;
}

.entity-highlight:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 15px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid #62543a;
  border-inline-start: 3px solid var(--entity-gold);
  border-radius: 13px;
  background: #191915;
}

.entity-highlight-copy {
  flex: 1 1 22rem;
  min-width: 0;
}

.entity-highlight-kicker {
  margin: 0 0 5px;
  color: var(--entity-gold);
  font-size: .86rem;
  font-weight: 700;
}

.entity-highlight .entity-highlight-title {
  margin: 0;
  color: #fff8df;
  font: 500 clamp(1.35rem, 3.5vw, 2.05rem)/1.18 var(--font);
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}

.entity-highlight-context,
.entity-highlight-comparison {
  margin: 6px 0 0;
  color: #c4c0b4;
  font-size: .9rem;
  line-height: 1.5;
}

.entity-highlight-actions:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.entity-highlight-transfer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 6px 11px;
  border: 1px solid #63563e;
  border-radius: 7px;
  background: #242117;
  color: var(--entity-gold);
  font: inherit;
  font-size: .86rem;
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.entity-highlight-transfer:hover {
  border-color: var(--entity-gold);
  background: #30291a;
  color: #fff8df;
}

.entity-highlight-transfer:focus-visible {
  outline: 2px solid var(--entity-gold);
  outline-offset: 2px;
}

.entity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr);
  align-items: start;
  gap: 16px;
  margin-top: 15px;
}

.entity-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 13px 0 0;
}

.entity-options button {
  min-height: 40px;
  padding: 4px 10px;
  border: 1px solid #263746;
  border-radius: 8px;
  background: var(--entity-control);
  color: #b4c3d3;
  line-height: 1.2;
  font-size: .86rem;
  white-space: nowrap;
}

.entity-options button:enabled:hover,
.entity-options button[aria-pressed="true"]:enabled {
  background: var(--entity-selected);
  border-color: #697db3;
  color: #f0f3ff;
}

.entity-options button:disabled {
  opacity: .6;
  cursor: default;
}

.entity-modes {
  margin-top: 8px;
}

.entity-graph {
  position: relative;
  height: clamp(197px, 27vw, 320px);
  margin: 11px 0 9px;
  background: #05080e;
  border: 1px solid #253345;
  border-radius: 8px;
}

.entity-graph canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.entity-graph-marker:not([hidden]) {
  position: absolute;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 1px solid var(--entity-gold);
  border-radius: 50%;
  background: #242117;
  color: #fff8df;
  font: 600 .85rem/1 var(--font);
  cursor: pointer;
}

.entity-graph-marker:hover {
  background: #41351e;
}

.entity-graph-marker:focus-visible {
  outline: 2px solid #fff8df;
  outline-offset: 2px;
}

.entity-coverage,
.entity-chart-summary {
  margin: 4px 0 0;
  font-size: .85rem;
  line-height: 1.55;
}

.entity-chart-summary {
  color: #c6d4e3;
}

.entity-transfers {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}

.entity-transfers li + li {
  border-top: 1px solid #263643;
}

.entity-transfer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  text-align: left;
  min-height: 50px;
  width: 100%;
  gap: 9px;
  padding: 8px 0;
  font-size: .89rem;
  text-decoration: none;
  overflow-wrap: anywhere;
  scroll-margin-top: 85px;
}

.entity-transfer:hover {
  background: #14232d;
}

.entity-transfer[aria-current="true"] {
  background: #152431;
  box-shadow: inset 2px 0 #e7cd92;
  padding-inline: 9px;
}

.entity-linked-status {
  margin: 10px 0;
  color: var(--entity-muted);
  font-size: .89rem;
}

.entity-linked-status p {
  margin: 0 0 4px;
}

.entity-linked-status a,
.entity-label-source a {
  text-decoration: underline;
  text-underline-offset: .23em;
}

.entity-transfer-direction {
  font-weight: 700;
}

.entity-transfer small {
  display: block;
  color: var(--entity-muted);
  font-size: .75rem;
  line-height: 1.32;
}

.entity-transfer > strong {
  color: var(--entity-in);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.entity-transfer[data-outgoing] > strong {
  color: var(--entity-out);
}

.entity-transfer[data-self-transfer] > strong {
  color: var(--entity-muted);
}

.entity-end {
  margin-top: 18px;
}

.entity-end > p {
  margin: 0;
  color: var(--entity-muted);
  font-size: .91rem;
}

.entity-end > .button,
.entity-detail .button {
  background: var(--ui-fill, #303459);
  border-color: var(--ui-border, #536480);
  color: #f0f3ff;
  border-radius: 8px;
  min-height: 42px;
}

.entity-end details {
  flex: 1;
  min-width: min(100%, 210px);
  font-size: .91rem;
  color: var(--entity-muted);
}

.entity-end summary {
  cursor: pointer;
}

.entity-end details[open] {
  flex-basis: 100%;
}

.entity-detail {
  --entity-muted: #a7b6c6;
  max-width: min(calc(100vw - 28px), 540px);
  overflow-wrap: anywhere;
}

.entity-detail .close {
  margin-left: .5em;
}

.entity-detail h2 {
  font: 500 1.6rem/1.2 var(--font);
}

.entity-detail p {
  margin: 8px 0;
  color: var(--entity-muted);
}

.entity-detail code {
  display: block;
  font-size: .82rem;
}

.entity-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.entity-detail .entity-label-source {
  font-size: .89rem;
}

.entity-permalink:not([hidden]) {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #536480;
  border-radius: 6px;
  background: #101923;
  color: #eef4fa;
}

@media (max-width: 780px) {
  .entity-tracker { width: min(100% - 32px, 540px); }
  .entity-layout { grid-template-columns: 1fr; gap: 13px; }
  .entity-ranges { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .entity-ranges button { grid-column: span 2; padding-inline: 3px; }
  .entity-ranges button[data-entity-range="all"] { grid-column: span 4; }
  .entity-graph { height: 200px; }
}
