:root {
  --bg: #0a0f1a;
  --card: #12182a;
  --card2: #1a2340;
  --muted: #8b95a8;
  --up: #16c784;
  --down: #f05252;
  --accent: #14d4c4;
  --accent2: #7c6af7;
  --text: #eef2ff;
  --glow: rgba(20, 212, 196, 0.22);
}

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

body {
  font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 60% at 50% -10%, rgba(20, 212, 196, 0.08), transparent 55%),
    radial-gradient(ellipse 80% 40% at 100% 0%, rgba(124, 106, 247, 0.06), transparent 50%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.app { max-width: 600px; margin: 0 auto; padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
.content { padding: 12px; }

/* brand */
.brand-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 10px;
  background: linear-gradient(180deg, rgba(18, 24, 42, 0.95), transparent);
}
.brand-bar img { border-radius: 11px; box-shadow: 0 4px 16px var(--glow); }
.brand-text strong {
  display: block; font-size: 20px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.brand-text span { font-size: 11px; color: var(--muted); }

/* BTC header */
.btc {
  padding: 14px 16px 16px; color: #fff;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.btc-top { display: flex; justify-content: space-between; align-items: center; }
.btc-brand { display: flex; align-items: center; gap: 8px; }
.btc-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.btc-name { font-size: 15px; font-weight: 700; }
.btc-rank { font-size: 11px; opacity: .75; }
.btc-price { font-size: 26px; font-weight: 700; margin: 8px 0 12px; letter-spacing: -.5px; }
.btc-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  background: rgba(0,0,0,.15); border-radius: 10px; padding: 8px;
}
.btc-stat { text-align: center; }
.btc-label { display: block; font-size: 10px; opacity: .8; margin-bottom: 2px; }
.btc-stat strong { font-size: 13px; font-weight: 600; }
.btc-foot {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-size: 11px; opacity: .9;
}
.btc-foot b { font-weight: 600; }
.badge { font-size: 11px; padding: 4px 10px; border-radius: 20px; background: rgba(255,255,255,.2); font-weight: 500; }
.signal-buy { background: linear-gradient(160deg, #0a7a45, #16c784); }
.signal-sell { background: linear-gradient(160deg, #a82828, #ea3943); }
.signal-neutral { background: linear-gradient(160deg, #c9970a, #f0b90b); color: #1a1205; }
.signal-neutral .badge { background: rgba(0,0,0,.15); color: #1a1205; }
.signal-neutral .btc-label { color: rgba(26,18,5,.75); }
.signal-neutral .btc-foot { color: rgba(26,18,5,.85); }
.signal-neutral .btc-rank { color: rgba(26,18,5,.65); }

.section { font-size: 15px; margin: 6px 4px 10px; }
.section-row { display: flex; justify-content: space-between; align-items: center; }
.refresh { color: var(--accent); font-size: 13px; text-decoration: none; }

/* coin list */
.coins { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.coin { display: flex; align-items: center; background: var(--card); border-radius: 12px; padding: 10px 12px; }
.coin-link { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.coin-name { font-weight: bold; }
.buy-score {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 8px;
  background: var(--glow); color: var(--accent);
}
.coin-price { margin-inline-start: auto; }
.chg { min-width: 64px; text-align: left; font-size: 13px; }
.up { color: var(--up); }
.down { color: var(--down); }
.empty { color: var(--muted); text-align: center; padding: 30px; }

.star { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; padding: 0 6px; }
.star.saved { color: var(--accent); }

/* detail */
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.detail-head h1 { font-size: 20px; }
.detail-head small { color: var(--muted); font-size: 13px; }
.price { font-size: 18px; color: var(--accent); }
.detail-head form { margin-inline-start: auto; }
.rec { border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.rec-head { display: flex; justify-content: space-between; align-items: center; }
.rec-head .score { font-size: 18px; font-weight: 700; }
.rec-strong, .rec-buy { background: rgba(22,199,132,.15); border: 1px solid var(--up); }
.rec-avoid { background: rgba(234,57,67,.15); border: 1px solid var(--down); }
.rec-watch { background: var(--glow); border: 1px solid var(--accent); }
.bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,.12); margin: 10px 0 12px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.rec-strong .bar span, .rec-buy .bar span { background: var(--up); }
.rec-avoid .bar span { background: var(--down); }
.factors { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.factors li { display: flex; justify-content: space-between; gap: 10px; }
.factors li span::before { margin-inline-end: 6px; }
.factors .ok span::before { content: '✓'; color: var(--up); }
.factors .no span::before { content: '✕'; color: var(--muted); }
.factors .no { opacity: .6; }
.factors b { white-space: nowrap; color: var(--muted); }

.switch { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.switch a { flex: 1 1 45%; min-width: 0; }
.switch a {
  flex: 1; text-align: center; padding: 10px; border-radius: 10px;
  background: var(--card); color: var(--muted); text-decoration: none; font-size: 14px;
}
.switch a.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #0a0f1a; font-weight: 700; }

.scan-card {
  display: block; padding: 16px; border-radius: 14px;
  background: linear-gradient(145deg, var(--card), var(--card2));
  border: 1px solid rgba(20, 212, 196, .12);
  color: var(--text); text-decoration: none;
}
.ai-card { border-color: rgba(20, 212, 196, .45); }
.ai-label { font-size: 14px; margin: 16px 4px 8px; }
.buy-label { color: var(--up); }
.watch-label { color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); margin: 0 4px 12px; line-height: 1.6; }

/* market analysis */
.market-verdict {
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
  background: linear-gradient(145deg, var(--card), var(--card2));
  border: 1px solid rgba(20, 212, 196, .2);
}
.verdict-bull { border-color: rgba(22, 199, 132, .45); }
.verdict-bear { border-color: rgba(240, 82, 82, .45); }
.verdict-neutral { border-color: rgba(240, 185, 11, .35); }
.verdict-head { display: flex; justify-content: space-between; align-items: center; }
.verdict-head strong { font-size: 16px; }
.verdict-score {
  font-size: 28px; font-weight: 800; letter-spacing: -.5px;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.verdict-score.up { color: var(--up); text-shadow: 0 0 18px rgba(22, 199, 132, .3); }
.verdict-score.down { color: var(--down); text-shadow: 0 0 18px rgba(240, 82, 82, .3); }
.verdict-neutral .verdict-score { color: var(--accent); }
.verdict-summary { margin: 10px 0 8px; font-size: 14px; color: var(--text); }
.verdict-flows { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.verdict-flows li::before { content: '• '; color: var(--accent); }
.market-hint { margin-bottom: 10px; }

.bale-report-form { margin-bottom: 12px; }
.bale-report-btn {
  width: 100%; padding: 12px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #00b894, #00cec9);
  color: #0a0f1a; font-weight: 700; font-size: 14px;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 184, 148, .25);
}

.market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.market-card {
  background: var(--card); border-radius: 12px; padding: 12px;
  border: 1px solid rgba(255,255,255,.06);
}
.market-card.trend-up { border-color: rgba(22, 199, 132, .35); }
.market-card.trend-down { border-color: rgba(240, 82, 82, .35); }
.mc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mc-label { font-size: 12px; font-weight: 700; color: var(--accent); }
.mc-trend { font-size: 11px; font-weight: 600; }
.mc-title { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.mc-value { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.mc-hint { font-size: 11px; color: var(--muted); line-height: 1.5; }
.market-card-link { text-decoration: none; color: inherit; display: block; }
.mc-link { color: var(--accent); text-decoration: none; display: block; margin-bottom: 6px; }
.market-card form { margin-top: 8px; }

/* finder coin list */
.finder-coins { gap: 6px; }
.finder-coins .coin {
  padding: 8px 10px; border-radius: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.finder-coins .coin-row-top {
  display: flex; align-items: center; gap: 8px; width: 100%;
}
.finder-coins .coin-stats {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  padding: 4px 2px 0; border-top: 1px solid rgba(20, 212, 196, .08);
  font-size: 11px; color: var(--muted);
}
.finder-coins .coin-stats b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.finder-coins .coin-stats b.up { color: var(--up); }
.finder-coins .coin-stats b.down { color: var(--down); }
.finder-coins .coin-meta {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0; flex: 1;
}
.finder-coins .coin-pair { font-size: 13px; font-weight: 700; line-height: 1.2; }
.finder-coins .coin-full {
  font-size: 10px; font-weight: 400; color: var(--muted); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.finder-coins .copy-pair {
  flex-shrink: 0; border: none; background: transparent;
  color: var(--muted); padding: 4px; cursor: pointer; line-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.finder-coins .copy-pair.copied { color: var(--up); }
.finder-coins .coin-link img { width: 28px; height: 28px; }
.finder-coins .coin-rsi {
  margin-inline-start: auto; min-width: 58px; text-align: left;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.finder-coins .coin-rsi.rsi-down { color: var(--down); }
.finder-coins .coin-rsi.rsi-mid { color: var(--accent); }
.finder-coins .coin-rsi.rsi-high { color: var(--up); }
.rsi-range-form {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 12px; border-radius: 12px;
  background: var(--card); border: 1px solid rgba(20, 212, 196, .12);
}
.rsi-range-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.rsi-range-form input {
  width: 90px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid rgba(20, 212, 196, .15); background: var(--card2);
  color: var(--text); font-family: inherit; font-size: 14px;
}
.rsi-range-form button {
  padding: 8px 16px; border: none; border-radius: 8px;
  background: var(--accent); color: #041016; font-family: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.breakout-form label.chk {
  flex-direction: row; align-items: center; gap: 6px;
  width: auto; padding-bottom: 8px;
}
.breakout-form label.chk input { width: auto; }
.finder-coins .coin-price {
  font-size: 11px; color: var(--muted); min-width: 54px;
  text-align: left; font-variant-numeric: tabular-nums;
}
.finder-sort {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0 12px; padding: 8px 10px;
  border-radius: 10px; background: var(--card);
  border: 1px solid rgba(20, 212, 196, .12);
}
.finder-sort label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.finder-sort select {
  flex: 1; font-size: 12px; padding: 6px 8px; border-radius: 8px;
  border: 1px solid rgba(20, 212, 196, .2); background: var(--card2); color: var(--text);
}
.market-note {
  margin-top: 14px; padding: 14px; border-radius: 12px;
  background: linear-gradient(145deg, var(--card), var(--card2));
  border: 1px solid rgba(20, 212, 196, .15);
}
.market-note p { font-size: 13px; line-height: 1.7; color: var(--text); }
.market-note p + p { margin-top: 8px; color: var(--muted); }
.market-note.verdict-bull { border-color: rgba(22, 199, 132, .3); }
.market-note.verdict-bear { border-color: rgba(240, 82, 82, .3); }

/* trade levels */
.level-card,
details.level-card {
  background: var(--card); border-radius: 14px; margin-bottom: 10px;
  border: 1px solid rgba(20, 212, 196, .12); overflow: hidden;
}
details.level-card > summary.level-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; cursor: pointer; list-style: none;
  margin-bottom: 0;
}
details.level-card > summary::-webkit-details-marker { display: none; }
details.level-card[open] > summary {
  border-bottom: 1px solid rgba(20, 212, 196, .1);
}
.level-chevron {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--accent);
  border-radius: 4px; background: rgba(20, 212, 196, .1);
}
.level-chevron::before { content: '+'; line-height: 1; }
details[open] > summary .level-chevron::before { content: '−'; }
.level-body { padding: 12px 14px 14px; }
.level-toolbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.level-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.level-badge.ok { color: var(--up); background: rgba(14, 203, 129, .12); }
.level-badge.broken { color: #f0b90b; background: rgba(240, 185, 11, .12); }
.level-meta { flex: 1; min-width: 0; }
.level-meta strong { display: block; font-size: 14px; }
.level-meta span {
  display: block; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.level-sup-dist {
  margin-top: 2px; font-size: 11px; font-weight: 600;
  white-space: normal; overflow: visible; text-overflow: unset;
}
.level-sup-dist.dist-down { color: var(--down); }
.level-sup-dist.dist-broken { color: #f0b90b; }
.level-sup-dist.dist-muted { color: var(--muted); font-weight: 400; }
.level-sup-gap {
  margin: 10px 0 12px; padding: 8px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
}
.level-sup-gap.dist-profit {
  color: var(--up); background: rgba(14, 203, 129, .08);
  border: 1px solid rgba(14, 203, 129, .25);
}
.level-sup-gap.dist-broken {
  color: #f0b90b; background: rgba(240, 185, 11, .08);
  border: 1px solid rgba(240, 185, 11, .35);
}
.level-notes {
  margin: 8px 0 10px; padding: 8px 10px; border-radius: 8px;
  font-size: 12px; line-height: 1.6; color: var(--muted);
  background: var(--card2); border-right: 3px solid var(--accent);
}
.bale-manual-hint { color: var(--up); font-weight: 600; }
.level-price { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.level-tv {
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px;
  background: #2962ff; color: #fff; text-decoration: none;
}
.bale-btn {
  flex-shrink: 0; border: none; background: transparent;
  color: var(--muted); padding: 4px; cursor: pointer; line-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.bale-btn:hover { color: #00b894; }
.level-bale { margin: 0; }
.bale-id-form {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 10px; border-radius: 10px;
  background: var(--card); border: 1px solid rgba(20, 212, 196, .12);
}
.bale-id-form label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bale-id-form input {
  flex: 1; min-width: 120px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid rgba(20, 212, 196, .15); background: var(--card2);
  color: var(--text); font-family: inherit; font-size: 13px;
}
.bale-id-form button {
  padding: 8px 12px; border: none; border-radius: 8px;
  background: var(--card2); color: var(--accent); font-family: inherit;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.cron-box {
  margin: 8px 0 12px; padding: 10px 12px; border-radius: 8px;
  background: rgba(41, 98, 255, .08); border: 1px solid rgba(41, 98, 255, .25);
  overflow-x: auto;
}
.cron-box code { font-size: 11px; color: #7aa2ff; white-space: nowrap; }
.env-tags {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 10px; padding: 0;
}
.env-tag {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 6px 4px 10px; border-radius: 8px;
  background: var(--card2); border: 1px solid rgba(20, 212, 196, .15);
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.env-tag-del { margin: 0; }
.env-tag-del button {
  border: none; background: transparent; color: var(--down);
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px;
  font-family: inherit;
}
.level-remove { margin: 0; }
.level-label { display: block; font-size: 12px; font-weight: 600; margin: 8px 0 4px; }
.level-label small { font-weight: 400; color: var(--muted); margin-inline-start: 4px; }
.level-check {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 4px 0 12px; padding: 10px; border-radius: 8px;
  background: var(--card2); border: 1px solid rgba(20, 212, 196, .15);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.level-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.level-check small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.level-card textarea,
.level-card input[type="text"],
.level-card input[type="number"],
details.level-card textarea,
details.level-card input[type="text"],
details.level-card input[type="number"] {
  width: 100%; padding: 10px; border-radius: 8px;
  border: 1px solid rgba(20, 212, 196, .15); background: var(--card2);
  color: var(--text); font-family: inherit; font-size: 13px; resize: vertical;
}
.arz-modal-backdrop {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.arz-modal-backdrop[hidden] { display: none !important; }
.arz-modal {
  width: min(360px, 100%); background: var(--card); border: 1px solid rgba(20, 212, 196, .2);
  border-radius: 14px; padding: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.arz-modal h3 { margin: 0 0 6px; font-size: 16px; }
.arz-modal label {
  display: block; margin: 10px 0; font-size: 12px; color: var(--muted);
}
.arz-modal input, .arz-modal select {
  display: block; width: 100%; margin-top: 4px; padding: 10px; border-radius: 8px;
  border: 1px solid rgba(20, 212, 196, .2); background: var(--card2); color: var(--text);
  font-family: inherit;
}
.arz-modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.arz-modal-actions button {
  flex: 1; padding: 10px; border-radius: 10px; border: none; font-family: inherit;
  font-weight: 700; cursor: pointer;
}
.arz-modal-cancel { background: rgba(255,255,255,.08); color: var(--text); }
.arz-modal-ok { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #0a0f1a; }
.levels-form { margin-top: 10px; }
.levels-form select {
  width: 100%; margin-top: 4px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid rgba(20, 212, 196, .2); background: var(--card2); color: var(--text);
  font-family: inherit;
}
.fib-list {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; gap: 4px; font-size: 12px;
}
.fib-list li {
  display: grid; grid-template-columns: 56px 1fr 1fr; gap: 8px;
  padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.04);
}
.fib-list li.ok { color: #7dffa3; }
.fib-list li.up { color: #8ec8ff; }
.fib-list li.down { color: #ffb07a; }
.level-save {
  width: 100%; margin-top: 12px; padding: 10px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0a0f1a; font-weight: 700; font-family: inherit; cursor: pointer;
}
.level-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dist-chip {
  font-size: 11px; font-weight: 600; padding: 5px 8px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
}
.dist-chip.dist-down { color: var(--down); border-color: rgba(240, 82, 82, .35); }
.dist-chip.dist-up { color: var(--up); border-color: rgba(22, 199, 132, .35); }
.dist-chip.dist-broken { color: #f0b90b; border-color: rgba(240, 185, 11, .35); }
.dist-chip.dist-safe { color: var(--accent); border-color: rgba(20, 212, 196, .35); }
.dist-list {
  list-style: none; margin: 0 0 12px; padding: 8px 10px; border-radius: 8px;
  background: rgba(0,0,0,.15); font-size: 12px; display: flex; flex-direction: column; gap: 4px;
}
.dist-list b { font-variant-numeric: tabular-nums; }
.dist-list .dist-down { color: var(--down); }
.dist-list .dist-up { color: var(--up); }
.dist-list .dist-broken { color: #f0b90b; }
.dist-list .dist-safe { color: var(--accent); }
.level-head .chg { font-size: 11px; min-width: 48px; text-align: left; }

/* loader overlay */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(10, 15, 26, .92); backdrop-filter: blur(8px);
  transition: opacity .4s, visibility .4s;
}
.loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-ring {
  position: absolute; width: 72px; height: 72px;
  border: 3px solid transparent; border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
.loader-ring.ring2 { width: 56px; height: 56px; border-top-color: var(--up); animation-duration: 1.4s; animation-direction: reverse; }
.loader-ring.ring3 { width: 40px; height: 40px; border-top-color: #fff; animation-duration: .8s; }
.loader-text { margin-top: 100px; font-size: 16px; font-weight: 700; color: var(--text); }
.loader-sub { margin-top: 8px; font-size: 13px; color: var(--muted); animation: pulse 1.5s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* PWA install banner */
.install-banner {
  position: fixed; bottom: 72px; left: 12px; right: 12px; max-width: 576px; margin: 0 auto;
  display: none; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--accent); border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4); z-index: 90;
}
.install-banner.show { display: flex; }
.install-banner img { border-radius: 10px; flex-shrink: 0; }
.install-text { flex: 1; min-width: 0; }
.install-text strong { display: block; font-size: 14px; }
.install-text span { font-size: 12px; color: var(--muted); }
.install-btn {
  padding: 8px 16px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0a0f1a; font-weight: 700; font-family: inherit; cursor: pointer;
}
.install-close {
  background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; padding: 0 4px;
}

.bottom { border-radius: 12px; padding: 14px; margin-bottom: 16px; background: var(--card); }
.bottom-yes { border: 1px solid var(--up); }
.bottom-no { border: 1px solid #2a3340; }
.checks { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.checks li::before { margin-inline-end: 6px; }
.checks .ok { color: var(--up); }
.checks .ok::before { content: '✓'; }
.checks .no { color: var(--muted); }
.checks .no::before { content: '✕'; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats > div { background: var(--card); border-radius: 10px; padding: 10px; }
.stats dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.stats dd { font-size: 14px; }
.ext-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.ext-link {
  display: block; text-align: center; padding: 12px 6px;
  border-radius: 10px; color: #fff; font-weight: 500; text-decoration: none; font-size: 13px;
}
.ext-link.tv { background: #2962ff; }
.ext-link.cmc { background: #3861fb; }
.back { display: inline-block; margin-top: 14px; color: var(--accent); text-decoration: none; }

/* tabbar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 600px; margin: 0 auto;
  display: flex; background: var(--card); border-top: 1px solid rgba(20, 212, 196, .15);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab, .tab-form { flex: 1; }
.tab {
  display: block; width: 100%; text-align: center; padding: 16px 0;
  color: var(--muted); text-decoration: none; background: none; border: none;
  font-size: 13px; cursor: pointer; font-family: inherit;
}
.tab.active { color: var(--accent); }

/* login */
.login { padding: 48px 20px; text-align: center; }
.login-logo { border-radius: 22px; margin-bottom: 16px; box-shadow: 0 8px 32px var(--glow); }
.login h1 {
  font-size: 32px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(90deg, var(--accent), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-tag { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.login form { display: flex; flex-direction: column; gap: 12px; max-width: 320px; margin: 0 auto; }
.login input {
  padding: 14px; border-radius: 10px; border: 1px solid rgba(20, 212, 196, .2);
  background: var(--card); color: var(--text); font-family: inherit;
}
.login button {
  padding: 14px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0a0f1a; font-weight: bold; cursor: pointer; font-family: inherit;
}
.error { color: var(--down); margin-bottom: 10px; }
.success { color: var(--up); margin-bottom: 10px; }

/* leverage 1H candles */
.lev-chart-wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.lev-chart { flex-shrink: 0; color: var(--muted); background: rgba(0,0,0,.2); border-radius: 10px; }
.lev-candle-list { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
