/* Touch: parimutuel one-touch markets ------------------------------------
   Signature elements are the price track (live marker → target marker) and
   the YES/NO pot bar. Direction colour is carried by --touch-direction; YES
   is always accent green and NO is always coral. */

:root {
  --touch-yes: var(--color-accent);
  --touch-yes-soft: var(--color-accent-soft);
  --touch-yes-border: var(--color-border-accent);
  --touch-no: var(--color-error);
  --touch-no-soft: var(--color-error-soft);
  --touch-no-border: var(--color-error-border);
  --touch-track-block-size: 6.5rem;
  --touch-track-compact-block-size: 5.25rem;
}

/* Page header ------------------------------------------------------------ */

.touch-page__header p:last-child {
  max-inline-size: var(--layout-readable-max);
  color: var(--color-text-muted);
}

.touch-observed {
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Hero strip -------------------------------------------------------------- */

.touch-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 0.5fr) auto;
  align-items: center;
  gap: var(--space-6);
  margin-block-end: var(--space-6);
  padding: var(--space-5) var(--space-6);
  border: var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-panel);
  box-shadow: var(--shadow-sm);
}

.touch-strip--loading {
  display: block;
}

.touch-strip__asset {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-inline-size: 0;
}

.touch-strip__asset h2 {
  margin: var(--space-0);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.touch-strip__asset .eyebrow {
  margin-block-end: var(--space-1);
}

.touch-strip__mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: var(--space-12);
  block-size: var(--space-12);
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
  color: var(--color-on-accent);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

.touch-strip__price,
.touch-strip__stat {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 0;
}

.touch-strip__label {
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.touch-strip__price strong {
  color: var(--color-live);
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-none);
}

.touch-strip__stat strong {
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.touch-strip__live {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.touch-strip__live .status-dot {
  background: var(--color-live);
  animation: touch-pulse var(--duration-pulse) var(--ease-in-out) infinite;
}

.touch-strip__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
}

.touch-strip__feed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  gap: var(--space-3) var(--space-6);
  padding-block-start: var(--space-4);
  border-block-start: var(--border-default);
}

/* Live feed: price flash, change chips, DexScreener stats --------------- */

.touch-live {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  padding: var(--space-4) var(--space-6);
  border: var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-card);
}

.touch-live__price {
  display: grid;
  flex: 0 1 auto;
  gap: var(--space-1);
  min-inline-size: 0;
  max-inline-size: 20rem;
}

.touch-live > .touch-live__changes {
  flex: 1 1 18rem;
}

.touch-live > .touch-live__stats {
  flex: 0 0 auto;
}

.touch-live__tag {
  display: inline-block;
  margin-inline-start: var(--space-1);
  padding: var(--space-0-5) var(--space-1-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: var(--text-3xs);
  letter-spacing: var(--tracking-caps);
  vertical-align: middle;
}

.touch-live__tag[hidden] {
  display: none;
}

.touch-live__value {
  display: inline-block;
  inline-size: fit-content;
  margin-inline: calc(-1 * var(--space-1-5));
  padding-inline: var(--space-1-5);
  border-radius: var(--radius-sm);
  color: var(--color-live);
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-none);
}

.touch-live__value[data-tick="up"] {
  animation: touch-flash-up var(--duration-slower) var(--ease-out);
}

.touch-live__value[data-tick="down"] {
  animation: touch-flash-down var(--duration-slower) var(--ease-out);
}

[data-touch-live][data-feed="stale"] .touch-strip__live .status-dot,
[data-touch-live][data-feed="error"] .touch-strip__live .status-dot {
  background: var(--color-warning);
  animation: none;
}

[data-touch-live][data-feed="loading"] .touch-strip__live .status-dot {
  background: var(--color-text-disabled);
}

.touch-live__changes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-0);
  padding: var(--space-0);
  list-style: none;
}

.touch-chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1-5);
  padding: var(--space-1) var(--space-2-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  transition: var(--transition-colors);
}

.touch-chip__label {
  color: var(--color-text-subtle);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.touch-chip__value {
  color: var(--color-text-secondary);
  font-weight: var(--weight-semibold);
}

.touch-chip[data-tone="up"] {
  border-color: var(--color-success-border);
  background: var(--color-success-soft);
}

.touch-chip[data-tone="up"] .touch-chip__value {
  color: var(--color-success);
}

.touch-chip[data-tone="down"] {
  border-color: var(--color-error-border);
  background: var(--color-error-soft);
}

.touch-chip[data-tone="down"] .touch-chip__value {
  color: var(--color-error);
}

.touch-live__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-0);
}

.touch-live__stats > div {
  display: grid;
  gap: var(--space-0-5);
}

.touch-live__stats dt {
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.touch-live__stats dd {
  margin: var(--space-0);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
}

/* Chart (see chart.css) ----------------------------------------------------- */

.touch-detail__chart {
  min-inline-size: 0;
}

/* Market grid ------------------------------------------------------------- */

.touch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: var(--layout-card-gap);
}

.touch-card {
  display: grid;
  gap: var(--space-4);
  min-inline-size: 0;
  padding: var(--space-5);
  border: var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-colors);
}

@media (hover: hover) {
  .touch-card:hover {
    border-color: var(--color-border-strong);
    background: var(--surface-card-hover);
  }
}

.touch-card--loading {
  min-block-size: 22rem;
}

.touch-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.touch-card__title {
  margin: var(--space-0);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-snug);
  line-height: var(--leading-tight);
}

.touch-card__title a {
  color: var(--color-text);
  text-decoration: none;
}

.touch-card__title a:hover {
  color: var(--color-accent);
}

.touch-card__question {
  margin: var(--space-0);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.touch-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block-start: var(--space-3);
  border-block-start: var(--border-subtle);
}

.touch-card__cta {
  flex: none;
}

/* Status pill and meta ---------------------------------------------------- */

.touch-status {
  flex: none;
}

.touch-status[data-status="live"] .status-dot {
  background: var(--color-live);
  animation: touch-pulse var(--duration-pulse) var(--ease-in-out) infinite;
}

.touch-status[data-status="halted"] {
  border-color: var(--touch-no-border);
  background: var(--touch-no-soft);
  color: var(--touch-no);
}

.touch-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
}

.touch-bonus,
.touch-countdown {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  min-block-size: var(--space-7);
  padding-inline: var(--space-2-5);
  border: var(--border-subtle);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.touch-bonus {
  border-color: var(--color-warning-border);
  background: var(--color-warning-soft);
  color: var(--color-warning);
  font-weight: var(--weight-semibold);
}

.touch-countdown {
  background: var(--color-bg-raised);
  color: var(--color-text-secondary);
}

.touch-countdown[data-state="closed"] {
  color: var(--color-text-muted);
}

/* Price track -------------------------------------------------------------- */

.touch-track {
  --now: 20%;
  --target: 70%;
  --from: 20%;
  --to: 50%;
  --touch-direction: var(--touch-yes);
  --touch-direction-soft: var(--touch-yes-soft);
  position: relative;
  min-inline-size: 0;
  block-size: var(--touch-track-block-size);
  margin-inline: var(--space-2);
}

.touch-track--compact {
  block-size: var(--touch-track-compact-block-size);
}

.touch-track[data-direction="down"] {
  --touch-direction: var(--touch-no);
  --touch-direction-soft: var(--touch-no-soft);
}

.touch-track__rail {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 50%;
  block-size: var(--space-1-5);
  border-radius: var(--radius-pill);
  background: var(--color-surface-high);
  box-shadow: var(--edge-specular-sunken);
  transform: translateY(-50%);
}

.touch-track__span {
  position: absolute;
  inset-inline-start: var(--from);
  inset-block-start: 50%;
  inline-size: var(--to);
  block-size: var(--space-1-5);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--touch-direction-soft), var(--touch-direction));
  transform: translateY(-50%);
  transition: inset-inline-start var(--duration-slower) var(--ease-out), inline-size var(--duration-slower) var(--ease-out);
}

.touch-track[data-direction="down"] .touch-track__span {
  background: linear-gradient(90deg, var(--touch-direction), var(--touch-direction-soft));
}

.touch-track__marker {
  position: absolute;
  inset-block: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  inline-size: 0;
  transition: inset-inline-start var(--duration-slower) var(--ease-out);
}

.touch-track__marker--now {
  inset-inline-start: var(--now);
  z-index: 2;
}

.touch-track__marker--target {
  inset-inline-start: var(--target);
  z-index: 1;
}

.touch-track__dot {
  inline-size: var(--space-4);
  block-size: var(--space-4);
  border: var(--border-width-strong) solid var(--color-bg);
  border-radius: var(--radius-pill);
  background: var(--color-live);
  box-shadow: 0 0 0 var(--border-width) var(--color-live), 0 0 0 var(--space-1-5) var(--color-accent-softer);
  animation: touch-pulse var(--duration-pulse) var(--ease-in-out) infinite;
}

.touch-track__flag {
  display: grid;
  place-items: center;
  inline-size: var(--space-5);
  block-size: var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--touch-direction);
  color: var(--color-on-accent);
}

.touch-track[data-direction="down"] .touch-track__flag svg {
  transform: scaleY(-1);
}

.touch-track[data-touched="true"] .touch-track__flag {
  animation: touch-pop var(--duration-pulse) var(--ease-in-out) infinite;
}

.touch-track__label {
  position: absolute;
  display: grid;
  gap: var(--space-0-5);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-snug);
}

.touch-track__label strong {
  color: var(--color-text);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-snug);
}

.touch-track__label small {
  color: var(--color-text-subtle);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.touch-track__marker--now .touch-track__label {
  inset-block-start: calc(50% + var(--space-4));
}

.touch-track__marker--now .touch-track__label strong {
  color: var(--color-live);
}

.touch-track__marker--target .touch-track__label {
  inset-block-end: calc(50% + var(--space-4));
}

.touch-track__marker--target .touch-track__label strong {
  color: var(--touch-direction);
}

.touch-track__marker[data-align="center"] .touch-track__label {
  justify-items: center;
  text-align: center;
}

.touch-track__marker[data-align="start"] .touch-track__label {
  inset-inline-start: calc(var(--space-2) * -1);
  justify-items: start;
  text-align: start;
}

.touch-track__marker[data-align="end"] .touch-track__label {
  inset-inline-end: calc(var(--space-2) * -1);
  justify-items: end;
  text-align: end;
}

.touch-detail__track .touch-track__label strong {
  font-size: var(--text-2xl);
}

.touch-detail__track .touch-track__label small {
  font-size: var(--text-xs);
}

/* Pot bar ------------------------------------------------------------------- */

.touch-pot {
  --yes: 50%;
  display: grid;
  gap: var(--space-2);
  min-inline-size: 0;
}

.touch-pot__bar {
  display: flex;
  overflow: hidden;
  block-size: var(--space-2-5);
  border-radius: var(--radius-pill);
  background: var(--color-surface-high);
  box-shadow: var(--edge-specular-sunken);
}

.touch-pot__yes,
.touch-pot__no {
  display: block;
  block-size: 100%;
  transition: inline-size var(--duration-slower) var(--ease-out);
}

.touch-pot__yes {
  inline-size: var(--yes);
  background: var(--touch-yes);
}

.touch-pot__no {
  inline-size: calc(100% - var(--yes));
  background: var(--touch-no);
}

.touch-pot[data-empty="true"] .touch-pot__yes,
.touch-pot[data-empty="true"] .touch-pot__no {
  opacity: 0.22;
}

.touch-pot__legend {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.touch-pot__side {
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.touch-pot__side b {
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
}

.touch-pot__side--yes b {
  color: var(--touch-yes);
}

.touch-pot__side--no b {
  color: var(--touch-no);
}

.touch-pot__total {
  color: var(--color-text-subtle);
  text-align: center;
}

/* Implied multiples ------------------------------------------------------- */

.touch-odds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.touch-odds__side {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-well);
}

.touch-odds__side--yes {
  border-color: var(--touch-yes-border);
}

.touch-odds__side--no {
  border-color: var(--touch-no-border);
}

.touch-odds__label {
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.touch-odds__value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-none);
}

.touch-odds__side--yes .touch-odds__value {
  color: var(--touch-yes);
}

.touch-odds__side--no .touch-odds__value {
  color: var(--touch-no);
}

/* Detail ----------------------------------------------------------------- */

.touch-detail .detail-main {
  display: block;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  border-inline-end: var(--border-default);
}

.touch-detail__inner,
.touch-detail__loading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5);
  inline-size: 100%;
  max-inline-size: none;
  padding: var(--space-5) var(--space-6) var(--space-12);
}

.touch-detail__inner > :not(.touch-detail__track):not(.touch-detail__pool),
.touch-detail__loading > * {
  grid-column: 1 / -1;
}

.touch-detail__track,
.touch-detail__pool {
  min-inline-size: 0;
}

@media (max-width: 90rem) {
  .touch-detail__inner > .touch-detail__track,
  .touch-detail__inner > .touch-detail__pool {
    grid-column: 1 / -1;
  }
}

.touch-detail__crumbs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.touch-detail__crumbs a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  color: var(--color-text-secondary);
  text-decoration: none;
}

.touch-detail__crumbs a:hover {
  color: var(--color-accent);
}

.touch-detail__contract {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.touch-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
}

.touch-detail__title {
  margin: var(--space-0);
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

.touch-detail__question {
  max-inline-size: var(--layout-readable-max);
  margin: var(--space-3) var(--space-0) var(--space-0);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

.touch-detail__badges {
  display: grid;
  justify-items: end;
  flex: none;
  gap: var(--space-2);
}

.touch-detail__track {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border: var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-panel);
  box-shadow: var(--shadow-sm);
}

.touch-detail__pool {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
  border: var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-card);
}

.touch-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: var(--space-4) var(--space-2);
}

.touch-activity {
  display: grid;
  gap: var(--space-4);
}

.touch-activity__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.touch-activity__header h3 {
  margin: var(--space-0);
  font-size: var(--text-lg);
}

.touch-activity__list {
  display: grid;
  margin: var(--space-0);
  padding: var(--space-0);
  border: var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  list-style: none;
}

.touch-activity__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-block-end: var(--border-subtle);
  font-size: var(--text-sm);
}

.touch-activity__row:last-child {
  border-block-end: 0;
}

.touch-activity__what {
  min-inline-size: 0;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.touch-activity__shares {
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
}

.touch-activity__who a,
.touch-activity__when a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-decoration: none;
}

.touch-activity__who a:hover,
.touch-activity__when a:hover {
  color: var(--color-accent);
}

.touch-activity__when {
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.touch-activity__empty {
  margin: var(--space-0);
  padding: var(--space-5);
  border: var(--border-subtle);
  border-radius: var(--radius-card);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Side tags: YES/NO semantics anywhere in text ----------------------------- */

.touch-side-tag {
  display: inline-block;
  padding: var(--space-0-5) var(--space-1-5);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  line-height: var(--leading-snug);
  vertical-align: middle;
}

.touch-side-tag--yes {
  background: var(--touch-yes-soft);
  color: var(--touch-yes);
}

.touch-side-tag--no {
  background: var(--touch-no-soft);
  color: var(--touch-no);
}

/* Trade rail --------------------------------------------------------------- */

.touch-panel__hint {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.touch-utility .field-message[data-tone="printed"] {
  color: var(--color-accent);
  font-weight: var(--weight-semibold);
}

.touch-side-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.touch-side-tab {
  flex-direction: column;
  gap: var(--space-0-5);
  min-block-size: var(--size-control-md);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
}

.touch-side-tab small {
  color: var(--color-text-subtle);
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-normal);
  text-transform: none;
}

.touch-side-tab--yes.is-active {
  border-color: var(--touch-yes-border);
  background: var(--touch-yes-soft);
  color: var(--touch-yes);
}

.touch-side-tab--no.is-active {
  border-color: var(--touch-no-border);
  background: var(--touch-no-soft);
  color: var(--touch-no);
}

.touch-side-tab.is-active small {
  color: inherit;
  opacity: var(--opacity-muted);
}

.touch-wallet-note {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
  margin: var(--space-4) var(--space-5) var(--space-0);
  padding: var(--space-4);
  border: var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-well);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.touch-wallet-note[data-status="wrong-chain"] {
  border-color: var(--color-warning-border);
  background: var(--color-warning-soft);
}

.touch-wallet-note p {
  margin: var(--space-0);
}

.touch-wallet-note .is-error {
  color: var(--color-error);
}

.touch-chips {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.touch-preview {
  padding-block-start: var(--space-2);
  border-block-start: var(--border-subtle);
}

.touch-preview__multiple {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.touch-panel[data-side="yes"] .touch-preview__multiple {
  color: var(--touch-yes);
}

.touch-panel[data-side="no"] .touch-preview__multiple {
  color: var(--touch-no);
}

.touch-panel .trade-status {
  margin: var(--space-0) var(--space-5) var(--space-4);
}

.touch-panel .review-row {
  flex-wrap: wrap;
}

.touch-panel .review-row dd {
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow-wrap: anywhere;
}

.touch-position,
.touch-utility {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border-block-start: var(--border-subtle);
}

.touch-position__rows .review-row dd span {
  display: block;
}

.touch-position__claimable {
  color: var(--color-accent);
  font-weight: var(--weight-semibold);
}

.touch-position__empty {
  margin: var(--space-0);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.touch-position__empty.is-error {
  color: var(--color-error);
}

.touch-utility__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.touch-utility__row .button {
  flex: 1 1 10rem;
  padding-inline: var(--space-3);
  white-space: normal;
}

.touch-utility .trade-status {
  margin: var(--space-0);
}

/* Motion ---------------------------------------------------------------- */

@keyframes touch-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.55;
  }
}

@keyframes touch-pop {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.25);
  }
}

@keyframes touch-flash-up {
  0% {
    background: var(--color-success-soft);
    color: var(--color-success);
  }

  100% {
    background: transparent;
  }
}

@keyframes touch-flash-down {
  0% {
    background: var(--color-error-soft);
    color: var(--color-error);
  }

  100% {
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .touch-track__span,
  .touch-track__marker,
  .touch-pot__yes,
  .touch-pot__no {
    transition: none;
  }

  .touch-track__dot,
  .touch-track__flag,
  .touch-strip__live .status-dot,
  .touch-status .status-dot,
  .touch-live__value {
    animation: none;
  }
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 64rem) {
  .touch-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .touch-strip__asset {
    grid-column: 1 / -1;
  }

  .touch-strip__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .touch-detail .detail-main {
    overflow: visible;
    border-inline-end: 0;
    border-block-end: var(--border-default);
  }
}

@media (max-width: 40rem) {
  .touch-page__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .touch-strip {
    gap: var(--space-4);
    padding: var(--space-4);
  }

  .touch-strip__price strong {
    font-size: var(--text-2xl);
  }

  .touch-strip__actions .button {
    flex: 1 1 100%;
  }

  .touch-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .touch-card {
    padding: var(--space-4);
  }

  .touch-detail__inner,
  .touch-detail__loading {
    padding: var(--space-4) var(--space-4) var(--space-8);
  }

  .touch-detail__header {
    flex-direction: column;
  }

  .touch-detail__badges {
    justify-items: start;
  }

  .touch-detail__title {
    font-size: var(--text-3xl);
  }

  .touch-detail__track {
    padding-inline: var(--space-3);
  }

  .touch-detail__track .touch-track__label strong {
    font-size: var(--text-lg);
  }

  .touch-odds__value {
    font-size: var(--text-2xl);
  }

  .touch-activity__row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }

  .touch-card__footer {
    flex-wrap: wrap;
  }

  .touch-card__cta {
    flex: 1 1 100%;
  }
}

@media (max-width: 40rem) {
  .touch-live {
    padding: var(--space-4);
  }

  .touch-live > .touch-live__changes,
  .touch-live > .touch-live__stats {
    flex: 1 1 100%;
  }

  .touch-live__value {
    font-size: var(--text-2xl);
  }
}
