/* RarityStack rebuild - application styles.
   Sections: shell · primitives · forms · modal · shared components · per-view. */

/* ═══ shell ═══════════════════════════════════════════════════════════════ */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  padding: 10px 16px; border-radius: var(--r-ctl);
  background: var(--surface-2); box-shadow: var(--shadow);
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

.app-header {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); height: var(--header-h);
  padding: 0 max(var(--s-4), env(safe-area-inset-left)) 0 max(var(--s-4), env(safe-area-inset-right));
  background: var(--veil);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 6px 8px; margin-left: -8px;
  border-radius: var(--r-ctl); cursor: pointer;
}
.brand-mark { display: grid; place-items: center; filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.35)); }
.brand-name {
  font-family: var(--font-display); font-size: 19px; font-weight: 800;
  letter-spacing: -0.02em;
}
.header-actions { display: flex; align-items: center; gap: var(--s-1); }

/* nav: pill rail under the header on desktop, bottom tab bar on mobile */
.app-nav {
  position: sticky; top: var(--header-h); z-index: 50;
  display: flex; justify-content: center; gap: var(--s-1);
  padding: var(--s-2) var(--s-3);
  background: var(--veil);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border: 0; border-radius: var(--r-pill);
  background: none; color: var(--text-muted);
  font-size: var(--fs-md); font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.nav-tab:hover { background: var(--surface-3); color: var(--text); }
.nav-tab.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-tab.active .icon { filter: drop-shadow(0 0 8px currentColor); }

.app-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) calc(var(--s-8) + env(safe-area-inset-bottom));
  outline: none;
}
.app-subnav:empty { display: none; }
.app-subnav { margin-bottom: var(--s-4); }
.subnav-chips { justify-content: flex-start; }

.view { animation: view-in 0.24s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.app-footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--s-6) var(--s-4) calc(var(--s-8) + env(safe-area-inset-bottom));
  display: grid; gap: var(--s-3);
  font-size: var(--fs-sm); color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.foot-attr { display: flex; align-items: center; gap: 8px; }
.foot-attr a { text-decoration: none; }
.foot-attr a:hover { text-decoration: underline; }
.fresh-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.fresh-dot.ok { background: var(--up); box-shadow: 0 0 8px var(--up); }
.fresh-dot.stale { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.fresh-dot.off { background: var(--down); box-shadow: 0 0 8px var(--down); }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.foot-links a { text-decoration: none; color: var(--text-muted); }
.foot-links a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 720px) {
  .app-nav {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0;
    justify-content: space-between; gap: 0;
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
    border-bottom: 0; border-top: 1px solid var(--border);
  }
  /* ponytail: 6 tabs share the width evenly; long labels ellipsize instead of pushing the last tab off-screen */
  .nav-tab {
    flex: 1 1 0; min-width: 0;
    flex-direction: column; gap: 3px; padding: 6px 1px;
    font-size: 10.5px; font-weight: 600; border-radius: var(--r-ctl);
  }
  .nav-tab > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-tab .icon { width: 20px; height: 20px; }
  .app-main { padding-bottom: calc(var(--nav-h) + var(--s-8)); }
  .app-footer { padding-bottom: calc(var(--nav-h) + var(--s-6)); }
}

/* ═══ primitives ══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--elev);
  padding: var(--s-5);
}
.card + .card { margin-top: var(--gap); }
.card.tight { padding: var(--s-4); }
.card-title {
  margin: 0 0 var(--s-3);
  font-family: var(--font-display);
  font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.card-sub { margin: -6px 0 var(--s-3); color: var(--text-muted); font-size: var(--fs-sm); }

h1.page-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em;
}
.page-sub { margin: 0 0 var(--s-5); color: var(--text-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--r-ctl);
  background: var(--surface-3); color: var(--text);
  font-size: var(--fs-md); font-weight: 600; cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: none; }
.btn.primary {
  background: var(--grad-brand); border: 0; color: #fff;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.28);
}
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 6px 22px rgba(129, 140, 248, 0.4); }
.btn.ghost { background: none; }
.btn.wide { width: 100%; }
.btn.small { padding: 6px 12px; font-size: var(--fs-sm); }
.btn.danger { color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, transparent); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 0; border-radius: var(--r-ctl);
  background: none; color: var(--text-muted); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.iconbtn:hover { background: var(--surface-3); color: var(--text); }
.iconbtn.ok { color: var(--up); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text-muted);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on {
  background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-text);
}
.chip.add { border-style: dashed; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--surface-3); font-size: var(--fs-xs); font-weight: 700;
}

.hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-4) 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 860px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* skeleton shimmer while data loads */
.skel {
  border-radius: var(--r-ctl);
  background: linear-gradient(100deg, var(--surface-3) 40%, color-mix(in srgb, var(--surface-3) 60%, var(--surface)) 50%, var(--surface-3) 60%);
  background-size: 200% 100%;
  animation: skel 1.2s linear infinite;
}
@keyframes skel { from { background-position: 120% 0; } to { background-position: -80% 0; } }

/* ═══ forms ═══════════════════════════════════════════════════════════════ */
.input, select.input, textarea.input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--r-ctl);
  background: var(--surface-3); color: var(--text);
  font-size: var(--fs-md); font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder { color: var(--text-dim); }
label.field { display: grid; gap: 6px; font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
.field-row { display: flex; gap: var(--s-3); align-items: end; flex-wrap: wrap; }
.field-row > * { flex: 1; min-width: 140px; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); }
.seg button {
  padding: 8px 14px; border: 0; background: none; color: var(--text-muted);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent-soft); color: var(--accent-text); }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track {
  width: 40px; height: 23px; border-radius: var(--r-pill); flex: none;
  background: var(--surface-3); border: 1px solid var(--border);
  position: relative; transition: background 0.18s ease, border-color 0.18s ease;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--text-muted); transition: transform 0.18s ease, background 0.18s ease;
}
.switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); background: var(--accent); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* ═══ modal ═══════════════════════════════════════════════════════════════ */
dialog.modal {
  border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface-2); color: var(--text);
  box-shadow: var(--shadow);
  padding: 0; width: min(94vw, 460px);
  animation: modal-in 0.2s cubic-bezier(0.2, 0.7, 0.3, 1);
}
dialog.modal.wide { width: min(96vw, 680px); }
dialog.modal::backdrop { background: rgba(4, 7, 16, 0.6); backdrop-filter: blur(3px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-5) 0;
}
.modal-head h3 { margin: 0; font-family: var(--font-display); font-size: var(--fs-lg); letter-spacing: -0.01em; }
.modal-body { padding: var(--s-4) var(--s-5) var(--s-5); }

/* ═══ shared components ═══════════════════════════════════════════════════ */
.avatar {
  display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden;
  background: var(--surface-3); flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: contain; }
.avatar-fallback { font-size: 0.6em; font-weight: 800; color: var(--text-muted); }

.chg { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: var(--fs-sm); }
.chg.big { font-size: var(--fs-md); }

.adslot { display: grid; place-items: center; margin: var(--gap) 0; }
.adslot:empty { display: none; min-height: 0 !important; }
.house-ad img { max-width: 100%; border-radius: var(--r-ctl); }

.support { display: grid; gap: var(--s-3); }
.crypto-addr {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-ctl);
  background: var(--surface);
}
.crypto-addr code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); }

.lang-wrap { position: relative; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 90;
  display: none; grid-template-columns: 1fr 1fr; gap: 2px;
  min-width: 320px; max-height: min(60vh, 420px); overflow: auto;
  padding: var(--s-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-card); box-shadow: var(--shadow);
}
.lang-wrap.open .lang-menu { display: grid; animation: modal-in 0.16s ease; }
.lang-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border: 0; border-radius: var(--r-ctl);
  background: none; color: var(--text); text-align: start;
  font-size: var(--fs-md); cursor: pointer;
}
.lang-item:hover { background: var(--surface-3); }
.lang-item.on { color: var(--accent-text); background: var(--accent-soft); font-weight: 700; }
[dir='rtl'] .lang-menu { right: auto; left: 0; }

/* install banner */
.install-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  z-index: 80; width: min(94vw, 460px);
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-card); box-shadow: var(--shadow);
  animation: modal-in 0.25s ease;
}
@media (min-width: 721px) { .install-banner { bottom: 18px; } }
.install-banner .txt { flex: 1; min-width: 0; }
.install-banner .txt b { display: block; }
.install-banner .txt span { font-size: var(--fs-sm); color: var(--text-muted); }

/* chart hover bits (chartHover.js) */
.chart-wrap { position: relative; }
.ch-vline { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-dot {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  transform: translate(-50%, -50%); pointer-events: none; z-index: 5;
}
.ch-tip {
  position: absolute; z-index: 6; pointer-events: none;
  display: grid; gap: 0; padding: 5px 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-sm);
  font-size: var(--fs-xs); white-space: nowrap;
}
.ch-tip-val { font-weight: 700; }

/* pie chart */
.pie-wrap { display: flex; gap: var(--s-5); align-items: center; flex-wrap: wrap; }
.pie { flex: none; }
.pie-slice { transition: opacity 0.15s ease; cursor: default; }
.pie-slice:hover { opacity: 0.85; }
.pie-label { fill: #fff; font-size: 13px; font-weight: 700; paint-order: stroke; stroke: rgba(0,0,0,0.35); stroke-width: 2.5px; }
.pie-center { fill: var(--text); font-size: 15px; font-weight: 800; }
.pie-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; flex: 1; min-width: 220px; }
.pie-leg-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r-ctl); text-decoration: none; }
a.pie-leg-row:hover { background: var(--surface-3); }
.pie-leg .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.pie-leg .lab { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-leg .pct { color: var(--text-muted); }

/* heatmap */
.heatmap { position: relative; width: 100%; aspect-ratio: 960 / 520; border-radius: var(--r-card); overflow: hidden; }
.htile {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; border: 1px solid rgba(0, 0, 0, 0.28); padding: 2px; cursor: pointer;
  color: #fff; overflow: hidden; transition: filter 0.15s ease;
}
.htile:hover { filter: brightness(1.15); z-index: 2; }
.ht-sym { font-weight: 800; font-size: clamp(9px, 1.6vw, 15px); text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.ht-price, .ht-chg { font-size: clamp(8px, 1.2vw, 12px); opacity: 0.92; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }

/* holding dialog */
.edit-holding { display: grid; gap: var(--s-3); }
.holding-rows { display: grid; gap: var(--s-2); }
.holding-row { display: flex; gap: var(--s-2); align-items: center; }
.holding-row .amt { flex: 1.2; }
.holding-row .holding-label { flex: 1; }
.holding-row.from-addr .amt { color: var(--accent-text); }
.addr-chip { color: var(--accent-text); display: inline-flex; }
.holding-sum { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 2px; }
.holding-sum .total { font-weight: 800; }
.addr-import { display: grid; gap: 6px; border-top: 1px solid var(--border); padding-top: var(--s-3); }
.addr-row { display: flex; gap: var(--s-2); }
.addr-row .addr-in { flex: 1; }
.addr-note { font-size: var(--fs-xs); }
.addr-msg { font-size: var(--fs-sm); min-height: 1.2em; }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-2); }
.btn.armed { background: var(--down); color: #fff; border-color: transparent; }

/* ═══ view: home / rankings ═══════════════════════════════════════════════ */
.hero {
  padding: var(--s-8) var(--s-5);
  text-align: center;
  border: 1px solid var(--border); border-radius: var(--r-card);
  background:
    radial-gradient(40rem 18rem at 50% -30%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--elev);
  margin-bottom: var(--s-5);
}
.hero h1 {
  margin: 0 0 var(--s-2);
  font-family: var(--font-display);
  font-size: var(--fs-hero); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12;
}
.hero .sub { margin: 0 auto var(--s-3); max-width: 560px; color: var(--text-muted); }
.hero-proof { margin: 0 0 var(--s-5); font-weight: 700; color: var(--accent-text); }
.hero-cta { display: flex; justify-content: center; gap: var(--s-3); flex-wrap: wrap; }
.btn.big { padding: 13px 26px; font-size: var(--fs-lg); }

.flip-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: var(--s-3);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: var(--r-card); background: var(--accent-soft); color: var(--accent-text);
  font-weight: 600;
}
.flip-banner span { flex: 1; }

.filter-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; margin-bottom: var(--s-2);
  border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface); color: var(--text-muted);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter-wrap:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.filter { flex: 1; padding: 12px 0; border: 0; background: none; color: var(--text); font-size: var(--fs-md); outline: none; }
.list-meta { margin: 0 4px var(--s-2); font-size: var(--fs-xs); }

.rank-list { display: grid; gap: var(--s-2); }
.row.coin-row {
  position: relative;
  display: grid;
  grid-template-columns: 30px 38px minmax(0, 1fr) auto 130px auto;
  gap: var(--s-3); align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--elev);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.row.coin-row:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.row.coin-row.locked { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.coin-row-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.coin-row > *:not(.coin-row-link) { position: relative; z-index: 2; pointer-events: none; }
.coin-row .lockbtn, .coin-row .r-spark { pointer-events: auto; }
.rank-badge {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; font-size: var(--fs-xs); font-weight: 800; color: var(--text-muted);
  background: var(--surface-3);
}
.rank-badge.top { background: var(--grad-brand); color: #fff; }
.r-main { min-width: 0; }
.r-top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.r-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-sym { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em; }
.r-sub { display: flex; gap: 10px; font-size: var(--fs-sm); min-width: 0; flex-wrap: wrap; }
.r-scarce { color: var(--accent-text); font-weight: 600; }
.r-sub.flip span:first-child { color: var(--accent-3); font-weight: 600; }
.r-right { text-align: end; display: grid; gap: 2px; justify-items: end; }
.r-price { font-weight: 700; }
.r-spark { width: 130px; height: 44px; }
.spark { display: block; width: 100%; height: 100%; }
.lockbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: none; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700;
  cursor: pointer; transition: all 0.15s ease;
}
.lockbtn:hover { border-color: var(--accent); color: var(--accent-text); }
.lockbtn.on { background: var(--grad-brand); border-color: transparent; color: #fff; }
@media (max-width: 860px) {
  .row.coin-row { grid-template-columns: 26px 34px minmax(0, 1fr) auto; }
  .r-spark, .lockbtn-label { display: none; }
  .lockbtn { padding: 7px; border-radius: 50%; }
}

.sentinel { height: 1px; }
.loading-grid { display: grid; gap: var(--s-2); }
.skel-row {
  display: flex; gap: var(--s-3); align-items: center;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface);
}
.skel-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; }
.skel-lines { flex: 1; display: grid; gap: 8px; }
.skel-line { height: 12px; }
.skel-line.mid { width: 45%; }
.skel-line.short { width: 28%; }
.skel-right { width: 90px; height: 26px; }

/* ═══ view: milestones ════════════════════════════════════════════════════ */
.view-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-3); }
.with-info { display: inline-flex; align-items: center; gap: 8px; }
.info-link { display: inline-flex; color: var(--text-dim); border-radius: 50%; }
.info-link:hover { color: var(--accent-text); }

.add-list { display: grid; gap: 2px; max-height: 46vh; overflow: auto; margin-top: var(--s-2); }
.add-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 0; border-radius: var(--r-ctl);
  background: none; color: var(--text); text-align: start; cursor: pointer;
}
.add-row:hover { background: var(--surface-3); }
.add-row .dim { margin-left: auto; font-weight: 700; font-size: var(--fs-xs); }

/* Sticky: pins under the header while the ladder scrolls; .compact (set by an
   IntersectionObserver on a sentinel above it) morphs it into a slim coin bar. */
.stat-card {
  position: sticky; top: calc(var(--header-h) + 8px); z-index: 45;
  overflow: hidden;
  margin: var(--s-4) 0;
  padding: var(--s-5);
  border: 1px solid var(--border); border-radius: var(--r-card);
  background:
    radial-gradient(34rem 16rem at 85% -30%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--elev);
  transition: padding 0.25s ease, border-radius 0.25s ease, box-shadow 0.25s ease;
}
@media (min-width: 721px) { .stat-card { top: calc(var(--header-h) + var(--nav-h) + 8px); } }
.ms-sentinel { height: 1px; }
.stat-card.compact { padding: 7px 14px; border-radius: var(--r-pill); box-shadow: var(--shadow); }
.stat-card .stat-lines, .stat-card .stat-actions {
  overflow: hidden; max-height: 400px;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.25s ease;
}
.stat-card.compact .stat-lines, .stat-card.compact .stat-actions {
  max-height: 0; opacity: 0; margin-top: 0; pointer-events: none;
}
.stat-tier-emoji { transition: opacity 0.2s ease; }
.stat-card.compact .stat-tier-emoji { opacity: 0; }
.stat-card.compact .hint { display: none; }
.stat-card.compact .stat-head > div .dim { display: none; }
.stat-head .avatar { transition: width 0.25s ease, height 0.25s ease; }
.stat-card.compact .stat-head .avatar { width: 28px !important; height: 28px !important; }
.stat-card.compact .stat-amount { font-size: var(--fs-lg); }
.ms-jump { display: none; }
.stat-card.compact .ms-jump { display: inline-flex; }
.stat-tier-emoji {
  position: absolute; right: 14px; bottom: 6px;
  font-size: 74px; opacity: 0.16; pointer-events: none;
  filter: saturate(0.8);
}
.stat-head { display: flex; align-items: center; gap: var(--s-3); }
.stat-head > div { flex: 1; min-width: 0; }
.stat-amount { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; }
.stat-lines { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: 10px; }
.stat-lines li { display: flex; align-items: flex-start; gap: 10px; }
.stat-lines li .icon { flex: none; color: var(--accent-text); margin-top: 2px; }
.stat-holder .sh-multi { display: grid; gap: 4px; }
.sh-tier { font-weight: 800; color: var(--gold-text); }
.sh-ranks { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); }
.sh-rank { display: inline-flex; gap: 5px; align-items: baseline; }
.stat-actions { display: flex; gap: var(--s-2); margin-top: var(--s-4); flex-wrap: wrap; }
.hint { margin: var(--s-3) 0 0; }

.progress-line { margin: var(--s-2) 2px; font-size: var(--fs-sm); color: var(--text-muted); }
.next-goal {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: var(--s-3);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--r-card);
  background: var(--accent-soft);
}

/* the ladder: rows threaded on a vertical rail */
.ladder { position: relative; display: grid; gap: var(--s-2); padding-left: 26px; }
.ladder::before {
  content: ''; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-3));
  opacity: 0.35; border-radius: 1px;
}
.ms-node {
  position: absolute; left: -22px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface-3); border: 2px solid var(--border-strong);
  z-index: 2;
}
.ms-node.on { border-color: transparent; box-shadow: 0 0 8px rgba(56, 189, 248, 0.5); }
[dir='rtl'] .ladder { padding-left: 0; padding-right: 26px; }
[dir='rtl'] .ladder::before { left: auto; right: 10px; }
[dir='rtl'] .ms-node { left: auto; right: -22px; }

.ms-row {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: var(--s-3);
  padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--elev);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.ms-row:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.ms-row.reached { opacity: 0.78; }
.ms-row.reached .ms-row-title { text-decoration: none; }
.ms-row.next {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%);
  opacity: 1;
}
.ms-chip {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px; color: #fff;
  box-shadow: var(--shadow-sm);
}
.ms-chip.goal { background: linear-gradient(135deg, var(--ms-target-a), var(--ms-target-b)); }
.flag-bg {
  position: absolute; inset: 0 auto 0 0; width: 42%;
  background-size: cover; background-position: left center;
  opacity: 0.16; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent);
  mask-image: linear-gradient(90deg, #000 30%, transparent);
}
.ms-visual {
  position: absolute; inset: 0 auto 0 0; width: 46%; max-width: 220px;
  display: flex; align-items: center; pointer-events: none;
  opacity: 0.30;
  -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent);
  mask-image: linear-gradient(90deg, #000 40%, transparent);
}
.msv { width: 100%; height: 84%; }
.ms-row.country .ms-body, .ms-row.has-art .ms-body { position: relative; z-index: 2; }
.ms-body { flex: 1; min-width: 0; }
.ms-row-title { font-weight: 700; }
.ms-row-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.ms-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 700;
}
.ms-tag.done { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }
.ms-tag.togo { background: var(--surface-3); color: var(--text-muted); }
.ms-prog { height: 6px; border-radius: 3px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.ms-prog span { display: block; height: 100%; border-radius: 3px; background: var(--grad-brand); transition: width 0.4s cubic-bezier(0.2, 0.7, 0.3, 1); }
.ms-prog.goal span { background: linear-gradient(90deg, var(--ms-target-a), var(--ms-target-b)); }
.ms-desc { display: none; margin-top: 8px; font-size: var(--fs-sm); color: var(--text-muted); }
.ms-desc.open { display: block; animation: view-in 0.2s ease; }
.ms-goal { border-style: dashed; border-color: color-mix(in srgb, var(--ms-target-b) 45%, transparent); }

.ms-here { position: relative; display: flex; justify-content: center; padding: 6px 0; }
.ms-here::before {
  content: ''; position: absolute; left: -16px; right: 0; top: 50%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  opacity: 0.5;
}
.ms-here-pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: var(--r-pill);
  background: var(--grad-brand); color: #fff; font-weight: 800; font-size: var(--fs-sm);
  box-shadow: 0 4px 18px rgba(129, 140, 248, 0.45);
}
.ms-here-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; }
.ms-here-pill .mono { font-weight: 700; opacity: 0.95; }
.ms-here-edit {
  display: inline-flex; border: 0; background: rgba(255,255,255,0.22); color: #fff;
  border-radius: 50%; width: 24px; height: 24px; align-items: center; justify-content: center; cursor: pointer;
}
.ms-here-edit:hover { background: rgba(255,255,255,0.35); }

.share-modal { display: grid; gap: var(--s-3); }
.share-opts { display: grid; gap: 6px; }
.share-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-ctl); cursor: pointer; }
.share-opt:hover { background: var(--surface-3); }
.share-opt input { accent-color: var(--accent); width: 17px; height: 17px; }
.share-preview { width: 100%; border-radius: var(--r-ctl); border: 1px solid var(--border); }

/* ═══ shared bits across views ════════════════════════════════════════════ */
.section-title {
  display: flex; align-items: center; gap: 8px;
  margin: var(--s-5) 0 var(--s-3);
  font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700;
}
.section-title .sub { font-weight: 400; font-size: var(--fs-sm); }
.list-card { display: grid; gap: var(--s-2); margin-top: var(--gap); }
.rank-num { width: 22px; text-align: center; font-weight: 700; }
.big-input { font-size: var(--fs-lg); font-weight: 700; }
.select { width: auto; min-width: 130px; }
.back { margin-bottom: var(--s-3); }
.attr { font-size: var(--fs-xs); text-decoration: none; }
.attr:hover { text-decoration: underline; }
.accent { color: var(--accent-text); }

.empty-state {
  display: grid; place-items: center; gap: var(--s-3);
  padding: var(--s-8); text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--r-card);
}
.empty-medallion {
  display: grid; place-items: center; width: 76px; height: 76px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-text);
}

.prose { max-width: 680px; }
.prose h1 { font-family: var(--font-display); letter-spacing: -0.02em; }
.prose .lead { font-size: var(--fs-lg); color: var(--text-muted); }
.prose h3 { margin: var(--s-6) 0 var(--s-2); }
.prose-links { display: flex; gap: var(--s-4); margin-top: var(--s-6); }

/* ═══ view: market ════════════════════════════════════════════════════════ */
.pie-stack { display: grid; gap: var(--s-4); }
.dom-trend { border-top: 1px solid var(--border); padding-top: var(--s-3); }
.dom-trend-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.dom-trend-title { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
.dom-trend-now { font-weight: 800; color: var(--accent-text); }
.dom-chart { display: block; width: 100%; }
.dom-trend-axis { display: flex; justify-content: space-between; font-size: var(--fs-xs); margin-top: 2px; }

/* ═══ view: portfolio ═════════════════════════════════════════════════════ */
.total-card {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3);
  padding: var(--s-4) var(--s-5); margin-bottom: var(--gap);
  border: 1px solid var(--border); border-radius: var(--r-card);
  background: radial-gradient(26rem 10rem at 20% -40%, var(--accent-soft), transparent 70%), var(--surface);
  box-shadow: var(--elev);
}
.total-card strong { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 800; }
.r-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.r-part {
  display: inline-flex; gap: 6px; align-items: baseline;
  padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--surface-3); font-size: var(--fs-xs);
}
.r-part-name { color: var(--text-muted); }
/* portfolio rows have only avatar + main + value: the rankings 6-col template
   would squeeze r-main into a 38px column */
.pf-row.coin-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
.pf-goal { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pf-goal-ico { color: var(--ms-target-b); display: inline-flex; }
.pf-goal-bar { flex: 1; min-width: 60px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.pf-goal-fill { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--ms-target-a), var(--ms-target-b)); transition: width 0.3s ease; }
.pf-goal-fill.done { background: var(--up); }
.pf-goal-input {
  width: 88px; padding: 3px 8px; font-size: var(--fs-xs);
  border: 1px solid var(--border); border-radius: var(--r-ctl);
  background: var(--surface-3); color: var(--text);
}
.pf-goal-coin, .pf-goal-pct { font-size: var(--fs-xs); }
.pf-goal-pct.over { color: var(--up); font-weight: 700; }

/* rebalance check */
.rebal-box:empty { display: none; }
.rebal-card { margin-top: var(--s-3); display: grid; gap: var(--s-2); }
.rebal-sum { margin: 0; font-weight: 700; }
.rebal-list { display: grid; gap: 6px; }
.rebal-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rebal-row .rebal-coin { font-weight: 700; }
.rebal-row .ms-tag { margin-left: auto; }
.rebal-note { margin: 0; font-size: var(--fs-xs); }

/* ═══ view: goals ═════════════════════════════════════════════════════════ */
.goal-card { display: grid; gap: var(--s-3); }
.goal-head { display: flex; align-items: center; gap: 8px; }
.goal-head .icon { color: var(--accent-text); }
.goal-bar { height: 12px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.goal-bar-fill { display: block; height: 100%; border-radius: 6px; background: var(--grad-brand); transition: width 0.4s cubic-bezier(0.2, 0.7, 0.3, 1); }
.goal-bar-fill.done { background: var(--up); }
.goal-stat { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-sm); }
.goal-pct { font-weight: 700; color: var(--accent-text); }
.goal-pct.done { color: var(--up); }
.goal-row { display: flex; align-items: center; gap: var(--s-2); }
.goal-row .big-input { max-width: 220px; }
.goal-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.goal-preset { border: 0; cursor: pointer; color: var(--text-muted); }
.goal-preset:hover { color: var(--accent-text); background: var(--accent-soft); }
.goal-worth-line strong { font-size: var(--fs-xl); display: inline-block; }
.goal-worth-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-sm); }
.goal-fair-you { font-weight: 700; color: var(--accent-text); }
.set-hint { font-size: var(--fs-sm); }

/* ═══ view: achievements + treasury ═══════════════════════════════════════ */
.tr-boxhead { font-family: var(--font-display); font-weight: 700; margin-bottom: var(--s-3); }
.tier-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px 10px; border-radius: var(--r-ctl);
}
.tier-row.here { background: var(--accent-soft); }
.tier-emoji { font-size: 22px; width: 30px; text-align: center; flex: none; }
.tier-body { flex: 1; min-width: 0; }
.tier-label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.tier-label .icon { color: var(--up); }
.tier-you {
  padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--grad-brand); color: #fff; font-size: var(--fs-xs); font-weight: 800;
}
.tier-sub { font-size: var(--fs-xs); }
.tier-prog { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 5px; }
.tier-prog span { display: block; height: 100%; background: var(--grad-brand); border-radius: 3px; }
.tier-row.done .tier-prog span { background: var(--up); }
.tier-pct { font-size: var(--fs-xs); white-space: nowrap; }
.tier-self {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: var(--s-3);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--r-card); background: var(--accent-soft); font-weight: 700;
}
.tr-foot { font-size: var(--fs-xs); margin: var(--s-3) 0 0; }
.ach-card { display: grid; gap: var(--s-3); }
.ach-streak { font-size: var(--fs-lg); }
.ach-grid { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.ach-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border: 1px solid var(--border); border-radius: var(--r-pill);
  color: var(--text-dim); font-size: var(--fs-sm); font-weight: 600;
}
.ach-badge.on { border-color: color-mix(in srgb, var(--up) 45%, transparent); color: var(--up); background: color-mix(in srgb, var(--up) 10%, transparent); }

.tr-row { padding: var(--s-3) 0; }
.tr-row + .tr-row { border-top: 1px solid var(--border); }
.tr-row.tr-you {
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: var(--r-card);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--gap);
  background: var(--accent-soft);
}
.tr-rowhead { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.tr-label { font-weight: 700; }
.tr-btc { color: var(--text-muted); font-size: var(--fs-sm); }
.tr-bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin-top: 7px; }
.tr-fill { display: block; height: 100%; border-radius: 5px; background: var(--grad-brand); transition: width 0.5s cubic-bezier(0.2, 0.7, 0.3, 1); }
.tr-fill.you { background: var(--gold); }
.tr-sub { font-size: var(--fs-xs); margin-top: 4px; }

/* ═══ view: convert ═══════════════════════════════════════════════════════ */
.convert-input { display: grid; gap: var(--s-3); }
.input-row { display: flex; align-items: center; gap: var(--s-3); }
.input-row .big-input { flex: 1; }
.input-row .unit { font-weight: 800; color: var(--text-muted); }
.convert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-2); }
.conv-sub { grid-column: 1 / -1; font-size: var(--fs-sm); color: var(--text-muted); font-weight: 700; margin-top: var(--s-2); }
.conv-cell {
  display: grid; gap: 2px; text-align: start;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-ctl);
  background: var(--surface-3); cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.conv-cell:hover { border-color: var(--accent); transform: translateY(-1px); }
.conv-cell.copied { border-color: var(--up); }
.conv-cell strong { overflow: hidden; text-overflow: ellipsis; }

/* ═══ view: coin detail ═══════════════════════════════════════════════════ */
.coin-topbar { display: flex; justify-content: space-between; align-items: center; }
.coin-head { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--gap); }
.coin-head h1 { margin: 0; }
.coin-price { margin-left: auto; text-align: end; display: grid; justify-items: end; gap: 2px; }
.coin-price .big { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 800; }
.spark-card { position: relative; padding: var(--s-3); }
.spark-card .spark { width: 100%; height: 120px; }
.spark-tag { position: absolute; top: 10px; right: 14px; font-size: var(--fs-xs); font-weight: 700; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-3); }
.kv { display: grid; gap: 2px; }
.kv strong { font-size: var(--fs-md); }
.issuance-card { display: grid; gap: var(--s-2); }
.iss-head { display: flex; justify-content: space-between; align-items: baseline; }
.iss-head strong { font-size: var(--fs-xl); font-weight: 800; }
.iss-uncapped { color: var(--warn); }
.iss-meter { height: 12px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.iss-fill { height: 100%; border-radius: 6px; background: var(--grad-brand); transition: width 0.5s cubic-bezier(0.2, 0.7, 0.3, 1); }
.iss-line { margin: 0; font-size: var(--fs-sm); }
.whatif-card { display: grid; gap: var(--s-3); }
.whatif-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.whatif-price strong { font-size: var(--fs-xl); }
.whatif-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-sm); }
.whatif-note { margin: 0; font-size: var(--fs-xs); }
.pos-card { display: grid; gap: var(--s-3); }
.pos-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.pos-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ═══ view: shared-card landing ═══════════════════════════════════════════ */
.card-landing { display: grid; justify-items: center; gap: var(--s-4); text-align: center; padding: var(--s-5) 0; }
.shared-card { width: min(94vw, 620px); border-radius: var(--r-card); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card-landing h1 { margin: 0; font-family: var(--font-display); letter-spacing: -0.02em; }
.card-landing-row { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; }

/* ═══ view: settings ══════════════════════════════════════════════════════ */
.set-group {
  margin-top: var(--gap); padding: var(--s-2) var(--s-4);
  border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--elev);
}
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-3) 0;
}
.set-row + .set-row { border-top: 1px solid var(--border); }
.set-row > div:first-child { min-width: 0; }
.set-label { display: flex; align-items: center; font-weight: 600; }
.set-label .icon { color: var(--accent-text); margin-right: 6px; }
.set-link { display: flex; align-items: center; justify-content: space-between; padding: var(--s-3) 0; text-decoration: none; font-weight: 600; }
.set-link:hover { color: var(--accent-text); }
.io-card { display: grid; gap: var(--s-2); padding-top: var(--s-4); padding-bottom: var(--s-4); }
.io-pass-row { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.io-pass { max-width: 320px; }
.io-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.io-status { min-height: 1.3em; font-size: var(--fs-sm); }
.io-status.ok { color: var(--up); }
.io-paste { display: grid; gap: var(--s-3); }
.io-textarea { resize: vertical; font-size: var(--fs-xs); }
.io-textarea.err { border-color: var(--down); }
.privacy-box { padding-top: var(--s-4); padding-bottom: var(--s-4); }
.priv-list { list-style: none; margin: var(--s-3) 0; padding: 0; display: grid; gap: 8px; }
.priv-list li { display: flex; gap: 10px; align-items: flex-start; }
.priv-list .icon { color: var(--up); flex: none; margin-top: 2px; }
.priv-net { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: var(--fs-sm); }
.priv-dot { width: 9px; height: 9px; border-radius: 50%; }
.priv-dot.ok { background: var(--up); box-shadow: 0 0 8px var(--up); }
.priv-dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.priv-recheck { border: 0; cursor: pointer; color: var(--accent-text); }

/* ═══ view: history ═══════════════════════════════════════════════════════ */
.hist-hero { text-align: center; display: grid; gap: 4px; }
.hist-now { font-family: var(--font-display); font-size: var(--fs-hero); font-weight: 800; letter-spacing: -0.02em; }
.hist-cur { font-size: 0.45em; font-weight: 600; }
.hist-now-cap { font-size: var(--fs-sm); }
.hist-chg { font-weight: 800; font-size: var(--fs-lg); }
.hist-chg-note { font-weight: 400; font-size: var(--fs-sm); }
.hist-card { padding: var(--s-3) var(--s-4); }
.hist-chart { display: block; width: 100%; }
.hist-axis { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-xs); margin-top: 4px; flex-wrap: wrap; }
.hist-blurb { font-size: var(--fs-sm); max-width: 640px; }

/* ═══ view: halving ═══════════════════════════════════════════════════════ */
.halving-hero { text-align: center; display: grid; gap: 4px; }
.hv-big { font-family: var(--font-display); font-size: var(--fs-hero); font-weight: 800; letter-spacing: -0.02em; }
.hv-big-cap { font-size: var(--fs-sm); }
.hv-eta { font-weight: 600; color: var(--accent-text); }
.halving-prog { display: grid; gap: var(--s-2); }
.hv-prog-head { display: flex; justify-content: space-between; }
.hv-prog-foot { font-size: var(--fs-xs); }
.halving-sub { display: flex; align-items: center; justify-content: center; gap: var(--s-5); }
.hv-sub-cell { display: grid; justify-items: center; gap: 2px; }
.hv-sub-cell strong { font-size: var(--fs-xl); font-weight: 800; }
.hv-sub-note { font-size: var(--fs-xs); }
.hv-arrow { font-size: 24px; color: var(--text-dim); }
.halving-supply { display: grid; gap: var(--s-3); }
.hv-supply-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.hv-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--text-muted); cursor: pointer; }
.hv-toggle input { accent-color: var(--accent); }
.hv-bar { display: flex; height: 34px; border-radius: var(--r-ctl); overflow: hidden; }
.hv-seg { position: relative; display: grid; place-items: center; overflow: hidden; min-width: 0; }
.hv-seg-lbl { font-size: var(--fs-xs); font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5); white-space: nowrap; }
.hv-seg-lost { background: #64748B; }
.hv-seg-circ { background: linear-gradient(135deg, #0891B2, #38BDF8); }
.hv-seg-tomine { background: #312E81; }
.hv-seg-etf { background: #7C3AED; }
.hv-seg-countries { background: #DB2777; }
.hv-seg-public { background: #EA580C; }
.hv-seg-private { background: #CA8A04; }
.hv-seg-wallets { background: linear-gradient(135deg, #0891B2, #38BDF8); }
.hv-seg-exchanges { background: #0D9488; }
.hv-seg-individuals { background: linear-gradient(135deg, #0891B2, #38BDF8); }
.hv-eras { display: grid; gap: 4px; }
.hv-era-bar { display: flex; height: 18px; border-radius: 6px; overflow: hidden; }
.hv-era-seg {
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface-3); color: var(--text-dim);
  font-size: 10px; font-weight: 700; white-space: nowrap;
}
.hv-era-seg.alt { background: color-mix(in srgb, var(--surface-3) 60%, var(--surface)); }
.hv-era-seg.cur { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.hv-era-note { margin: 0; font-size: var(--fs-xs); }
.hv-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.hv-leg { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.hv-leg-sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.hv-leg-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-leg-val { white-space: nowrap; font-size: var(--fs-xs); }
.hv-supply-last { margin: 0; font-weight: 600; }
.hv-supply-note { margin: 0; font-size: var(--fs-xs); }
.hv-blurb { max-width: 640px; }

/* ═══ view: cycles ════════════════════════════════════════════════════════ */
.cyc-map { padding: var(--s-3); }
.cyc-svg { display: block; width: 100%; height: auto; }
.cyc-since { margin: var(--s-3) 2px; font-size: var(--fs-sm); }
.cyc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.cyc-card { display: grid; gap: 8px; align-content: start; }
.cyc-card.live { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 60%); }
.cyc-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); }
.cyc-no { font-weight: 800; font-family: var(--font-display); }
.cyc-era { font-size: var(--fs-xs); }
.cyc-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cyc-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; align-self: center; }
.cyc-dot.hv { background: var(--accent); }
.cyc-dot.top { background: var(--up); }
.cyc-dot.bot { background: var(--down); }
.cyc-dot.today { background: var(--gold); }
.cyc-price { font-weight: 800; }
.cyc-when { font-size: var(--fs-sm); }
.cyc-sub { font-size: var(--fs-xs); margin-left: 18px; }
.cyc-len { font-size: var(--fs-xs); border-top: 1px solid var(--border); padding-top: 7px; }
.cyc-stk { margin-top: var(--gap); display: grid; gap: 6px; }
.cyc-stk-head { margin-bottom: 4px; }
.cyc-stk-row { display: flex; align-items: baseline; gap: var(--s-3); }
.cyc-stk-when { width: 90px; flex: none; font-size: var(--fs-sm); }
.cyc-stk-val { font-weight: 700; flex: 1; }
.cyc-stk-mult { font-size: var(--fs-sm); font-weight: 700; }
.cyc-fc { margin-top: var(--s-5); }
.cyc-fc-toggle { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); color: var(--text-muted); cursor: pointer; }
.cyc-fc-toggle input { accent-color: var(--warn); margin-top: 3px; }
.cyc-fc-body { margin-top: var(--s-3); display: grid; gap: var(--s-3); }
.cyc-fc-warn {
  display: grid; gap: 6px; padding: var(--s-3) var(--s-4);
  border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent);
  border-radius: var(--r-card); background: color-mix(in srgb, var(--warn) 8%, transparent);
  font-size: var(--fs-sm);
}
.cyc-fc-badge { font-weight: 800; color: var(--warn); }
.cyc-fc-card { border-style: dashed; }
.cyc-fc-when { font-size: var(--fs-sm); color: var(--text-muted); }
.cyc-fc-range { font-size: var(--fs-xl); font-weight: 800; }
.cyc-fc-extra { font-size: var(--fs-xs); }

/* ═══ view: pulse ═════════════════════════════════════════════════════════ */
.pulse-sec { margin-bottom: var(--s-6); }
.heat-shell { border-radius: var(--r-card); overflow: hidden; box-shadow: var(--elev); border: 1px solid var(--border); }
.mp-box, .fng-box { display: grid; gap: var(--s-3); }
.mp-stats { display: flex; gap: var(--s-4); font-weight: 600; }
.mp-row { display: grid; gap: var(--s-3); }
@media (min-width: 860px) { .mp-row { grid-template-columns: 1fr 1fr; } }
.mp-lane { min-width: 0; }
.mp-lane-h { font-size: var(--fs-sm); margin-bottom: 6px; }
.mp-blocks { display: flex; gap: var(--s-2); overflow-x: auto; padding-bottom: 4px; }
.mp-block {
  flex: none; min-width: 106px;
  padding: 10px 12px; border: 1.5px solid; border-radius: var(--r-ctl);
  background: var(--surface); box-shadow: var(--elev);
  display: grid; gap: 2px;
}
.mp-block.pending { border-style: dashed; opacity: 0.9; }
.mp-h { font-weight: 800; }
.mp-fee { font-size: var(--fs-sm); }
.mp-meta, .mp-pool { font-size: var(--fs-xs); }
.fng-card { display: grid; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--elev); }
.fng-top { display: flex; align-items: center; gap: var(--s-4); }
.fng-value { font-family: var(--font-display); font-size: 52px; font-weight: 800; line-height: 1; }
.fng-class { font-weight: 800; font-size: var(--fs-lg); }
.fng-bar {
  position: relative; height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, hsl(0,62%,50%), hsl(50,62%,50%), hsl(130,62%,45%));
}
.fng-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text); border: 3px solid var(--bg);
  box-shadow: var(--shadow-sm);
}

/* ═══ view: flow ══════════════════════════════════════════════════════════ */
.viz-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.viz-switch { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.viz-pill {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text-muted);
  font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
  transition: all 0.15s ease;
}
.viz-pill:hover { color: var(--text); border-color: var(--border-strong); }
.viz-pill.on { background: var(--grad-brand); border-color: transparent; color: #fff; }
.viz-density { min-width: 104px; padding: 6px 10px; font-size: var(--fs-sm); }
.viz-bar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.viz-auto { white-space: nowrap; }
.viz-find {
  width: 150px; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--text); font-size: var(--fs-xs);
}
.viz-find:focus { outline: none; border-color: var(--accent); }
.viz-find.hit { border-color: var(--up); }
.viz-find.miss { border-color: var(--down); }
.viz-bar-right .iconbtn.on { background: var(--accent-soft); color: var(--accent-text); }
.mp-stage { display: flex; gap: var(--s-3); align-items: stretch; }
.mp-canvas-wrap { position: relative; flex: 1; min-width: 0; }
.mp-canvas {
  display: block; width: 100%; height: clamp(380px, 62vh, 660px);
  border-radius: var(--r-card); border: 1px solid var(--border);
  background: #060a14; box-shadow: var(--elev);
}
.viz-hovertip {
  position: fixed; z-index: 95; pointer-events: none;
  min-width: 170px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-ctl); box-shadow: var(--shadow);
  font-size: var(--fs-xs);
}
.viz-txinfo {
  position: absolute; left: 12px; bottom: 12px; z-index: 20;
  min-width: 220px; max-width: 300px; padding: 10px 12px;
  background: var(--veil); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow);
  font-size: var(--fs-sm);
}
.txi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.txi-tag {
  padding: 1px 7px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: var(--fs-xs); font-weight: 800;
}
.txi-species { font-weight: 700; }
.txi-close { margin-left: auto; border: 0; background: none; color: var(--text-dim); font-size: 18px; cursor: pointer; line-height: 1; }
.txi-close:hover { color: var(--text); }
.txi-row { display: flex; justify-content: space-between; gap: var(--s-3); padding: 2px 0; }
.txi-k { color: var(--text-dim); }
.txi-v.accent { color: var(--accent-text); font-weight: 700; }
.txi-link { color: var(--accent-text); text-decoration: none; }
.txi-link:hover { text-decoration: underline; }
.viz-blocks, .viz-feed {
  flex: none; width: 172px; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--elev); overflow: hidden;
}
@media (max-width: 860px) { .viz-blocks, .viz-feed { display: none !important; } }
.vb-head, .vf-head { padding: 8px 12px; font-size: var(--fs-xs); font-weight: 700; border-bottom: 1px solid var(--border); }
.vb-scroll { flex: 1; overflow-y: auto; padding: 4px 8px; }
.vb-item { display: flex; gap: 8px; align-items: flex-start; padding: 5px 2px; }
.vb-item.fut { opacity: 0.75; }
.vb-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 4px; }
.vb-body { min-width: 0; flex: 1; }
.vb-l1 { display: flex; align-items: baseline; gap: 6px; }
.vb-h { font-weight: 700; font-size: var(--fs-xs); }
.vb-tag { padding: 0 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); font-size: 10px; font-weight: 800; }
.vb-fee { margin-left: auto; font-size: 10px; color: var(--text-muted); }
.vb-l2 { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-empty { padding: var(--s-3); font-size: var(--fs-xs); }
.vb-mid {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-top: 1px dashed var(--border-strong); border-bottom: 1px dashed var(--border-strong);
  font-size: 10px;
}
.vb-mid-arrow { color: var(--accent-text); }
.vb-mid-main { font-weight: 800; color: var(--accent-text); }
.vb-mid-main.over { color: var(--warn); }
.vb-mid-sub { margin-left: auto; }
.vf-list { flex: 1; overflow: hidden; padding: 4px 8px; }
.vf-item { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: var(--fs-xs); }
.vf-item.vf-new { animation: vf-in 0.35s ease; }
@keyframes vf-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.vf-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.vf-fee { color: var(--text-muted); }
.vf-usd { margin-left: auto; font-weight: 700; }
.ft-panel { margin-bottom: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--elev); }
.ft-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; margin-bottom: 6px; }
.ft-title { font-size: var(--fs-sm); font-weight: 700; }
.ft-hint { display: flex; gap: 12px; align-items: baseline; font-size: var(--fs-sm); }
.ft-hint-label { font-weight: 700; color: var(--accent-text); }
.ft-svg { display: block; width: 100%; height: 60px; }
.ft-fill { fill: var(--accent-soft); }
.ft-line { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.tm-strip { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-3); }
.tm-title { font-size: var(--fs-xs); font-weight: 700; }
.tm-bar { flex: 1; min-width: 160px; display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.tm-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-xs); }
.tm-li { display: inline-flex; align-items: center; gap: 5px; }
.tm-sw { width: 9px; height: 9px; border-radius: 3px; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--text-muted); }
.vl-title { font-weight: 700; }
.vl-item { display: inline-flex; align-items: center; gap: 5px; }
.vl-sw { width: 10px; height: 10px; border-radius: 3px; }
.viz-creatures { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }
.vc-all {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: none; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; cursor: pointer;
}
.vc-all:hover { color: var(--accent-text); border-color: var(--accent); }
.vc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 4px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text); font-size: var(--fs-xs); cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.vc-chip:hover { border-color: var(--border-strong); }
.vc-chip.off { opacity: 0.38; }
.vc-ico { border-radius: 50%; background: #0a1626; }
.viz-timing { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
.mp-foot { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-2); font-size: var(--fs-xs); }
.viz-fps { position: fixed; right: 12px; bottom: 10px; z-index: 96; font-size: var(--fs-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* full-window flow mode: hide app chrome, canvas fills the viewport */
body.rs-flowfull .app-header, body.rs-flowfull .app-nav, body.rs-flowfull .app-footer,
body.rs-flowfull .app-subnav, body.rs-flowfull .page-title, body.rs-flowfull .page-sub { display: none; }
body.rs-flowfull .app-main { max-width: none; padding: 0; }
body.rs-flowfull .viz-bar { padding: 8px 12px; margin: 0; position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--veil); backdrop-filter: blur(12px); }
body.rs-flowfull .mp-canvas { height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
body.rs-flowfull .mp-stage { gap: 0; }
body.rs-flowfull .viz-blocks, body.rs-flowfull .viz-feed { position: fixed; right: 10px; top: 64px; bottom: 10px; z-index: 89; }
body.rs-flowfull .viz-feed { right: 192px; }
body.rs-flowfull .viz-timing { position: fixed; left: 12px; bottom: 10px; z-index: 90; margin: 0; }
body.rs-flowfull .viz-legend, body.rs-flowfull .tm-strip, body.rs-flowfull .mp-foot, body.rs-flowfull .ft-panel, body.rs-flowfull .viz-creatures { display: none !important; }
