/**
 * Wepod V-Club coin calculator (ADR-0213).
 * Uses the semantic palette/typography roles, so body.__dm switches it automatically.
 */

.wepod-coin {
  --wc-border: color-mix(in srgb, var(--rade-color-text) 12%, transparent);
  --wc-tile: color-mix(in srgb, var(--rade-color-text) 4%, var(--rade-color-surface));
  --wc-radius: 16px;
  direction: rtl;
  text-align: right;
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--wc-border);
  border-radius: 20px;
  background: var(--rade-color-surface);
  color: var(--rade-color-text);
  font-size: var(--rade-text-body-size);
  line-height: var(--rade-text-body-line);
  box-sizing: border-box;
}

.wepod-coin.wepod-coin *,
.wepod-coin.wepod-coin *::before,
.wepod-coin.wepod-coin *::after {
  box-sizing: border-box;
}

/* Inside .rade-prose (service descriptions) prose sizes/rhythm apply to
   p/li/td; text blocks are divs, and this resets the rest. */
.wepod-coin.wepod-coin :where(p, ul, ol, li, td, th) {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.wepod-coin.wepod-coin [hidden] {
  display: none !important;
}

.wepod-coin .wepod-coin__header {
  margin-bottom: 16px;
}

.wepod-coin .wepod-coin__title {
  font-size: var(--rade-text-h4-size);
  line-height: var(--rade-text-h4-line);
  font-weight: var(--rade-text-heading-weight);
}

.wepod-coin .wepod-coin__subtitle,
.wepod-coin .wepod-coin__panel-text,
.wepod-coin .wepod-coin__hint,
.wepod-coin .wepod-coin__source,
.wepod-coin .wepod-coin__note {
  color: var(--rade-color-text-muted);
  font-size: var(--rade-text-caption-size);
  line-height: var(--rade-text-caption-line);
}

.wepod-coin .wepod-coin__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Mode cards */
.wepod-coin .wepod-coin__modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.wepod-coin .wepod-coin__mode {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius);
  background: var(--rade-color-surface);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.wepod-coin .wepod-coin__mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wepod-coin .wepod-coin__mode-title {
  font-weight: var(--rade-type-weight-bold);
}

.wepod-coin .wepod-coin__mode-sub {
  color: var(--rade-color-text-muted);
  font-size: var(--rade-text-caption-size);
  line-height: var(--rade-text-caption-line);
}

@media (hover: hover) {
  .wepod-coin .wepod-coin__mode:hover,
  .wepod-coin .wepod-coin__chip:hover {
    border-color: var(--rade-color-primary);
  }

  .wepod-coin .wepod-coin__chip:hover {
    color: var(--rade-color-primary);
  }
}

.wepod-coin .wepod-coin__mode:has(input:checked) {
  border-color: var(--rade-color-primary);
  background: var(--rade-color-primary-soft);
  box-shadow: inset 0 0 0 1px var(--rade-color-primary);
}

.wepod-coin .wepod-coin__mode:has(input:checked) .wepod-coin__mode-title {
  color: var(--rade-color-primary);
}

.wepod-coin .wepod-coin__mode:has(input:focus-visible) {
  outline: 2px solid var(--rade-color-primary);
  outline-offset: 2px;
}

/* Panel and fields */
.wepod-coin .wepod-coin__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius);
  background: var(--rade-color-primary-subtle);
}

.wepod-coin .wepod-coin__inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wepod-coin .wepod-coin__panel-title {
  font-weight: var(--rade-type-weight-bold);
  font-size: var(--rade-text-h6-size);
  line-height: var(--rade-text-h6-line);
}

.wepod-coin .wepod-coin__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.wepod-coin .wepod-coin__chips-label {
  flex-basis: 100%;
  color: var(--rade-color-text-muted);
  font-size: var(--rade-text-caption-size);
  line-height: var(--rade-text-caption-line);
}

.wepod-coin .wepod-coin__chip {
  min-height: 36px;
  padding: 4px 14px;
  border: 1px solid var(--wc-border);
  border-radius: 999px;
  background: var(--rade-color-surface);
  color: var(--rade-color-text);
  font: inherit;
  font-size: var(--rade-text-caption-size);
  cursor: pointer;
}

.wepod-coin .wepod-coin__chip[aria-pressed="true"] {
  border-color: var(--rade-color-primary);
  color: var(--rade-color-primary);
}

.wepod-coin .wepod-coin__chip[aria-pressed="true"] {
  background: var(--rade-color-primary-soft);
  font-weight: var(--rade-type-weight-bold);
}

.wepod-coin .wepod-coin__chip:focus-visible,
.wepod-coin .wepod-coin__input:focus-visible,
.wepod-coin.wepod-coin details > summary:focus-visible {
  outline: 2px solid var(--rade-color-primary);
  outline-offset: 2px;
}

.wepod-coin .wepod-coin__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  align-items: start;
}

.wepod-coin .wepod-coin__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.wepod-coin .wepod-coin__label {
  font-weight: var(--rade-type-weight-semibold);
  font-size: var(--rade-text-caption-size);
  line-height: var(--rade-text-caption-line);
}

.wepod-coin .wepod-coin__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.wepod-coin .wepod-coin__input {
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--wc-border);
  border-radius: 12px;
  background: var(--rade-color-surface);
  color: var(--rade-color-text);
  font: inherit;
  font-weight: var(--rade-type-weight-bold);
}

.wepod-coin .wepod-coin__input-wrap .wepod-coin__input {
  padding-left: 64px;
  text-align: right;
}

.wepod-coin .wepod-coin__input::placeholder {
  color: var(--rade-color-text-muted);
  font-weight: var(--rade-type-weight-regular);
  opacity: .7;
}

.wepod-coin .wepod-coin__unit {
  position: absolute;
  left: 14px;
  color: var(--rade-color-text-muted);
  font-size: var(--rade-text-caption-size);
  pointer-events: none;
}

.wepod-coin .wepod-coin__hint.is-value {
  color: var(--rade-color-primary);
  font-weight: var(--rade-type-weight-semibold);
}

.wepod-coin .wepod-coin__select {
  appearance: auto;
}

/* Result */
.wepod-coin .wepod-coin__result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wepod-coin .wepod-coin__result:empty {
  display: none;
}

.wepod-coin .wepod-coin__empty {
  padding: 18px;
  border: 1px dashed var(--wc-border);
  border-radius: var(--wc-radius);
  background: var(--rade-color-surface);
  color: var(--rade-color-text-muted);
  font-size: var(--rade-text-caption-size);
}

.wepod-coin .wepod-coin__empty-title {
  color: var(--rade-color-text);
  font-weight: var(--rade-type-weight-bold);
  font-size: var(--rade-text-body-size);
}

.wepod-coin .wepod-coin__hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border-radius: var(--wc-radius);
  background: linear-gradient(135deg, var(--rade-color-primary), color-mix(in srgb, var(--rade-color-primary) 55%, var(--rade-color-secondary)));
  color: var(--rade-color-on-primary);
}

.wepod-coin .wepod-coin__hero--pending {
  background: var(--rade-color-surface);
  color: var(--rade-color-text);
  border: 1px solid var(--rade-color-primary);
}

.wepod-coin .wepod-coin__hero-kicker,
.wepod-coin .wepod-coin__hero-sub {
  font-size: var(--rade-text-caption-size);
  line-height: var(--rade-text-caption-line);
  opacity: .9;
}

.wepod-coin .wepod-coin__hero-title {
  font-size: var(--rade-text-h4-size);
  line-height: var(--rade-text-h4-line);
  font-weight: var(--rade-type-weight-extrabold);
}

.wepod-coin .wepod-coin__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wepod-coin .wepod-coin__stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--wc-border);
  border-radius: 12px;
  background: var(--rade-color-surface);
  min-width: 0;
}

.wepod-coin .wepod-coin__stat span {
  color: var(--rade-color-text-muted);
  font-size: var(--rade-text-caption-size);
  line-height: var(--rade-text-caption-line);
}

.wepod-coin .wepod-coin__stat strong {
  font-weight: var(--rade-type-weight-extrabold);
  overflow-wrap: anywhere;
}

.wepod-coin .wepod-coin__details,
.wepod-coin .wepod-coin__statuses,
.wepod-coin .wepod-coin__timeline,
.wepod-coin .wepod-coin__compare {
  padding: 14px 16px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius);
  background: var(--rade-color-surface);
}

.wepod-coin .wepod-coin__details-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.wepod-coin .wepod-coin__details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wepod-coin .wepod-coin__details .wepod-coin__stat {
  background: var(--wc-tile);
  border-color: transparent;
}

.wepod-coin .wepod-coin__details-head {
  margin-bottom: 0;
  flex-wrap: wrap;
}

.wepod-coin .wepod-coin__details-kicker {
  color: var(--rade-color-primary);
  font-size: var(--rade-text-caption-size);
  font-weight: var(--rade-type-weight-bold);
}

.wepod-coin .wepod-coin__details-title,
.wepod-coin .wepod-coin__block-title {
  font-weight: var(--rade-type-weight-bold);
}

.wepod-coin .wepod-coin__badge {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--wc-tile);
  color: var(--rade-color-text-muted);
  font-size: var(--rade-text-caption-size);
  line-height: var(--rade-text-caption-line);
  white-space: nowrap;
}

.wepod-coin .wepod-coin__badge--success {
  background: color-mix(in srgb, var(--rade-color-success) 14%, var(--rade-color-surface));
  color: color-mix(in srgb, var(--rade-color-success) 70%, var(--rade-color-text));
}

.wepod-coin .wepod-coin__note {
  padding: 10px 12px;
  border-right: 3px solid var(--rade-color-accent);
  border-radius: 8px;
  background: var(--rade-color-accent-soft);
}

.wepod-coin .wepod-coin__statuses ul,
.wepod-coin .wepod-coin__timeline ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.wepod-coin .wepod-coin__statuses li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--wc-tile);
  border-right: 3px solid var(--wc-border);
}

.wepod-coin .wepod-coin__statuses li.is-ok {
  border-right-color: var(--rade-color-success);
}

.wepod-coin .wepod-coin__statuses li span {
  color: var(--rade-color-text-muted);
  font-size: var(--rade-text-caption-size);
  line-height: var(--rade-text-caption-line);
}

.wepod-coin .wepod-coin__timeline li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--wc-tile);
}

/* Disclosures */
.wepod-coin.wepod-coin details > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--rade-color-text);
  cursor: pointer;
  list-style: none;
  font-weight: var(--rade-type-weight-bold);
}

.wepod-coin.wepod-coin details > summary::-webkit-details-marker {
  display: none;
}

.wepod-coin.wepod-coin details > summary::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: auto;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .2s ease;
}

.wepod-coin.wepod-coin details[open] > summary::after {
  transform: rotate(135deg);
}

.wepod-coin .wepod-coin__compare summary span {
  color: var(--rade-color-text-muted);
  font-size: var(--rade-text-caption-size);
  font-weight: var(--rade-type-weight-regular);
}

.wepod-coin .wepod-coin__compare[open] > summary {
  margin-bottom: 12px;
}

.wepod-coin .wepod-coin__table-wrap {
  overflow-x: auto;
}

.wepod-coin.wepod-coin table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: var(--rade-text-caption-size);
  white-space: nowrap;
}

.wepod-coin.wepod-coin tr {
  background: transparent;
}

.wepod-coin.wepod-coin th,
.wepod-coin.wepod-coin td {
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--wc-border);
  text-align: right;
}

.wepod-coin.wepod-coin th {
  color: var(--rade-color-text-muted);
  font-weight: var(--rade-type-weight-semibold);
}

.wepod-coin.wepod-coin tr.is-selected td {
  background: var(--rade-color-primary-soft);
  font-weight: var(--rade-type-weight-bold);
}

/* body.__dm forces td colour with !important; keep the status meaning. */
.wepod-coin.wepod-coin td.is-ok {
  color: color-mix(in srgb, var(--rade-color-success) 70%, var(--rade-color-text)) !important;
}

.wepod-coin.wepod-coin td.is-missing {
  color: var(--rade-color-text-muted) !important;
}

.wepod-coin .wepod-coin__source {
  margin-top: 12px;
}

@media (max-width: 640px) {
  .wepod-coin {
    padding: 14px;
  }

  .wepod-coin .wepod-coin__modes {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .wepod-coin .wepod-coin__mode {
    padding: 10px 14px;
  }

  .wepod-coin .wepod-coin__panel {
    padding: 12px;
  }

  .wepod-coin .wepod-coin__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wepod-coin.wepod-coin *,
.wepod-coin.wepod-coin *::after {
    transition: none !important;
  }
}
