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

:root {
  --bg:        #0b0b12;
  --surface:   #11111c;
  --surface2:  #171726;
  --border:    #1f1f35;
  --accent:    #7c6dfa;
  --accent2:   #a78bfa;
  --green:     #34d399;
  --red:       #f87171;
  --text:      #e2e2f0;
  --muted:     #6b6b8a;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'Inter', sans-serif;
}

[data-theme="light"] {
  --bg:       #f9f9fb;
  --surface:  #ffffff;
  --surface2: #f0f0f4;
  --border:   #e0e0e8;
  --accent:   #5b4ee8;
  --accent2:  #7c6dfa;
  --green:    #059669;
  --red:      #dc2626;
  --text:     #0d0d14;
  --muted:    #707088;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Snow ── */
#snow { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  height: 56px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
  color: var(--text);
}
.logo .dot { color: var(--accent); }

/* ── Ticker ── */
.ticker {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
}
.ticker-inner {
  display: flex;
  gap: 32px;
  width: max-content;
  will-change: transform;
}
.ticker-inner.animating {
  animation: scroll 40s linear infinite;
}
.ticker-inner:hover { animation-play-state: paused; }

@keyframes scroll {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.tick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
}
.tick-item img { width: 18px; height: 18px; border-radius: 50%; }
.tick-sym { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; }
.tick-price { color: var(--text); font-family: var(--mono); }
.tick-change.pos { color: var(--green); }
.tick-change.neg { color: var(--red); }

/* ── Gas widget ── */
.gas-widget {
  display: flex; align-items: center; gap: 5px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 12px;
  font-size: 0.72rem; font-family: var(--mono);
  white-space: nowrap; flex-shrink: 0;
  transition: border-color .2s, background .2s, transform .15s;
  cursor: default;
}
.gas-widget:hover {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-1px);
}
.gas-widget svg { width: 13px; height: 13px; color: var(--muted); margin-right: 2px; }
.gas-val { font-weight: 600; }
.gas-val.low  { color: var(--green); }
.gas-val.med  { color: #fbbf24; }
.gas-val.high { color: var(--red); }
.gas-sep { color: var(--border); }
.gas-unit { color: var(--muted); font-size: 0.65rem; margin-left: 1px; }

/* ── Header right group ── */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Theme toggle ── */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; flex-shrink: 0;
  transition: color .2s, background .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle svg { width: 15px; height: 15px; }

/* ── Online badge ── */
.online-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 10px;
  font-size: 0.72rem; font-family: var(--mono);
  white-space: nowrap; flex-shrink: 0;
  color: var(--text); cursor: default;
  transition: border-color .2s, background .2s, transform .15s;
}
.online-badge:hover {
  border-color: var(--green);
  background: var(--surface);
  transform: translateY(-1px);
}
.online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50% { opacity: 0.6; box-shadow: 0 0 10px var(--green); }
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 80px 24px 56px;
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.accent { color: var(--accent2); }
.sub {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 36px;
}

/* ── Search ── */
.search-wrap { max-width: 640px; margin: 0 auto; }
.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,109,250,.15); }
.search-icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; margin-right: 10px; }

input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  caret-color: var(--accent);
}
input::placeholder { color: var(--muted); font-family: var(--sans); }

button#searchBtn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
button#searchBtn:hover  { background: var(--accent2); }
button#searchBtn:active { transform: scale(0.97); }

.search-caps {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: 0.72rem; color: var(--muted); margin-top: 10px; flex-wrap: wrap;
}
.search-cap-dot { color: var(--border); }

.search-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 10px;
  min-height: 18px;
  transition: color .2s;
}
.search-hint.error { color: var(--red); }

/* ── Main ── */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  gap: 40px;
}

/* ── Result card ── */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  animation: fadeUp .3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.result-header-left { display: flex; align-items: center; gap: 12px; }
.result-header-left img { width: 36px; height: 36px; border-radius: 50%; }
.coin-name { font-size: 1rem; font-weight: 600; }
.coin-address {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-all;
}
.result-actions { display: flex; gap: 8px; }

.btn-sm {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.btn-sm:hover { background: var(--border); border-color: var(--accent); }
.btn-sm.watch-active { border-color: var(--accent); color: var(--accent2); }

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-cell {
  background: var(--surface);
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 1.1rem; font-weight: 600; font-family: var(--mono); }
.stat-value.pos { color: var(--green); }
.stat-value.neg { color: var(--red); }

/* ── Transactions ── */
.txs-section { padding: 20px 24px; }
.txs-title { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }
.tx-list { display: flex; flex-direction: column; gap: 8px; }

.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 10px;
  font-size: 0.82rem;
  transition: background .15s;
}
.tx-row:hover { background: var(--border); }

.tx-sign {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.tx-sign.in  { background: rgba(52,211,153,.12); color: var(--green); }
.tx-sign.out { background: rgba(248,113,113,.12); color: var(--red); }

.tx-info { flex: 1; min-width: 0; }
.tx-dir  { font-weight: 500; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .3px; }
.tx-addr {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-addr a { color: inherit; text-decoration: none; }
.tx-addr a:hover { color: var(--accent2); }
.tx-amount { font-family: var(--mono); font-weight: 600; font-size: 0.88rem; white-space: nowrap; }
.tx-amount.in  { color: var(--green); }
.tx-amount.out { color: var(--red); }

.no-txs { color: var(--muted); font-size: 0.85rem; padding: 8px 0; }

/* ── Price search ── */
.price-search-wrap input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.82rem;
  outline: none;
  width: 200px;
  transition: border-color .2s;
}
.price-search-wrap input:focus { border-color: var(--accent); }
.price-search-wrap input::placeholder { color: var(--muted); }

/* ── Converter ── */
.converter-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; display: flex; align-items: stretch;
}
.cv-side {
  flex: 1; min-width: 0; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.cv-side-r { border-left: 1px solid var(--border); align-items: flex-end; }
.cv-coin-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 11px; cursor: pointer;
  color: var(--text); font-size: .85rem; font-weight: 700;
  font-family: var(--mono); transition: border-color .2s, background .2s;
  white-space: nowrap;
}
.cv-coin-btn:hover { border-color: var(--accent); background: var(--surface); }
.cv-coin-btn img { width: 20px; height: 20px; border-radius: 50%; }
.cv-amt {
  font-size: 2rem; font-family: var(--mono); font-weight: 600;
  background: transparent; border: none; outline: none;
  color: var(--text); width: 100%;
}
.cv-side-r .cv-amt { text-align: right; }
.cv-amt::placeholder { color: var(--muted); }
.cv-amt-out { color: var(--muted); cursor: default; }
.cv-swap-btn {
  width: 44px; flex-shrink: 0; background: transparent; border: none;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, background .2s;
}
.cv-swap-btn:hover,
.cv-swap-btn.cv-swap-active { color: var(--accent); background: rgba(124,109,250,.06); }
.cv-swap-btn.cv-swap-active svg { transform: rotate(180deg); }
.cv-swap-btn svg { width: 18px; height: 18px; transition: transform .35s cubic-bezier(.5,.1,.2,1.2); }
.cv-rate {
  margin-top: 8px; text-align: center;
  font-size: .78rem; font-family: var(--mono); color: var(--muted); min-height: 18px;
}
/* shared dropdown — position:fixed, never clipped */
#cvDrop {
  position: fixed; z-index: 9000;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
  width: 240px;
}
.cv-drop-search {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text);
  font-size: .85rem; outline: none; margin-bottom: 6px;
  transition: border-color .2s;
}
.cv-drop-search:focus { border-color: var(--accent); }
#cvDropList {
  list-style: none; max-height: 220px; overflow-y: auto;
}
#cvDropList li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: background .1s;
}
#cvDropList li:hover { background: var(--surface2); }
#cvDropList li.cv-active { background: rgba(124,109,250,.14); }
#cvDropList img { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }
#cvDropList .cv-fallback { width: 22px; height: 22px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: .6rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }
#cvDropList .cv-sym { font-weight: 700; font-size: .82rem; text-transform: uppercase; }
#cvDropList .cv-name { font-size: .7rem; color: var(--muted); }

/* ── Price grid ── */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  cursor: default;
  position: relative;
  overflow: hidden;
  transition: border-color .25s ease, transform .2s ease, box-shadow .25s ease;
  animation: fadeUp .25s ease;
}
.price-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    140px circle at var(--mx, 50%) var(--my, 50%),
    rgba(124,109,250,.18) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}
.price-card:hover {
  border-color: rgba(124,109,250,.55);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,.35), 0 0 0 1px rgba(124,109,250,.15);
}
.price-card:hover::before { opacity: 1; transition: opacity .15s ease; }
.price-card:not(:hover)::before { opacity: 0; transition: opacity .5s ease; }
.price-card > * { position: relative; z-index: 1; }

.price-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.price-card-header img { width: 26px; height: 26px; border-radius: 50%; }
.price-card-sym { font-size: 0.82rem; font-weight: 600; text-transform: uppercase; }
.price-card-name { font-size: 0.7rem; color: var(--muted); }

.price-card-price { font-family: var(--mono); font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.price-card-change { font-size: 0.78rem; font-weight: 500; }
.price-card-change.pos { color: var(--green); }
.price-card-change.neg { color: var(--red); }
.price-card-range { font-size: 0.7rem; color: var(--muted); margin-top: 6px; font-family: var(--mono); }

/* ── Watchlist ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 1rem; font-weight: 600; }
.badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}

.watchlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.watch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
  position: relative;
  animation: fadeUp .25s ease;
}
.watch-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.watch-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.watch-card-coin { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; }
.watch-card-coin img { width: 22px; height: 22px; border-radius: 50%; }

.watch-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
  transition: color .15s;
}
.watch-remove:hover { color: var(--red); }

.watch-addr {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 12px;
}
.watch-balance { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; }
.watch-loading { color: var(--muted); font-size: 0.82rem; }

/* ── Empty state ── */
.empty-state {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 24px;
  color: var(--muted);
  text-align: center;
}
.empty-state svg { width: 36px; height: 36px; opacity: .4; }
.empty-state p { font-size: 0.875rem; line-height: 1.6; }

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.result-skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp .2s ease;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%; max-width: 680px;
  overflow: hidden;
  animation: fadeUp .2s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.modal-title-wrap { display: flex; align-items: center; gap: 12px; }
.modal-title-wrap img { width: 36px; height: 36px; border-radius: 50%; }
.modal-name { font-size: 1rem; font-weight: 600; }
.modal-price { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.modal-close {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px; width: 32px; height: 32px;
  cursor: pointer; font-size: 0.85rem; transition: color .15s;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--red); border-color: var(--red); }

.range-tabs { display: flex; gap: 4px; }
.range-tab {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); border-radius: 7px; padding: 5px 10px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.range-tab:hover { border-color: var(--accent); color: var(--text); }
.range-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.modal-body { padding: 24px; min-height: 280px; position: relative; }
.chart-loading {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 0.875rem;
}

/* ── Sync box ── */
.sync-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.sync-input-wrap { display: flex; gap: 10px; flex-wrap: wrap; }
.sync-input-wrap input {
  flex: 1; min-width: 200px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  outline: none;
  transition: border-color .2s;
}
.sync-input-wrap input:focus { border-color: var(--accent); }
.sync-input-wrap input::placeholder { color: var(--muted); font-family: var(--sans); }
.sync-input-wrap button {
  background: var(--accent);
  color: #fff; border: none;
  border-radius: 10px; padding: 10px 22px;
  font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
  white-space: nowrap;
}
.sync-input-wrap button:hover { background: var(--accent2); }
#syncResult { margin-top: 14px; }

.synced-wallets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.synced-tag {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px;
  font-size: 0.78rem; cursor: pointer;
  transition: border-color .15s;
}
.synced-tag:hover { border-color: var(--accent); }
.synced-tag img { width: 16px; height: 16px; border-radius: 50%; }
.synced-tag .stag-sym { font-weight: 600; text-transform: uppercase; color: var(--muted); font-size: 0.7rem; }
.synced-tag .stag-addr { font-family: var(--mono); color: var(--text); }

/* ── LTC stats ── */
.modal-wide { max-width: 780px; }

.ltc-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.ltc-stat {
  background: var(--surface2);
  padding: 14px 16px;
}
.ltc-stat-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.ltc-stat-val { font-family: var(--mono); font-size: 0.95rem; font-weight: 600; }
.ltc-stat-sub { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.ltc-stat-val.pos { color: var(--green); }
.ltc-stat-val.neg { color: var(--red); }

.ltc-months { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; }
.ltc-month-row {
  display: grid; grid-template-columns: 140px 1fr 1fr 1fr auto;
  align-items: center; gap: 12px;
  background: var(--surface2); border-radius: 10px; padding: 12px 16px;
  font-size: 0.82rem;
}
.ltc-month-name { font-weight: 600; }
.ltc-month-val { font-family: var(--mono); }
.ltc-month-val.pos { color: var(--green); }
.ltc-month-val.neg { color: var(--red); }
.ltc-month-txs { color: var(--muted); font-size: 0.75rem; }
.ltc-sync-note { font-size: 0.75rem; color: var(--muted); margin-top: 8px; }

/* ── TX Flow ── */
.tx-io-list { display: flex; flex-direction: column; gap: 4px; }
.tx-io-row {
  display: grid; grid-template-columns: 36px 1fr auto auto;
  align-items: center; gap: 10px;
  background: var(--surface2); border-radius: 8px; padding: 9px 12px;
  font-size: 0.82rem;
}
.tx-io-label { font-size: 0.68rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.tx-io-addr { font-family: var(--mono); color: var(--text); }
.tx-io-val { font-family: var(--mono); color: var(--text); text-align: right; }
.tx-io-usd { color: var(--muted); font-size: 0.75rem; text-align: right; min-width: 60px; }
.tx-io-divider { text-align: center; color: var(--muted); font-size: 1rem; padding: 2px 0; }
.stat-value.warn { color: #fbbf24; }

/* ── Receive Modal ── */
.modal-receive { max-width: 420px; }
.rcv-body { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px; }
.qr-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  line-height: 0;
}
.qr-img { width: 200px; height: 200px; display: block; }
.rcv-addr-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; width: 100%;
}
.rcv-addr {
  font-family: var(--mono); font-size: 0.72rem; color: var(--text);
  word-break: break-all; flex: 1;
}
.rcv-amount-row { width: 100%; }
.rcv-amount-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rcv-label { font-size: 0.75rem; color: var(--muted); }
.rcv-pill {
  display: flex; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 99px; padding: 2px; gap: 2px;
}
.rcv-pill-opt {
  font-size: 0.7rem; font-weight: 600; padding: 3px 10px;
  border-radius: 99px; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.rcv-pill-opt.active { background: var(--accent); color: #fff; }
.rcv-amount-wrap {
  display: flex; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.rcv-amount-wrap input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--mono); font-size: 0.9rem;
  padding: 8px 12px;
}
.rcv-amount-wrap input::-webkit-outer-spin-button,
.rcv-amount-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rcv-amount-wrap input[type=number] { -moz-appearance: textfield; }
.rcv-sym { padding: 0 0 0 12px; color: var(--muted); font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.rcv-uri {
  font-family: var(--mono); font-size: 0.68rem; color: var(--muted);
  word-break: break-all; text-align: center; width: 100%;
}

/* ── Custom tooltip ── */
.tip-box {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
  max-width: 260px;
  white-space: normal;
}
.tip-box.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  /* Header */
  header {
    padding: 0;
    gap: 0;
    height: auto;
    flex-direction: column;
    align-items: stretch;
  }
  .logo {
    font-size: 1.1rem;
    padding: 0 14px;
    height: 46px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
  }
  .ticker {
    flex: none;
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .header-right {
    width: 100%;
    border-bottom: 1px solid var(--border);
    padding: 0 14px;
    height: 38px;
    gap: 10px;
    justify-content: center;
  }
  .gas-widget, .online-badge {
    border-radius: 0;
    border: none;
    background: transparent;
    padding: 0;
  }
  .gas-widget { border-left: 1px solid var(--border); padding-left: 10px; }
  .theme-toggle { margin-left: auto; }

  /* Converter */
  .converter-card { flex-direction: column; }
  .cv-side { padding: 14px 16px; }
  .cv-side-r { border-left: none; border-top: 1px solid var(--border); align-items: flex-start; }
  .cv-side-r .cv-amt { text-align: left; }
  .cv-amt { font-size: 1.5rem; }
  .cv-swap-btn { width: 100%; height: 40px; border-left: none; border-right: none; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  #cvDrop { width: calc(100vw - 32px); }

  /* Hero */
  .hero { padding: 40px 16px 32px; }
  .hero h1 { font-size: clamp(1.6rem, 8vw, 2.4rem); letter-spacing: -.5px; }
  .sub { font-size: 0.9rem; margin-bottom: 24px; }

  /* Search — 16px prevents iOS auto-zoom on focus */
  .search-box { border-radius: 12px; padding: 5px 5px 5px 12px; }
  .search-icon { width: 16px; height: 16px; margin-right: 8px; }
  input, select, textarea { font-size: 16px; }
  button#searchBtn { padding: 9px 16px; font-size: 0.82rem; border-radius: 9px; }
  .search-caps { font-size: 0.68rem; gap: 4px; }

  /* Main */
  main { padding: 0 14px 60px; gap: 28px; }

  /* Result card */
  .result-header { padding: 16px; }
  .result-header-left img { width: 28px; height: 28px; }
  .coin-name { font-size: 0.92rem; }
  .result-actions {
    display: flex; flex-wrap: wrap; gap: 6px; width: 100%;
  }
  .btn-sm { padding: 6px 11px; font-size: 0.75rem; }

  /* Stats grid */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cell { padding: 14px 16px; }
  .stat-value { font-size: 0.95rem; }

  /* Txs */
  .txs-section { padding: 14px 16px; }
  .tx-row { padding: 9px 10px; gap: 8px; }
  .tx-sign { width: 24px; height: 24px; font-size: 0.85rem; }
  .tx-amount { font-size: 0.82rem; }

  /* TX flow (tx lookup) */
  .tx-io-row {
    grid-template-columns: 32px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 8px;
  }
  .tx-io-val { grid-column: 2; }
  .tx-io-usd { grid-column: 2; font-size: 0.7rem; }

  /* Price grid */
  .price-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .price-card { padding: 12px; }
  .price-card-price { font-size: 0.92rem; }

  /* Section header */
  .section-header { flex-wrap: wrap; gap: 8px; }
  .price-search-wrap input { width: 100%; }

  /* Watchlist */
  .watchlist { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .watch-card { padding: 12px; }
  .watch-balance { font-size: 0.95rem; }

  /* Sync box */
  .sync-box { padding: 14px; }
  .sync-input-wrap { flex-direction: column; }
  .sync-input-wrap button { width: 100%; }

  /* Modals */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 90dvh;
    overflow-y: auto;
  }
  .modal-wide { max-height: 90dvh; }
  .modal-header { padding: 16px; flex-wrap: wrap; gap: 10px; }
  .modal-body { padding: 16px; }
  .range-tabs { gap: 3px; }
  .range-tab { padding: 4px 8px; font-size: 0.7rem; }

  /* LTC stats */
  .ltc-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ltc-month-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 6px 12px;
  }
  .ltc-month-name { grid-column: 1 / -1; font-size: 0.85rem; }
  .ltc-month-txs { grid-column: 1 / -1; }

  /* Receive modal */
  .modal-receive { border-radius: 20px 20px 0 0; }
  .rcv-body { padding: 16px; gap: 14px; }
  .qr-img { width: 180px; height: 180px; }
}
