.eth-trust-visual {
  --eth-bg: #fffdf9;
  --eth-panel: #f6f1ff;
  --eth-ink: #20201d;
  --eth-muted: #615e6d;
  --eth-border: #ded4f7;
  --eth-soft-border: #ece5fb;
  --eth-personal: #00d084;
  --eth-stranger: #8b8982;
  --eth-institution: #ffb000;
  --eth-capture: #ff3366;
  --eth-protocol: #635bff;
  --eth-protocol-alt: #00c8ff;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 2rem 0;
  border: 1px solid var(--eth-border);
  border-radius: 8px;
  background: var(--eth-bg);
  color: var(--eth-ink);
  overflow: clip;
}

[data-theme="dark"] .eth-trust-visual {
  --eth-bg: #111016;
  --eth-panel: #191625;
  --eth-ink: #efeee8;
  --eth-muted: #b9b4c9;
  --eth-border: #38304f;
  --eth-soft-border: #29233b;
  --eth-personal: #20f0a4;
  --eth-stranger: #78756c;
  --eth-institution: #ffc247;
  --eth-capture: #ff4d7d;
  --eth-protocol: #8378ff;
  --eth-protocol-alt: #24d7ff;
}

.eth-trust-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 185px);
  gap: 0.75rem;
  align-items: end;
  padding: 0.85rem 0.9rem 0.65rem;
  border-bottom: 1px solid var(--eth-soft-border);
}

.eth-trust-eyebrow {
  margin: 0 0 0.2rem;
  color: var(--eth-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eth-trust-title {
  margin: 0;
  color: var(--eth-ink);
  font-size: clamp(1.05rem, 1.45vw, 1.3rem);
  line-height: 1.16;
}

.eth-phase-readout {
  display: grid;
  gap: 0.1rem;
  justify-items: end;
  min-height: 2.45rem;
  color: var(--eth-muted);
  text-align: right;
}

.eth-phase-readout span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eth-phase-readout strong {
  color: var(--eth-ink);
  font-size: 0.88rem;
  line-height: 1.2;
}

.eth-canvas-frame {
  position: relative;
  background:
    radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--eth-protocol-alt) 8%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--eth-panel) 56%, transparent), transparent 58%);
}

.eth-graph-canvas {
  display: block;
  width: 100%;
  height: clamp(280px, 38vw, 350px);
}

.eth-caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.75rem;
  display: grid;
  grid-template-columns: minmax(125px, 0.3fr) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.6rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--eth-border) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--eth-bg) 92%, transparent);
  box-shadow: 0 14px 30px color-mix(in srgb, #000 10%, transparent);
  backdrop-filter: blur(8px);
}

.eth-caption strong {
  color: var(--eth-ink);
  font-size: 0.84rem;
  line-height: 1.22;
}

.eth-caption span {
  color: var(--eth-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.eth-controls {
  display: grid;
  grid-template-columns: 34px minmax(140px, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.9rem 0.8rem;
  border-top: 1px solid var(--eth-soft-border);
}

.eth-play {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid var(--eth-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--eth-bg) 82%, var(--eth-protocol) 6%);
  color: var(--eth-ink);
  cursor: pointer;
}

.eth-play:focus-visible,
.eth-stage-button:focus-visible,
.eth-slider:focus-visible {
  outline: 2px solid var(--eth-protocol);
  outline-offset: 3px;
}

.eth-play-icon {
  position: absolute;
  inset: 0;
  display: block;
}

.eth-play-icon::before,
.eth-play-icon::after {
  position: absolute;
  content: "";
  top: 9px;
  bottom: 9px;
  background: currentColor;
  transition: transform 0.18s ease, width 0.18s ease, left 0.18s ease, clip-path 0.18s ease;
}

.eth-play[data-playing="true"] .eth-play-icon::before {
  left: 10px;
  width: 4px;
}

.eth-play[data-playing="true"] .eth-play-icon::after {
  left: 18px;
  width: 4px;
}

.eth-play[data-playing="false"] .eth-play-icon::before {
  left: 12px;
  width: 12px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.eth-play[data-playing="false"] .eth-play-icon::after {
  left: 12px;
  width: 0;
}

.eth-slider-wrap {
  display: grid;
  gap: 0.5rem;
}

.eth-slider {
  width: 100%;
  min-height: 22px;
  accent-color: var(--eth-protocol);
  cursor: pointer;
}

.eth-stage-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.28rem;
}

.eth-stage-button {
  min-width: 0;
  min-height: 29px;
  padding: 0.28rem 0.35rem;
  border: 1px solid var(--eth-border);
  border-radius: 8px;
  background: var(--eth-bg);
  color: var(--eth-muted);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.1;
  cursor: pointer;
}

.eth-stage-button[aria-pressed="true"] {
  border-color: var(--eth-protocol);
  background: color-mix(in srgb, var(--eth-protocol) 16%, var(--eth-bg));
  color: var(--eth-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--eth-protocol-alt) 28%, transparent);
}

.eth-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .eth-trust-visual {
    width: 100%;
    max-width: 100%;
    margin-top: 1.7rem;
    margin-bottom: 1.7rem;
  }

  .eth-trust-head {
    grid-template-columns: 1fr;
  }

  .eth-phase-readout {
    justify-items: start;
    min-height: 0;
    text-align: left;
  }

  .eth-graph-canvas {
    height: 350px;
  }

  .eth-caption {
    position: static;
    grid-template-columns: 1fr;
    margin: 0 0.6rem 0.65rem;
  }

  .eth-controls {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 0.65rem;
  }

  .eth-stage-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .eth-play-icon::before,
  .eth-play-icon::after {
    transition: none;
  }
}
