:root {
  /* Deep navy night, one electric blue for actions, green and orange only for direction. */
  --bg: #060b18;
  --surface: #0b1426;
  --surface-2: #0f1a31;
  --surface-3: #16233f;
  --line: rgba(122, 160, 255, 0.11);
  --line-2: rgba(122, 160, 255, 0.22);
  --text: #e8eefc;
  --muted: #8c9bbd;
  --faint: #5b6a8e;
  --accent: #4d8dff;
  --accent-deep: #2f6be6;
  --accent-ink: #051436;
  --accent-rgb: 77, 141, 255;
  --up: #4ae36c;
  --up-deep: #1fa547;
  --up-rgb: 74, 227, 108;
  --down: #ff6b3d;
  --down-deep: #d9461f;
  --down-rgb: 255, 107, 61;
  --gold: #f4bd5d;
  --gold-rgb: 244, 189, 93;
  --warn: #ffcf5a;

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --gutter: 16px;
  --r-card: 20px;
  --r-tile: 14px;
  --tabbar-h: 64px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --card-fill: linear-gradient(180deg, rgba(22, 34, 66, 0.62) 0%, rgba(8, 14, 30, 0.92) 100%);
  --card-edge: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 14px 34px -18px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

/* ---------- Base ---------- */

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(var(--accent-rgb), 0.11) 0%, transparent 60%),
    radial-gradient(80% 50% at 100% 30%, rgba(110, 90, 240, 0.06) 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.muted {
  color: var(--muted);
}

/* ---------- Layout ---------- */

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) var(--gutter) calc(28px + env(safe-area-inset-bottom));
}

body[data-view^="tab"] .app {
  padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
}

body[data-view="tab-pairs"] .app {
  padding-bottom: calc(var(--tabbar-h) + 104px + env(safe-area-inset-bottom));
}

body[data-view] .foot {
  display: none;
}

/* ---------- App bar ---------- */

.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  margin-bottom: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.4),
    0 0 14px rgba(var(--accent-rgb), 0.35);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.lang-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.06);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.lang-chip svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
}

.lang-chip select {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.lang-chip:has(select:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Type and messages ---------- */

.screen-title {
  margin: 10px 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.screen-lede {
  margin: 0 0 18px;
  color: var(--muted);
}

.status {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(var(--down-rgb), 0.35);
  border-radius: var(--r-tile);
  background: rgba(var(--down-rgb), 0.08);
  color: #ffc9b6;
  font-size: 14px;
}

.status.is-ok {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.note,
.disclaimer {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.5;
}

.list-heading {
  margin: 22px 2px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------- Buttons ---------- */

.actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.btn,
.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 15px;
  font-weight: 700;
  font-size: 15px;
  transition:
    transform 160ms var(--ease-out),
    opacity 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.btn:active:not(:disabled),
.cta:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled,
.cta:disabled {
  opacity: 0.4;
}

.btn-primary,
.cta {
  background: linear-gradient(180deg, #7eaeff 0%, var(--accent) 45%, var(--accent-deep) 100%);
  color: var(--accent-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 10px 26px -10px rgba(var(--accent-rgb), 0.7);
}

.btn-ghost {
  border: 1px solid var(--line-2);
  background: rgba(var(--accent-rgb), 0.04);
  color: var(--text);
}

.cta {
  width: 100%;
  min-height: 54px;
  font-size: 16px;
}

.cta svg,
.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cta[aria-busy="true"] {
  opacity: 0.7;
}

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover:not(:disabled) {
    border-color: rgba(var(--accent-rgb), 0.45);
  }
}

/* ---------- Loading ---------- */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50vh;
  color: var(--muted);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(var(--accent-rgb), 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Access steps ---------- */

.gate {
  padding-top: 6px;
}

.steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card-fill);
  box-shadow: var(--card-edge);
}

.step-n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}

.step-title {
  margin: 5px 0 4px;
  font-weight: 700;
}

.step-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.step.is-current {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow:
    var(--card-edge),
    0 0 0 4px rgba(var(--accent-rgb), 0.06);
}

.step.is-current .step-n {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.step.is-done .step-n {
  border-color: rgba(var(--accent-rgb), 0.5);
  color: var(--accent);
}

.step.is-later {
  opacity: 0.6;
}

.gift {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed rgba(var(--gold-rgb), 0.45);
  border-radius: var(--r-tile);
  background: rgba(var(--gold-rgb), 0.06);
}

.gift-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.gift-label svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

/* The promo code: one tap copies it. */
.promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 8px 0 18px;
  border: 1px solid rgba(var(--gold-rgb), 0.5);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(var(--gold-rgb), 0.14), rgba(var(--gold-rgb), 0.05));
  transition: transform 160ms var(--ease-out), border-color 200ms ease;
}

.promo:active {
  transform: scale(0.98);
}

.promo-code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.promo-copy {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(var(--gold-rgb), 0.16);
  color: var(--gold);
}

.promo-copy svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.promo.is-copied {
  border-color: var(--accent);
}

.promo.is-copied .promo-copy {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
}

.promo-hint {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Live strip ---------- */

.ticker {
  display: flex;
  align-items: center;
  height: 36px;
  margin: 0 calc(var(--gutter) * -1) 12px;
  border-block: 1px solid var(--line);
  background: rgba(10, 18, 38, 0.7);
  overflow: hidden;
}

.ticker-live {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 12px 0 var(--gutter);
  background: linear-gradient(90deg, var(--surface) 70%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.ticker-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6);
  animation: live-dot 1.8s ease-out infinite;
}

@keyframes live-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 7px rgba(var(--accent-rgb), 0);
  }
}

.ticker-viewport {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 24px), transparent 100%);
}

.ticker-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: ticker var(--ticker-duration, 40s) linear infinite;
}

.ticker:active .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

.ticker-run {
  display: flex;
  align-items: center;
  height: 100%;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  font-size: 12.5px;
}

.ticker-item b {
  font-weight: 700;
}

.ticker-price {
  color: var(--up);
  font-variant-numeric: tabular-nums;
}

.ticker-price.is-down {
  color: var(--down);
}

.ticker-payout {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ticker-item.is-tiktok {
  gap: 6px;
  color: var(--text);
}

.ticker-item.is-tiktok svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  filter: drop-shadow(1px 0 0 #ff2a5f) drop-shadow(-1px 0 0 #22e6e6);
}

/* ---------- Status card ---------- */

.status-card {
  padding: 16px;
  border: 1px solid rgba(var(--gold-rgb), 0.28);
  border-radius: var(--r-card);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(var(--gold-rgb), 0.1) 0%, transparent 60%),
    var(--card-fill);
  box-shadow: var(--card-edge);
}

.status-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(var(--gold-rgb), 0.14);
  color: var(--gold);
}

.status-badge svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-who,
.status-today {
  display: grid;
  gap: 1px;
}

.status-who {
  flex: 1;
  min-width: 0;
}

.status-today {
  text-align: right;
}

.status-who small,
.status-today small {
  color: var(--muted);
  font-size: 12px;
}

.status-who b {
  overflow: hidden;
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-today b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.status-today b i {
  margin-left: 3px;
  color: var(--faint);
  font-style: normal;
  font-size: 13px;
}

.status-card.is-rest .status-today b span {
  color: var(--warn);
}

.status-bar {
  display: block;
  height: 6px;
  margin-top: 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.status-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c88a2e, var(--gold));
  transform-origin: left;
  transform: scaleX(0);
}

.status-next {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Tools: gift and capital ---------- */

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.tool {
  --tone-rgb: var(--accent-rgb);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--tone-rgb), 0.32);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(var(--tone-rgb), 0.09), rgba(var(--tone-rgb), 0.02));
  text-align: left;
  transition: transform 160ms var(--ease-out), border-color 160ms ease;
}

.tool.is-gift {
  --tone-rgb: var(--gold-rgb);
}

.tool:active {
  transform: scale(0.97);
}

.tool-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(var(--tone-rgb), 0.15);
  color: rgb(var(--tone-rgb));
}

.tool-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-text {
  display: grid;
  min-width: 0;
}

.tool-text b {
  font-size: 14.5px;
}

.tool-text small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.3;
}

/* ---------- Search ---------- */

.search {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 16px;
}

.search > svg {
  position: absolute;
  left: 15px;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 50px;
  padding: 0 46px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: rgba(10, 18, 38, 0.85);
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: var(--faint);
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.search input:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.7);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1);
}

.search-clear {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--muted);
}

.search-clear svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- Segmented control ---------- */

.seg {
  --seg-index: 0;
  --seg-count: 3;
  position: relative;
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  height: 46px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(10, 18, 38, 0.8);
}

.seg-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / var(--seg-count));
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent-rgb), 0.1));
  box-shadow: 0 0 18px -6px rgba(var(--accent-rgb), 0.6);
  transform: translateX(calc(var(--seg-index) * 100%));
  transition: transform 280ms var(--ease-in-out);
}

.seg-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  border-radius: 11px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 200ms ease;
}

.seg-option svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.seg-option[aria-pressed="true"] {
  color: var(--text);
}

/* ---------- Pair groups and rows ---------- */

.groups {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.group {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card-fill);
  box-shadow: var(--card-edge);
  overflow: hidden;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 12px 14px;
  text-align: left;
}

.group-head:disabled {
  cursor: default;
}

.group-head:disabled .chevron {
  display: none;
}

.group-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--accent);
}

.group-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.group-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.group-text b {
  font-size: 15.5px;
}

.group-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 240ms var(--ease-in-out);
}

.group.is-folded .group-head .chevron {
  transform: rotate(180deg);
}

.group.is-folded .group-list {
  display: none;
}

.group-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 10px 10px;
  list-style: none;
}

.row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(15, 25, 50, 0.75);
  transition: border-color 160ms ease;
}

.row-main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 62px;
  padding: 10px 4px 10px 12px;
  text-align: left;
  transition: transform 160ms var(--ease-out);
}

.row-main:active {
  transform: scale(0.98);
}

.row-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.row-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
}

.row-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-side {
  display: grid;
  flex: none;
  justify-items: end;
  gap: 2px;
}

.row-price {
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.row-payout,
.payout {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--up);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.row-payout.is-low,
.payout.is-low {
  color: var(--muted);
}

.row-payout svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row-change {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.row-change.is-up {
  color: var(--up);
}

.row-change.is-down {
  color: var(--down);
}

.row.is-resting .row-main {
  opacity: 0.55;
}

.kind-pill {
  padding: 1px 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.star {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  color: var(--faint);
  transition: color 160ms ease, transform 160ms var(--ease-out);
}

.star:active {
  transform: scale(0.88);
}

.star svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.star[aria-pressed="true"] {
  color: var(--gold);
}

.star[aria-pressed="true"] svg {
  fill: currentColor;
}

.list-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 34px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-card);
  text-align: center;
}

.list-empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  border-radius: 15px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.list-empty-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.list-empty-title {
  margin: 0;
  font-weight: 700;
}

.list-empty-text {
  max-width: 30ch;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Flags ---------- */

.flags {
  display: inline-flex;
  flex: none;
  align-items: center;
}

.flag {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-3);
  box-shadow:
    0 0 0 2px var(--surface-2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.flag + .flag {
  margin-left: -9px;
}

.flag svg {
  width: 100%;
  height: 100%;
}

.flag.is-plain {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.flag.is-scan {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

.flag.is-scan svg {
  width: 60%;
  height: 60%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.flags-lg .flag {
  width: 44px;
  height: 44px;
  box-shadow:
    0 0 0 3px #0e1830,
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.flags-lg .flag + .flag {
  margin-left: -14px;
}

/* ---------- Smart scan bar ---------- */

.scanbar {
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom));
  left: var(--gutter);
  z-index: 20;
  display: none;
  align-items: center;
  gap: 12px;
  max-width: 448px;
  margin: 0 auto;
  padding: 10px 10px 10px 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 18px;
  background: rgba(9, 15, 33, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 40px -12px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body[data-view="tab-pairs"] .scanbar:not([hidden]) {
  display: flex;
}

.scanbar-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.scanbar-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.scanbar-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.scanbar-text b {
  font-size: 14px;
}

.scanbar-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scanbar-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px 0 16px;
  border-radius: 13px;
  background: linear-gradient(180deg, #7eaeff 0%, var(--accent) 45%, var(--accent-deep) 100%);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 22px -8px rgba(var(--accent-rgb), 0.8);
  transition: transform 160ms var(--ease-out);
}

.scanbar-btn:active {
  transform: scale(0.96);
}

.scanbar-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Tab bar ---------- */

.tabbar {
  --tab-index: 1;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 0 max(8px, calc((100% - 480px) / 2)) env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(6, 11, 24, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body[data-view^="tab"] .tabbar {
  display: grid;
}

/* A short bar of light on the top edge over the active tab. */
.tabbar-glow {
  position: absolute;
  top: -1px;
  left: max(8px, calc((100% - 480px) / 2));
  width: calc((min(100%, 480px) - 16px) / 4);
  height: 2px;
  pointer-events: none;
  transform: translateX(calc(var(--tab-index) * 100%));
  transition: transform 320ms var(--ease-in-out);
}

.tabbar-glow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 34px;
  height: 2px;
  margin-left: -17px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px 2px rgba(var(--accent-rgb), 0.6);
}

.tab {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  transition: color 200ms ease;
}

.tab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms var(--ease-out);
}

.tab:active svg {
  transform: scale(0.9);
}

.tab.is-active {
  color: var(--accent);
}

.tab.is-active svg {
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.45));
}

/* ---------- Sheets ---------- */

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 12, 0.66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  border: 1px solid var(--line-2);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background:
    radial-gradient(100% 50% at 50% 0%, rgba(var(--accent-rgb), 0.08), transparent 70%),
    linear-gradient(180deg, #101b34 0%, #080f22 100%);
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.8);
}

.sheet-grip {
  display: block;
  width: 42px;
  height: 5px;
  margin: 0 auto 12px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
  touch-action: none;
}

.sheet-x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--muted);
  transition: transform 160ms var(--ease-out);
}

.sheet-x:active {
  transform: scale(0.92);
}

.sheet-x svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.sheet-step {
  margin: 4px 0 2px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  touch-action: none;
}

.sheet-title {
  margin: 0 52px 6px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.25;
  touch-action: none;
}

.sheet-text {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.sheet-note {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.sheet-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 6px 0 12px;
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  touch-action: none;
}

.sheet-icon.is-gold {
  background: rgba(var(--gold-rgb), 0.14);
  color: var(--gold);
}

.sheet-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sheet .actions {
  margin-top: 20px;
}

.sheet .cta {
  margin-top: 18px;
}

.sheet-warn {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 207, 90, 0.3);
  border-radius: 12px;
  background: rgba(255, 207, 90, 0.07);
  color: #ffe2a1;
  font-size: 13px;
}

.setup-pair {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 25, 50, 0.7);
}

.setup-pair-text {
  display: grid;
}

.setup-pair-text b {
  font-size: 15.5px;
}

.setup-pair-text small {
  color: var(--muted);
  font-size: 12.5px;
}

.field-label {
  display: block;
  margin: 18px 0 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(10, 18, 38, 0.8);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  transition:
    transform 160ms var(--ease-out),
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.mode:active {
  transform: scale(0.97);
}

.mode svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb), 0.7);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
  box-shadow: 0 0 20px -8px rgba(var(--accent-rgb), 0.7);
}

.mode[aria-pressed="true"] svg {
  color: var(--accent);
}

.expiry-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  transition: opacity 200ms ease;
}

.expiry-grid[data-count="6"] {
  grid-template-columns: repeat(3, 1fr);
}

.expiry-grid.is-auto {
  opacity: 0.38;
}

.expiry-tile {
  display: grid;
  place-content: center;
  justify-items: center;
  height: 56px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: rgba(10, 18, 38, 0.8);
  transition:
    transform 160ms var(--ease-out),
    border-color 160ms ease,
    background-color 160ms ease;
}

.expiry-tile:active {
  transform: scale(0.95);
}

.expiry-tile b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
}

.expiry-tile small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.expiry-tile[aria-pressed="true"] {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-rgb), 0.12));
  box-shadow: 0 0 22px -6px rgba(var(--accent-rgb), 0.75);
}

.expiry-tile[aria-pressed="true"] small {
  color: var(--text);
}

.auto-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Capital */

.money-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: rgba(10, 18, 38, 0.85);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.money-field:focus-within {
  border-color: rgba(var(--accent-rgb), 0.7);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1);
}

.money-field span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 20px;
}

.money-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.money-field input::placeholder {
  color: var(--faint);
}

.seg-3 {
  --seg-count: 3;
}

.seg-2 {
  --seg-count: 2;
  margin-bottom: 4px;
}

.plan {
  display: grid;
  gap: 0;
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-top: 1px solid var(--line);
}

.plan-row:first-child {
  border-top: 0;
}

.plan-row dt {
  display: grid;
  color: var(--muted);
  font-size: 14px;
}

.plan-row dt small {
  color: var(--faint);
  font-size: 11.5px;
}

.plan-row dd {
  margin: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plan-row.is-main {
  background: rgba(var(--accent-rgb), 0.07);
}

.plan-row.is-main dd {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
}

.plan.is-empty dd {
  color: var(--faint);
}

.tip {
  display: flex;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tip svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  fill: none;
  stroke: var(--warn);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sheet-gift .promo {
  margin-top: 4px;
}

/* ---------- The Signal tab ---------- */

.stage {
  position: relative;
  padding: 16px 16px 18px;
  border: 1px solid var(--line-2);
  border-radius: 24px;
  background:
    radial-gradient(90% 40% at 50% 0%, rgba(var(--accent-rgb), 0.08), transparent 70%),
    var(--card-fill);
  box-shadow: var(--card-edge);
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
}

.stage-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.stage[data-status="analyzing"] .stage-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: live-dot 1.6s ease-out infinite;
}

.stage-x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--muted);
  transition: transform 160ms var(--ease-out);
}

.stage-x:active {
  transform: scale(0.92);
}

.stage-x svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.stage-pair {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 4px 0 14px;
  text-align: center;
}

.stage-name {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.stage-quote {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 20px;
  margin: 0;
  font-size: 13.5px;
}

.stage-price {
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stage-disclaimer {
  margin: 14px 4px 0;
  text-align: center;
}

.idle {
  display: grid;
  gap: 12px;
}

.idle .mood {
  margin-top: 0;
}

.idle-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Facts: label left, value right, in one framed box. */
.facts {
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 18, 38, 0.6);
}

.facts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-top: 1px solid var(--line);
}

.facts > div:first-child {
  border-top: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 13.5px;
}

.facts dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

/* The analysis: a radar sweeping over a row of candles. */
.analysis {
  display: grid;
}

.radar {
  position: relative;
  width: min(230px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto;
}

.radar-bars {
  position: absolute;
  inset: 22% 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
}

.radar-bars i {
  width: 5%;
  height: var(--h);
  border-radius: 2px;
  background: rgba(var(--accent-rgb), 0.18);
  transform-origin: center;
  animation: radar-bar 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.13s);
}

.radar-bars i.is-up {
  background: rgba(var(--up-rgb), 0.55);
}

.radar-bars i.is-down {
  background: rgba(var(--down-rgb), 0.5);
}

@keyframes radar-bar {
  0%,
  100% {
    transform: scaleY(0.72);
  }
  50% {
    transform: scaleY(1);
  }
}

.radar-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.radar-ring.is-1 {
  width: 30%;
  height: 30%;
  border-color: rgba(var(--accent-rgb), 0.55);
}

.radar-ring.is-2 {
  width: 60%;
  height: 60%;
}

.radar-ring.is-3 {
  width: 92%;
  height: 92%;
  border-color: rgba(var(--accent-rgb), 0.16);
  animation: radar-ring 2.4s var(--ease-out) infinite;
}

@keyframes radar-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 0;
  }
}

.radar-sweep {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(var(--accent-rgb), 0) 0deg, rgba(var(--accent-rgb), 0) 290deg, rgba(var(--accent-rgb), 0.3) 358deg, rgba(var(--accent-rgb), 0) 360deg);
  animation: spin 2.2s linear infinite;
}

.radar-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: radial-gradient(circle, #061433 0 28%, var(--accent) 30% 100%);
  box-shadow: 0 0 22px 4px rgba(var(--accent-rgb), 0.45);
}

.analysis-label {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin: 6px 0 0;
  font-weight: 800;
  font-size: 16px;
}

.dots {
  display: inline-flex;
  gap: 4px;
}

.dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot 1.2s ease-in-out infinite;
}

.dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

.analysis-step {
  min-height: 20px;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The result: the direction as one large block. */
.result {
  --tone: var(--up);
  --tone-deep: var(--up-deep);
  --tone-rgb: var(--up-rgb);
  --tone-ink: #04210f;
  display: grid;
}

.result.is-down {
  --tone: var(--down);
  --tone-deep: var(--down-deep);
  --tone-rgb: var(--down-rgb);
  --tone-ink: #2a0d02;
}

.verdict {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 152px;
  border-radius: 22px;
  background: linear-gradient(165deg, var(--tone) 0%, var(--tone-deep) 100%);
  color: var(--tone-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 22px 50px -18px rgba(var(--tone-rgb), 0.75);
  overflow: hidden;
  transition: opacity 400ms ease, filter 400ms ease;
}

/* Fine diagonal sheen across the block. */
.verdict::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 10px),
    radial-gradient(70% 60% at 50% 0%, rgba(255, 255, 255, 0.28), transparent 70%);
  pointer-events: none;
}

.verdict::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.verdict.is-landing::after {
  animation: verdict-ring 1.1s var(--ease-out) 0.18s;
}

@keyframes verdict-ring {
  0% {
    opacity: 0.8;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(2.6);
  }
}

.verdict-arrow {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.14);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.verdict-arrow svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result.is-down .verdict-arrow svg {
  transform: rotate(180deg);
}

.verdict-word {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.verdict-caption {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.countdown {
  margin-top: 14px;
}

.countdown-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 2px 8px;
  color: var(--muted);
  font-size: 13.5px;
}

.countdown-head b {
  color: var(--tone);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.countdown-track {
  display: block;
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.countdown-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tone-deep), var(--tone));
  box-shadow: 0 0 12px rgba(var(--tone-rgb), 0.6);
  transform-origin: left;
}

.result.is-over .verdict {
  opacity: 0.45;
  filter: saturate(0.4);
}

.result.is-over .countdown-head b {
  color: var(--muted);
}

.stage-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.signal-demo {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 207, 90, 0.4);
  border-radius: 12px;
  background: rgba(255, 207, 90, 0.1);
  color: #ffe2a1;
  font-size: 13px;
}

.problem {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.problem-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 207, 90, 0.1);
  color: var(--warn);
}

.problem-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.problem-text {
  max-width: 32ch;
  margin: 8px 0 0;
  color: var(--muted);
}

.problem .stage-actions {
  width: 100%;
}

/* The traders' mood. */
.mood {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 18, 38, 0.6);
}

.mood-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 13px;
}

.mood-split {
  display: inline-flex;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.mood-split .is-up {
  color: var(--up);
}

.mood-split .is-down {
  color: var(--down);
}

.mood-bar {
  display: block;
  height: 6px;
  border-radius: 6px;
  background: rgba(var(--down-rgb), 0.75);
  overflow: hidden;
}

.mood-bar > span {
  display: block;
  height: 100%;
  background: var(--up);
  transform-origin: left;
  transform: scaleX(0.5);
  transition: transform 600ms var(--ease-in-out);
}

/* ---------- History ---------- */

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 0;
}

.duo > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-fill);
  box-shadow: var(--card-edge);
}

.duo dt {
  color: var(--muted);
  font-size: 12.5px;
}

.duo dd {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.duo dd small {
  margin-left: 6px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
}

.history-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(15, 25, 50, 0.75);
  text-align: left;
  transition: transform 160ms var(--ease-out);
}

.history-row:active {
  transform: scale(0.98);
}

.history-main {
  display: grid;
  flex: 1;
  min-width: 0;
}

.history-main b {
  font-size: 14.5px;
}

.history-main small {
  color: var(--muted);
  font-size: 12.5px;
}

.dir-tag {
  --tone: var(--up);
  --tone-rgb: var(--up-rgb);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px 0 8px;
  border-radius: 10px;
  background: rgba(var(--tone-rgb), 0.13);
  color: var(--tone);
  font-size: 12.5px;
  font-weight: 800;
}

.dir-tag.is-down {
  --tone: var(--down);
  --tone-rgb: var(--down-rgb);
}

.dir-tag svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dir-tag.is-down svg {
  transform: rotate(180deg);
}

.skeleton-row {
  height: 62px;
  margin-bottom: 8px;
  border-radius: 15px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Profile ---------- */

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card-fill);
  box-shadow: var(--card-edge);
}

.avatar {
  --hue: 220;
  display: grid;
  flex: none;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(140deg, hsl(var(--hue) 55% 42%), hsl(calc(var(--hue) + 40) 55% 28%));
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-who {
  min-width: 0;
}

.profile-name {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-handle {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0 0;
  padding: 3px 9px 3px 7px;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.access-badge svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel {
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card-fill);
  box-shadow: var(--card-edge);
}

.panel-row {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.panel-row:first-child {
  border-top: 0;
}

.panel-row dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.panel-row dd {
  display: grid;
  margin: 0;
}

.panel-row dd b {
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}

.panel-row dd small {
  color: var(--muted);
  font-size: 12.5px;
}

.panel-row .status-bar {
  margin-top: 10px;
}

.panel-row dd.panel-pair {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.last-signal {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 2px;
  text-align: left;
  transition: transform 160ms var(--ease-out);
}

.last-signal:active {
  transform: scale(0.98);
}

.last-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.last-text b {
  color: var(--text) !important;
  font-family: var(--font-body) !important;
  font-size: 14.5px !important;
}

.last-dir.is-up {
  color: var(--up);
  font-weight: 800;
}

.last-dir.is-down {
  color: var(--down);
  font-weight: 800;
}

.last-repeat {
  flex: none;
  padding: 7px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.settings {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card-fill);
  box-shadow: var(--card-edge);
  list-style: none;
  overflow: hidden;
}

.settings > li + li {
  border-top: 1px solid var(--line);
}

.setting {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  text-align: left;
}

button.setting:active {
  background: rgba(var(--accent-rgb), 0.05);
}

.setting > svg:first-child {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.setting-label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.setting-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.setting .chevron {
  width: 18px;
  height: 18px;
  stroke: var(--faint);
}

.setting-select {
  max-width: 50%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 600;
}

.switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.12);
  transition: background-color 200ms ease;
}

.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 220ms var(--ease-in-out);
}

.switch[aria-checked="true"] {
  background: var(--accent-deep);
}

.switch[aria-checked="true"] span {
  transform: translateX(20px);
}

.profile-disclaimer {
  margin: 18px 4px 0;
  text-align: center;
}

/* ---------- Admin ---------- */

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
}

.back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.periods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 12px 0;
}

.periods button {
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.periods button[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

.totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.total {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-fill);
}

.total dt {
  color: var(--muted);
  font-size: 12.5px;
}

.total dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.admin[aria-busy="true"] .totals {
  opacity: 0.5;
}

.people {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.person {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(15, 25, 50, 0.75);
}

.person p {
  margin: 0;
}

.person-name {
  font-weight: 700;
}

.person-name span {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 500;
}

.person-id,
.person-note,
.person-date {
  color: var(--muted);
  font-size: 12.5px;
}

.person-money {
  text-align: right;
}

.person-amount {
  color: var(--up);
  font-weight: 800;
}

.person-amount.is-empty {
  color: var(--faint);
}

.person-date {
  grid-column: 1 / -1;
}

/* ---------- Footer ---------- */

.foot {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 28px;
  text-align: center;
}

.foot-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.foot-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.foot .disclaimer {
  max-width: 40ch;
  margin: 0;
}

/* ---------- Less motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ticker-viewport {
    overflow-x: auto;
    mask-image: none;
  }

  .ticker-track {
    animation: none !important;
  }

  .ticker-run + .ticker-run {
    display: none;
  }

  .radar-sweep {
    background: conic-gradient(from 300deg, rgba(var(--accent-rgb), 0) 0deg, rgba(var(--accent-rgb), 0.3) 58deg, rgba(var(--accent-rgb), 0) 60deg);
  }
}
