:root {
  --bg-deep: #030806;
  --bg-base: #061410;
  --bg-surface: #0A1C16;
  --bg-elevated: #0E2A20;
  --border: rgba(124, 243, 192, 0.12);
  --grid: rgba(22, 224, 138, 0.09);
  --accent: #16E08A;
  --accent-deep: #0B8A55;
  --accent-soft: #7CF3C0;
  --up: #16E08A;
  --down: #FF4E64;
  --text: #E8F7F0;
  --text-muted: #7C9C8E;
  --particle: rgba(124, 243, 192, 0.75);

  --font-display: 'Unbounded', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --shell: 540px;
  --gutter: 18px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --header-height: 62px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--bg-base) 0%, var(--bg-deep) 62%),
    var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 100%; height: 100%; display: block; }

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

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, 0.35) 100%);
}

.bg-bloom {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(46% 30% at 18% 8%, rgba(22, 224, 138, 0.16), transparent 70%),
    radial-gradient(40% 26% at 88% 32%, rgba(11, 138, 85, 0.18), transparent 72%),
    radial-gradient(60% 40% at 50% 108%, rgba(22, 224, 138, 0.12), transparent 70%);
  animation: bloom-drift 26s ease-in-out infinite alternate;
}

@keyframes bloom-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, -3%, 0) scale(1.07); }
}

.app {
  position: relative;
  z-index: 1;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
  opacity: 0;
  transition: opacity 0.5s ease;
}

body.is-ready .app { opacity: 1; }

.app-main {
  padding-top: var(--header-height);
  padding-bottom: 132px;
}

.screen { display: none; }
.screen.is-active { display: block; }

.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: var(--header-height);
  width: min(var(--shell), 100vw);
  margin: 0;
  padding: 0 var(--gutter);
}

.app-header::before,
.app-header::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  z-index: -1;
}

.app-header::before {
  top: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(3, 8, 6, 0.92) 60%, rgba(3, 8, 6, 0.62));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.app-header::after {
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 243, 192, 0.28), transparent);
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }

.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  filter: drop-shadow(0 3px 12px rgba(22, 224, 138, 0.5));
}

.brand__name {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  white-space: nowrap;
}

.brand__accent {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(22, 224, 138, 0.55);
}

.app-header__actions { display: flex; align-items: center; gap: 7px; flex: none; }

.lang { position: relative; }

.lang__button {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 8px 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 28, 22, 0.7);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.lang__button.is-open,
.lang__button:hover { border-color: rgba(124, 243, 192, 0.34); background: var(--bg-elevated); }

.lang__icon { width: 16px; height: 16px; color: var(--text-muted); }
.lang__value { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; }
.lang__chevron { width: 13px; height: 13px; color: var(--text-muted); transition: transform 0.2s var(--ease); }
.lang__button.is-open .lang__chevron { transform: rotate(180deg); }

.lang__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 84px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(6, 20, 16, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 2px;
  z-index: 30;
}

.lang__menu[hidden] { display: none; }

.lang__option {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: left;
  color: var(--text-muted);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.lang__option:hover { background: var(--bg-elevated); color: var(--text); }
.lang__option.is-current { color: var(--accent); background: rgba(22, 224, 138, 0.09); }

.support-button {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px 0 10px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent) 55%, var(--accent-deep));
  color: #04120C;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(22, 224, 138, 0.32);
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease);
}

.support-button:active { transform: scale(0.96); }
.support-button__icon { width: 17px; height: 17px; flex: none; }

@media (max-width: 400px) {
  :root { --gutter: 14px; }
}

@media (max-width: 339px) {
  .support-button__label { display: none; }
  .support-button { padding: 0 10px; }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.65s var(--ease) var(--reveal-delay, 0ms),
    transform 0.65s var(--ease) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-visible { opacity: 1; transform: none; }

.hero { padding: 30px 0 26px; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 28, 22, 0.6);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.hero__badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(22, 224, 138, 0.6);
  animation: pulse-dot 2.4s ease-out infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(22, 224, 138, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(22, 224, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 224, 138, 0); }
}

.hero__title {
  margin: 18px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(30px, 8.6vw, 40px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero__accent {
  font-style: normal;
  color: var(--accent);
  text-shadow: 0 0 34px rgba(22, 224, 138, 0.45);
}

.hero__text { color: var(--text-muted); max-width: 46ch; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 42px;
}

.stat {
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(14, 42, 32, 0.7), rgba(6, 20, 16, 0.5));
  text-align: center;
}

.stat__value {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-soft);
  letter-spacing: -0.02em;
}

.stat__label {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-muted);
}

.block { margin-bottom: 42px; }

.block-head__eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.block-head__heading {
  margin: 10px 0 20px;
  font-family: var(--font-display);
  font-size: clamp(21px, 5.6vw, 26px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.18;
}

.step-list { display: grid; gap: 10px; }

.step {
  display: flex;
  gap: 14px;
  padding: 16px 16px 16px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(140deg, rgba(14, 42, 32, 0.55), rgba(6, 20, 16, 0.45));
  position: relative;
  overflow: hidden;
}

.step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), transparent);
}

.step__index {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  padding-top: 2px;
}

.step__body { min-width: 0; }
.step__title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.step__text { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.feature {
  padding: 15px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(10, 28, 22, 0.5);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.feature:hover { border-color: rgba(124, 243, 192, 0.3); transform: translateY(-2px); }
.feature__title { font-size: 14.5px; font-weight: 700; margin-bottom: 5px; }
.feature__text { font-size: 12.8px; color: var(--text-muted); line-height: 1.48; }

.disclaimer {
  padding: 16px;
  border: 1px solid rgba(255, 78, 100, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(140deg, rgba(255, 78, 100, 0.08), rgba(6, 20, 16, 0.4));
}

.disclaimer__title { font-size: 14px; font-weight: 700; color: #FF8A97; margin-bottom: 6px; }
.disclaimer__text { font-size: 12.8px; color: var(--text-muted); line-height: 1.5; }

.block-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin: 0 0 13px;
}

.block-head__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.block-head__hint { margin-left: auto; font-size: 11.5px; color: var(--text-muted); text-align: right; }

.screen[data-screen='signals'] .block:first-child { padding-top: 24px; }

.pair-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.pair {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(10, 28, 22, 0.55);
  text-align: left;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}

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

.pair.is-selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(22, 224, 138, 0.18), rgba(10, 28, 22, 0.6));
  box-shadow: 0 0 0 1px rgba(22, 224, 138, 0.35), 0 8px 26px rgba(22, 224, 138, 0.18);
}

.pair__flags { display: flex; flex: none; }

.pair__flags i {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid rgba(0, 0, 0, 0.4);
  font-size: 11px;
  font-style: normal;
  line-height: 1;
  overflow: hidden;
}

.pair__flags i:last-child { margin-left: -8px; }

.pair__name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.pair.is-selected .pair__name { color: var(--accent-soft); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  flex: 1 1 calc(33.333% - 6px);
  padding: 11px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(10, 28, 22, 0.55);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}

.chip:active { transform: scale(0.96); }

.chip.is-selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(22, 224, 138, 0.2), rgba(10, 28, 22, 0.6));
  color: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(22, 224, 138, 0.32), 0 8px 24px rgba(22, 224, 138, 0.16);
}

.cta-dock { padding: 4px 0 8px; }

.primary-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-soft), var(--accent) 48%, var(--accent-deep));
  color: #04120C;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 34px rgba(22, 224, 138, 0.32);
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s var(--ease);
}

.primary-button:active { transform: scale(0.985); }

.primary-button:disabled {
  background: rgba(14, 42, 32, 0.8);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.primary-button__icon { width: 19px; height: 19px; }
.primary-button:disabled .primary-button__icon { opacity: 0.5; }

.primary-button__arrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.18s var(--ease);
}

.primary-button--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
  height: 50px;
}

.auth-action {
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .auth-action:hover {
    transform: scale(1.025);
    box-shadow: 0 14px 40px rgba(22, 224, 138, 0.4);
  }

  .auth-action.primary-button--ghost:hover {
    box-shadow: 0 10px 30px rgba(22, 224, 138, 0.12);
    border-color: rgba(124, 243, 192, 0.32);
    background: rgba(10, 28, 22, 0.28);
  }

  .auth-action--registration:hover .primary-button__arrow {
    transform: translateX(5px);
  }
}

.cta-dock__hint {
  margin-top: 9px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.analysis {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: calc(100dvh - var(--header-height));
  margin-bottom: -132px;
  padding: 30px 0 132px;
  animation: fade-in 0.4s var(--ease);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.analysis__eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.analysis__pair {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

.ring {
  position: relative;
  width: min(258px, 68vw);
  aspect-ratio: 1;
  margin: 26px 0 4px;
  display: grid;
  place-items: center;
}

.ring__svg-wrap { position: absolute; inset: 0; transform: rotate(-90deg); }

.ring__track {
  fill: none;
  stroke: rgba(124, 243, 192, 0.1);
  stroke-width: 6;
}

.ring__value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(22, 224, 138, 0.75));
}

.ring__halo {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(22, 224, 138, 0.32) 90deg, transparent 200deg);
  filter: blur(16px);
  animation: spin 3.6s linear infinite;
}

.ring__dashes {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  border: 1px dashed rgba(124, 243, 192, 0.22);
  animation: spin 22s linear infinite reverse;
}

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

.ring__center { display: flex; align-items: baseline; gap: 2px; }

.ring__percent {
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--text);
  text-shadow: 0 0 26px rgba(22, 224, 138, 0.35);
  font-variant-numeric: tabular-nums;
}

.ring__unit { font-family: var(--font-mono); font-size: 18px; color: var(--accent); }

.ring__step {
  min-height: 24px;
  font-size: 14.5px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.ring__step.is-swap { animation: step-swap 0.45s var(--ease); }

@keyframes step-swap {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.analysis__bars { display: flex; gap: 5px; align-items: flex-end; height: 26px; margin-top: 20px; }

.analysis__bars span {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), rgba(22, 224, 138, 0.15));
  transform-origin: bottom;
  animation: equalize 1.15s ease-in-out infinite;
  animation-delay: calc(var(--bar-index) * 0.11s);
}

@keyframes equalize {
  0%, 100% { transform: scaleY(0.28); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--header-height));
  margin-bottom: -132px;
  padding: 26px 0 132px;
  animation: fade-in 0.45s var(--ease);
}

.result__eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.result__card {
  position: relative;
  width: 100%;
  padding: 26px 20px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, rgba(14, 42, 32, 0.85), rgba(6, 20, 16, 0.72));
  overflow: hidden;
  text-align: center;
}

.result.is-up .result__card { border-color: rgba(22, 224, 138, 0.4); box-shadow: 0 18px 60px rgba(22, 224, 138, 0.2); }
.result.is-down .result__card { border-color: rgba(255, 78, 100, 0.4); box-shadow: 0 18px 60px rgba(255, 78, 100, 0.18); }

.result__glow {
  position: absolute;
  left: 50%;
  top: -46%;
  width: 118%;
  height: 90%;
  transform: translateX(-50%);
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.55;
}

.result.is-up .result__glow { background: radial-gradient(circle, rgba(22, 224, 138, 0.6), transparent 66%); }
.result.is-down .result__glow { background: radial-gradient(circle, rgba(255, 78, 100, 0.5), transparent 66%); }

.result__pair {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--text-muted);
}

.result__flags { font-size: 15px; letter-spacing: -2px; }

.result__direction {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 6px;
}

.result__arrow {
  width: 52px;
  height: 52px;
  padding: 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  animation: arrow-in 0.55s var(--ease) both;
}

.result.is-up .result__arrow {
  color: #04120C;
  background: linear-gradient(140deg, var(--accent-soft), var(--accent));
  box-shadow: 0 8px 30px rgba(22, 224, 138, 0.5);
}

.result.is-down .result__arrow {
  color: #1A0508;
  background: linear-gradient(140deg, #FF8A97, var(--down));
  box-shadow: 0 8px 30px rgba(255, 78, 100, 0.45);
}

@keyframes arrow-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: none; }
}

.result__word {
  font-family: var(--font-display);
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.result.is-up .result__word { color: var(--up); text-shadow: 0 0 40px rgba(22, 224, 138, 0.45); }
.result.is-down .result__word { color: var(--down); text-shadow: 0 0 40px rgba(255, 78, 100, 0.4); }

.result__accuracy { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 8px; }

.result__accuracy-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.result__accuracy-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.result__meta {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.result__meta dt {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.result__meta dd {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.result .primary-button--ghost { margin-top: 14px; }

.screen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 26px 0 20px;
}

.screen-head__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 6vw, 27px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.screen-head__subtitle { margin-top: 6px; font-size: 12.8px; color: var(--text-muted); max-width: 32ch; }
.screen-head__aside { display: flex; align-items: center; gap: 8px; }

.counter-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 28, 22, 0.6);
  font-size: 11px;
  color: var(--text-muted);
}

.counter-pill b { font-family: var(--font-mono); font-size: 13px; color: var(--accent-soft); }

.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.ghost-button__icon { width: 15px; height: 15px; }

.ghost-button--danger:not(:disabled):hover {
  border-color: rgba(255, 78, 100, 0.45);
  background: rgba(255, 78, 100, 0.1);
  color: #FF8A97;
}

.ghost-button:disabled { opacity: 0.4; cursor: not-allowed; }

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

.history-row {
  display: flex;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(10, 28, 22, 0.5);
  position: relative;
  overflow: hidden;
}

.history-row__bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.history-row.is-up .history-row__bar { background: linear-gradient(180deg, var(--up), rgba(22, 224, 138, 0.1)); }
.history-row.is-down .history-row__bar { background: linear-gradient(180deg, var(--down), rgba(255, 78, 100, 0.1)); }

.history-row__main { flex: 1; min-width: 0; }
.history-row__top { display: flex; align-items: center; gap: 8px; }
.history-row__flags { font-size: 14px; letter-spacing: -3px; flex: none; }

.history-row__pair {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.history-row__direction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px 9px 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.history-row.is-up .history-row__direction { background: rgba(22, 224, 138, 0.14); color: var(--up); }
.history-row.is-down .history-row__direction { background: rgba(255, 78, 100, 0.14); color: var(--down); }
.history-row__arrow { width: 12px; height: 12px; }

.history-row__bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.history-row__meta, .history-row__accuracy { font-family: var(--font-mono); }
.history-row__accuracy { color: var(--accent-soft); }
.history-row__stamp { margin-left: auto; font-family: var(--font-mono); font-size: 11px; }

.empty-state {
  padding: 46px 24px;
  border: 1px dashed rgba(124, 243, 192, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(10, 28, 22, 0.35);
  text-align: center;
}

.empty-state__icon { width: 30px; height: 30px; margin: 0 auto 14px; color: var(--accent); opacity: 0.65; }
.empty-state__title { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.empty-state__text { margin-top: 7px; font-size: 12.8px; color: var(--text-muted); }

.app-main.auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: calc(var(--header-height) + 14px) 0 max(18px, env(safe-area-inset-bottom, 0px));
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(100%, 404px);
  margin: auto;
  padding: 32px 20px 22px;
  border: 1px solid rgba(124, 243, 192, 0.14);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(155deg, rgba(14, 42, 32, 0.56), rgba(3, 12, 9, 0.38) 58%),
    rgba(3, 8, 6, 0.34);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  overflow: hidden;
  text-align: center;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.auth-card--registration {
  padding-top: 30px;
}

.auth-card--check {
  width: min(100%, 428px);
  padding-top: 62px;
}

.auth-card--error {
  border-color: rgba(255, 78, 100, 0.2);
  background:
    linear-gradient(155deg, rgba(56, 22, 27, 0.38), rgba(3, 12, 9, 0.42) 58%),
    rgba(3, 8, 6, 0.36);
}

.auth-card::before {
  content: '';
  position: absolute;
  z-index: 0;
  left: 50%;
  top: -46%;
  width: 115%;
  height: 78%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 224, 138, 0.2), transparent 68%);
  filter: blur(34px);
  opacity: 0.72;
}

.auth-card--error::before {
  background: radial-gradient(circle, rgba(255, 78, 100, 0.16), transparent 68%);
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-card--error .auth-card__eyebrow {
  color: #FF8A97;
}

.auth-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.88;
}

.auth-card__title {
  max-width: 12.5em;
  margin: 9px auto 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 6.2vw, 31px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.auth-card__text {
  max-width: 33ch;
  margin: 14px auto 23px;
  color: var(--text-muted);
  font-size: 13.4px;
  line-height: 1.58;
}

.auth-card__back {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  height: 34px;
  min-height: 0;
  padding: 0 11px 0 9px;
  border: 1px solid rgba(124, 243, 192, 0.18);
  border-radius: 999px;
  background: rgba(3, 14, 10, 0.56);
  color: rgba(232, 247, 240, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}

.auth-card__back-icon {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  transform: translateY(-0.5px);
}

.auth-card__back:hover {
  transform: translateX(-2px);
  border-color: rgba(124, 243, 192, 0.34);
  background: rgba(10, 28, 22, 0.42);
  color: var(--text);
}

.auth-card__back:focus-visible,
.auth-form__input:focus-visible,
.auth-action:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}

.auth-card__loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 54px;
}

.auth-card__loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(22, 224, 138, 0.7);
  animation: auth-loader 1s ease-in-out infinite;
  animation-delay: calc(var(--dot-index, 0) * 0.12s);
}

.auth-card__loader span:nth-child(2) { --dot-index: 1; }
.auth-card__loader span:nth-child(3) { --dot-index: 2; }

@keyframes auth-loader {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50% { transform: translateY(-7px); opacity: 1; }
}

.auth-form {
  display: grid;
  gap: 13px;
  text-align: left;
}

.auth-steps {
  display: grid;
  gap: 10px;
  margin: 0 0 9px;
}

.auth-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-areas:
    "index title"
    ". text";
  column-gap: 12px;
  row-gap: 6px;
  padding: 14px 13px 15px;
  border: 1px solid rgba(124, 243, 192, 0.12);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(14, 42, 32, 0.48), rgba(3, 16, 12, 0.23));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 10px 28px rgba(0, 0, 0, 0.12);
}

.auth-step__index {
  grid-area: index;
  align-self: center;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(124, 243, 192, 0.2);
  background: rgba(22, 224, 138, 0.12);
  color: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(22, 224, 138, 0.08);
}

.auth-step__title {
  grid-area: title;
  align-self: center;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 13.6px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--text);
}

.auth-step__text {
  grid-area: text;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.52;
}

.auth-form__separator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 11px;
  margin: 8px 0 1px;
  color: rgba(124, 156, 142, 0.88);
  font-family: var(--font-mono);
  font-size: 9.3px;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.auth-form__separator span {
  white-space: nowrap;
}

.auth-form__separator::before,
.auth-form__separator::after {
  content: '';
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 156, 142, 0.26));
}

.auth-form__separator::after {
  background: linear-gradient(90deg, rgba(124, 156, 142, 0.26), transparent);
}

.auth-form__label {
  display: grid;
  gap: 7px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.auth-form__input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(3, 12, 9, 0.62);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 0 14px;
  outline: none;
  caret-color: var(--accent);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.auth-form__input:focus {
  border-color: rgba(124, 243, 192, 0.48);
  background: rgba(3, 16, 12, 0.76);
  box-shadow: 0 0 0 3px rgba(22, 224, 138, 0.12);
}

.auth-card--check .auth-form {
  margin-top: 24px;
}

.auth-form__image {
  width: calc(100% + 16px);
  margin-inline: -8px;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  object-position: center 44%;
  border: 1px solid rgba(124, 243, 192, 0.12);
  border-radius: 14px;
  background: rgba(3, 8, 6, 0.48);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.auth-form__intro {
  display: grid;
  gap: 5px;
  text-align: center;
}

.auth-form__intro-main {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.38;
}

.auth-form__status {
  min-height: 20px;
  text-align: center;
  font-size: 12.8px;
  color: var(--text-muted);
}

.auth-form__status.is-error { color: #FF8A97; }
.auth-form__status.is-success { color: var(--accent-soft); }

.auth-error {
  display: grid;
  gap: 14px;
  text-align: left;
}

.auth-error__guide {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(255, 138, 151, 0.14);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 78, 100, 0.075), rgba(3, 16, 12, 0.25));
}

.auth-error__guide-title {
  color: #FFB2BA;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-error__step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: rgba(232, 247, 240, 0.86);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.auth-error__step-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 138, 151, 0.22);
  border-radius: 50%;
  background: rgba(255, 78, 100, 0.1);
  color: #FF9DA8;
  font-family: var(--font-mono);
  font-size: 10px;
}

.auth-error__retry {
  border-color: rgba(255, 138, 151, 0.2);
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 25;
  width: min(calc(var(--shell) - var(--gutter) * 2), calc(100vw - var(--gutter) * 2));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(6, 20, 16, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}

.tabbar__indicator {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc((100% - 12px) / 3);
  height: calc(100% - 12px);
  border-radius: 15px;
  background: linear-gradient(140deg, rgba(22, 224, 138, 0.22), rgba(22, 224, 138, 0.08));
  border: 1px solid rgba(22, 224, 138, 0.34);
  box-shadow: 0 6px 22px rgba(22, 224, 138, 0.2);
  transform: translateX(calc(var(--tab-index, 0) * 100%));
  transition: transform 0.34s var(--ease);
}

.tabbar__tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px 7px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  transition: color 0.22s var(--ease);
}

.tabbar__tab.is-active { color: var(--accent); }
.tabbar__icon { width: 21px; height: 21px; }
.tabbar__tab.is-active .tabbar__icon { filter: drop-shadow(0 0 8px rgba(22, 224, 138, 0.6)); }
.tabbar__label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; }

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 8, 6, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.dialog-overlay.is-open { opacity: 1; }

.dialog {
  width: 100%;
  max-width: 330px;
  padding: 22px 20px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(14, 42, 32, 0.98), rgba(6, 20, 16, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.25s var(--ease);
}

.dialog-overlay.is-open .dialog { transform: none; }

.dialog__title { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.dialog__text { margin-top: 8px; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }

.dialog__button {
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.dialog__button:hover { background: var(--bg-elevated); }

.dialog__button--danger {
  border-color: rgba(255, 78, 100, 0.4);
  background: rgba(255, 78, 100, 0.14);
  color: #FF8A97;
}

.dialog__button--danger:hover { background: rgba(255, 78, 100, 0.22); }

@media (min-width: 480px) {
  .pair-grid { grid-template-columns: repeat(3, 1fr); }
  .chip { flex-basis: calc(16.666% - 7px); }
}

@media (max-width: 400px) {
  .auth-card {
    width: 100%;
    padding-inline: 16px;
  }

  .auth-card__title {
    font-size: clamp(23px, 6.4vw, 29px);
  }

  .auth-step {
    padding: 12px 11px 13px;
  }

  .auth-step__title {
    font-size: 13px;
  }

  .auth-step__text {
    font-size: 12.2px;
  }
}

@media (max-height: 760px) {
  .app-main.auth-gate {
    align-items: center;
    padding-top: calc(var(--header-height) + 12px);
    padding-bottom: 14px;
  }

  .auth-card__title {
    font-size: clamp(22px, 5.8vw, 28px);
  }

  .auth-card__text {
    margin-bottom: 16px;
  }

  .auth-form {
    gap: 10px;
  }

  .auth-card--check {
    padding-top: 58px;
  }

  .auth-card--check .auth-form { margin-top: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .bg-bloom, .ring__halo, .ring__dashes, .analysis__bars span, .hero__badge-dot { animation: none; }
  .tabbar__indicator { transition: none; }
  * { scroll-behavior: auto !important; }
}
