/* Blame the Stock: the result card (loading, result and error states).
   Colours come from the page tokens in styles.css (:root); the fallbacks keep the card readable on its own.
   The card is a size container, so it lays itself out by its own width (desktop, phone, preview frames). */

.bts-card {
  --bts-fg: var(--fg, #fff);
  --bts-bg: var(--bg, #000);
  --bts-grey: var(--grey, #8b8b8b);
  --bts-line: var(--line, #262626);
  --bts-edge: #3a3a3a;                 /* a step lighter than --line, for button outlines and the flat bar */
  --bts-pair: var(--pair, #2433FF);
  --bts-coin: var(--coin, #FF4F1F);
  --bts-radius: var(--radius, 20px);
  --bts-ease: cubic-bezier(.2, .7, .2, 1);

  container: bts-card / inline-size;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
  padding: clamp(20px, 5%, 44px);
  border: 1px solid var(--bts-line);
  border-radius: var(--bts-radius);
  background: var(--bts-bg);
  color: var(--bts-fg);
  text-align: left;
  scroll-margin-top: 96px;             /* clears the floating menu when scrolled into view */
  -webkit-font-smoothing: antialiased;
}
.bts-card *, .bts-card *::before, .bts-card *::after { box-sizing: border-box; }
.bts-card.is-entering { animation: bts-in .5s var(--bts-ease) both; }
@keyframes bts-in { from { opacity: 0; transform: translateY(10px); } }

.bts-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- Top row: "ZOLVA vs ETH" + window tabs ---------------------------------------------------- */
.bts-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 16px;
  padding-bottom: clamp(16px, 3cqi, 22px);
  border-bottom: 1px solid var(--bts-line);
}
.bts-pairline {
  margin: 0; min-width: 0; max-width: 100%;
  font-size: 12px; font-weight: 600; line-height: 1.2;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--bts-grey);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bts-vs { letter-spacing: .1em; text-transform: lowercase; font-variant-caps: all-small-caps; }
.bts-addr { text-transform: none; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

.bts-tabs {
  display: inline-flex; flex: none; gap: 2px; padding: 3px;
  border: 1px solid var(--bts-line); border-radius: 999px;
}
.bts-tab {
  appearance: none; -webkit-appearance: none; margin: 0; border: 0;
  min-width: 44px; padding: 8px 13px;
  border-radius: 999px; background: transparent; color: var(--bts-grey);
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color .15s, background-color .2s;
}
.bts-tab:hover { color: var(--bts-fg); }
.bts-tab[aria-selected="true"] { background: var(--bts-fg); color: #000; cursor: default; }
.bts-tab:focus-visible { outline: 2px solid var(--bts-fg); outline-offset: 2px; }

/* ---- Body ------------------------------------------------------------------------------------- */
.bts-body { padding-top: clamp(24px, 5cqi, 44px); }
.bts-body:focus { outline: none; }

.bts-verdict {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 50px);
  font-size: clamp(26px, 5.6cqi, 50px);
  font-weight: 700; line-height: 1.08; letter-spacing: -.022em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.bts-nobr { white-space: nowrap; }
.bts-count { display: inline-block; text-align: right; font-variant-numeric: tabular-nums; }
.bts-subline {
  margin: 14px 0 0; max-width: 60ch;
  font-size: clamp(15px, 2.2cqi, 18px); line-height: 1.45;
  color: var(--bts-grey);
}

/* Split bar: blue = the pair, vermilion = the coin. Starts split at the middle, slides to the real split. */
.bts-split { margin-top: clamp(28px, 5cqi, 44px); }
.bts-bar {
  display: flex; gap: 3px;
  height: clamp(14px, 2.2cqi, 20px);
  border-radius: 999px; overflow: hidden;
  transition: gap .7s var(--bts-ease);
}
.bts-bar.is-whole { gap: 0; }
.bts-seg { flex: 100 1 0; min-width: 0; transition: flex-grow .7s var(--bts-ease); }
.bts-seg-pair { background: var(--bts-pair); }
.bts-seg-coin { background: var(--bts-coin); }
.bts-bar.is-flat { height: 6px; gap: 0; background: var(--bts-edge); }

.bts-legend {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  margin: 12px 0 0; padding: 0; list-style: none;
  font-size: 14px; line-height: 1.3;
}
.bts-key { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--bts-grey); }
.bts-key b { color: var(--bts-fg); font-weight: 700; font-variant-numeric: tabular-nums; }
.bts-key-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.bts-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.bts-dot-pair { background: var(--bts-pair); }
.bts-dot-coin { background: var(--bts-coin); }
.bts-nothing { margin: 12px 0 0; font-size: 14px; color: var(--bts-grey); }

/* Three numbers */
.bts-numbers {
  display: flex; flex-wrap: wrap; gap: 20px 32px;
  margin: clamp(28px, 5cqi, 44px) 0 0;
  padding-top: clamp(20px, 3.5cqi, 28px);
  border-top: 1px solid var(--bts-line);
}
.bts-num { flex: 1 1 0; min-width: 9em; }
.bts-num dt {
  margin: 0 0 6px;
  font-size: 13px; line-height: 1.3; color: var(--bts-grey);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bts-num dd {
  margin: 0;
  font-size: clamp(26px, 4.6cqi, 40px); font-weight: 700; line-height: 1.05; letter-spacing: -.02em;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.bts-arrow { display: inline-block; margin-right: .14em; font-weight: 500; }

/* Notes, warnings, time */
.bts-subline, .bts-notes, .bts-warnings, .bts-asof, .bts-error { overflow-wrap: anywhere; }
.bts-notes, .bts-warnings {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px;
  margin: 24px 0 0; padding: 0; list-style: none;
  font-size: 14px; line-height: 1.5;
}
.bts-notes { color: var(--bts-grey); }
.bts-warnings { color: var(--bts-fg); }
.bts-notes + .bts-warnings { margin-top: 10px; }
.bts-warnings li { position: relative; padding-left: 18px; }
.bts-warnings li::before {
  content: ""; position: absolute; left: 2px; top: .56em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--bts-coin);
}
.bts-asof { margin: 18px 0 0; font-size: 13px; line-height: 1.3; color: var(--bts-grey); }

/* ---- Buttons ---------------------------------------------------------------------------------- */
.bts-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: clamp(24px, 4cqi, 32px);
  padding-top: clamp(20px, 3.5cqi, 24px);
  border-top: 1px solid var(--bts-line);
}
.bts-btn {
  appearance: none; -webkit-appearance: none; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border: 1px solid var(--bts-edge); border-radius: 999px;
  background: transparent; color: var(--bts-fg);
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, opacity .2s;
}
.bts-btn:hover { border-color: var(--bts-fg); }
.bts-btn.is-primary { background: var(--bts-fg); border-color: var(--bts-fg); color: #000; }
.bts-btn.is-primary:hover { background: #dcdcdc; border-color: #dcdcdc; }
.bts-btn:focus-visible { outline: 2px solid var(--bts-fg); outline-offset: 3px; }
.bts-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }

/* ---- Error ------------------------------------------------------------------------------------ */
.bts-card[data-state="error"] .bts-body { padding-top: 0; }
.bts-card[data-state="error"] .bts-top + .bts-body { padding-top: clamp(24px, 5cqi, 40px); }
.bts-error {
  margin: 0; max-width: 34ch;
  font-size: clamp(20px, 3.4cqi, 28px); font-weight: 600; line-height: 1.3; letter-spacing: -.01em;
}
.bts-card[data-state="error"] .bts-actions { border-top: 0; padding-top: 0; }

/* ---- Loading (calm skeleton) ------------------------------------------------------------------ */
.bts-skel {
  display: block; border-radius: 10px; background: #161616;
  animation: bts-pulse 1.6s ease-in-out infinite alternate;
}
@keyframes bts-pulse { from { opacity: .45; } to { opacity: 1; } }
.bts-skel-tag { width: 96px; height: 12px; border-radius: 6px; }
.bts-skel-tabs { width: 188px; height: 34px; border-radius: 999px; }
.bts-skel-line { height: clamp(24px, 4.6cqi, 42px); }
.bts-skel-line + .bts-skel-line { margin-top: 12px; }
.bts-skel-bar { height: clamp(14px, 2.2cqi, 20px); margin-top: clamp(28px, 5cqi, 44px); border-radius: 999px; }
.bts-skel-nums { display: flex; gap: 32px; margin-top: clamp(28px, 5cqi, 44px); }
.bts-skel-nums .bts-skel { flex: 1 1 0; height: 54px; }
.bts-progress {
  display: flex; align-items: center; gap: 10px;
  margin: clamp(24px, 4cqi, 32px) 0 0;
  font-size: 15px; line-height: 1.4; color: var(--bts-grey);
}
.bts-progress::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--bts-fg);
  animation: bts-pulse .9s ease-in-out infinite alternate;
}
.bts-card[data-state="refreshing"] .bts-actions { opacity: .35; }

/* ---- Off-hours block (settings.features.offHoursMode): under the numbers, greys only ------------- */
.bts-off {
  margin-top: clamp(24px, 4cqi, 32px);
  padding-top: clamp(18px, 3cqi, 24px);
  border-top: 1px solid var(--bts-line);
  --bts-off-closed: #333;
  --bts-off-open: #a6a6a6;
}
.bts-off[hidden] { display: none; }
.bts-off.is-in { animation: bts-off-in .45s var(--bts-ease) both; }
@keyframes bts-off-in { from { opacity: 0; transform: translateY(4px); } }
.bts-off-title {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 600; line-height: 1.2; letter-spacing: .14em; text-transform: uppercase;
  color: var(--bts-grey);
}
.bts-off-sentence {
  margin: 0; max-width: 60ch;
  font-size: clamp(16px, 2.4cqi, 20px); font-weight: 600; line-height: 1.35; letter-spacing: -.005em;
  text-wrap: pretty;
}
.bts-off-line { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--bts-grey); font-variant-numeric: tabular-nums; }
.bts-off-sentence, .bts-off-line, .bts-off-note { overflow-wrap: anywhere; }
.bts-off-bar { display: flex; gap: 2px; height: 6px; margin-top: 18px; border-radius: 999px; overflow: hidden; }
.bts-off-seg { flex: 1 1 0; min-width: 2px; }
.bts-off-seg.is-closed, .bts-off-dot.is-closed { background: var(--bts-off-closed); }
.bts-off-seg.is-open, .bts-off-dot.is-open { background: var(--bts-off-open); }
.bts-off-ends {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 6px; font-size: 12px; line-height: 1.3; color: var(--bts-grey); font-variant-numeric: tabular-nums;
}
.bts-off-legend {
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  margin: 10px 0 0; padding: 0; list-style: none;
  font-size: 13px; line-height: 1.3; color: var(--bts-grey);
}
.bts-off-legend li { display: inline-flex; align-items: center; gap: 0 8px; }
.bts-off-legend b { color: var(--bts-fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.bts-off-dot { flex: none; width: 10px; height: 6px; border-radius: 3px; }
.bts-off-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--bts-grey); }
.bts-off-progress {
  display: flex; align-items: center; gap: 10px;
  margin: 0; font-size: 14px; line-height: 1.4; color: var(--bts-grey);
}
.bts-off-progress::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--bts-grey);
  animation: bts-pulse .9s ease-in-out infinite alternate;
}

/* ---- Narrow cards (phones) -------------------------------------------------------------------- */
@container bts-card (max-width: 520px) {
  .bts-tab { padding: 9px 12px; min-width: 40px; }
  .bts-numbers { display: grid; gap: 0; padding-top: 4px; }
  .bts-num {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    min-width: 0; padding: 12px 0;
  }
  .bts-num + .bts-num { border-top: 1px solid var(--bts-line); }
  .bts-num dt { margin: 0; font-size: 14px; }
  .bts-num dd { font-size: 26px; }
  .bts-actions .bts-btn { flex: 1 1 0; padding: 0 12px; }
  .bts-actions .bts-btn.is-primary { flex-basis: 100%; }
  .bts-card[data-state="error"] .bts-actions .bts-btn { flex: 0 1 auto; padding: 0 20px; }
  .bts-skel-nums { display: grid; gap: 10px; }
  .bts-skel-nums .bts-skel { height: 36px; }
}
@container bts-card (max-width: 340px) {
  .bts-tabs { width: 100%; justify-content: space-between; }
  .bts-tab { flex: 1 1 0; min-width: 0; }
}

/* The loading card can hold keyboard focus (tabindex -1) while it has no buttons: no ring around the whole card. */
.bts-card[tabindex="-1"]:focus { outline: none; }

/* ---- Next to the paste box (index.html): the "not an address" line and the busy Blame button ----- */
.paste-hint { margin: 12px 8px 0; font-size: 15px; line-height: 1.4; color: var(--fg, #fff); overflow-wrap: anywhere; }
.paste-hint:empty { margin: 0; }
#paste-submit[aria-busy="true"] { cursor: progress; animation: bts-busy .8s ease-in-out infinite alternate; }
@keyframes bts-busy { to { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
  .bts-card, .bts-card * { animation: none !important; transition: none !important; }
  #paste-submit[aria-busy="true"] { animation: none; opacity: .6; }
}
