:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: rgba(17, 24, 39, 0.78);
  --panel-strong: rgba(23, 32, 48, 0.95);
  --line: rgba(148, 163, 184, 0.18);
  --text: #edf4ff;
  --muted: #91a2b8;
  --green: #3cffb5;
  --red: #ff6b6b;
  --orange: #ffb86c;
  --cyan: #61dafb;
  --blue: #528cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 180, 216, 0.18), transparent 32%),
    radial-gradient(circle at 82% 8%, rgba(82, 140, 255, 0.2), transparent 30%),
    linear-gradient(145deg, #070a10 0%, #101522 45%, #090d16 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  color: #06111f;
  background: linear-gradient(135deg, #66e4ff, #4affbb);
  border-radius: 8px;
  padding: 13px 18px;
  font-weight: 800;
  box-shadow: 0 14px 32px rgba(74, 255, 187, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(74, 255, 187, 0.28);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 28px;
}

/* ══ HERO — компактный новый ══ */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 24px;
  border: 1px solid rgba(97, 218, 251, 0.14);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(12, 25, 42, 0.92), rgba(9, 13, 24, 0.82)),
    radial-gradient(circle at top left, rgba(74, 255, 187, 0.12), transparent 36%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-brand-link {
  color: inherit;
  text-decoration: none;
  width: fit-content;
  border-radius: 16px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.hero-brand-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  opacity: 0.94;
}

.hero-brand-link:focus-visible {
  outline: 2px solid rgba(97, 218, 251, 0.7);
  outline-offset: 6px;
}

.hero-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: 0 0 24px rgba(74, 255, 187, 0.28);
}

.hero-brand h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
}

h2,
h3,
h4,
p {
  margin-top: 0;
}

.subtitle {
  margin: 0;
  color: #9dafc8;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  line-height: 1.5;
  max-width: 640px;
}

.hero-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.telegram-header-login,
.telegram-header-user {
  min-height: 38px;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.telegram-header-menu {
  position: relative;
  display: inline-flex;
}

.telegram-header-login {
  color: #06111f;
  background: linear-gradient(135deg, #66e4ff, #4affbb);
  box-shadow: 0 12px 28px rgba(74, 255, 187, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.telegram-header-user {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(97, 218, 251, 0.22);
  background: rgba(97, 218, 251, 0.09);
  color: #eaf6ff;
  cursor: pointer;
}

.telegram-header-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  min-width: 180px;
  padding: 8px;
  border: 1px solid rgba(97, 218, 251, 0.2);
  border-radius: 14px;
  background: rgba(8, 13, 23, 0.96);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}

.telegram-header-menu:hover .telegram-header-dropdown,
.telegram-header-menu:focus-within .telegram-header-dropdown,
.telegram-header-menu.open .telegram-header-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.telegram-header-dropdown-item {
  width: 100%;
  min-height: 38px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #eaf6ff;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}

.telegram-header-dropdown-item:hover {
  background: rgba(97, 218, 251, 0.08);
  border-color: rgba(97, 218, 251, 0.14);
}

.telegram-header-dropdown-item--danger {
  color: #ffb3b3;
}

.telegram-header-user img {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
}

.network-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 13, 23, 0.66);
  color: #dceaff;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(60, 255, 181, 0.65);
  animation: pulse 1.8s infinite;
}

/* ══ CONTROL PANEL ══ */
.control-panel,
.section-block,
.toolbar {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.control-panel {
  border-radius: 16px;
  padding: 22px;
}

.wallet-form label {
  display: block;
  margin-bottom: 10px;
  color: #c4d3e8;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
}

.wallet-connect-panel {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(190px, auto);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(97, 218, 251, 0.14);
  border-radius: 14px;
  background: rgba(4, 8, 16, 0.36);
}

.wallet-connect-panel span {
  display: block;
  font-weight: 900;
  color: #dbe8f8;
}

.wallet-connect-panel p {
  margin: 4px 0 0;
  font-size: 0.86rem;
}

.ton-connect-mount {
  display: flex;
  justify-content: flex-end;
}

.hero-ton-connect {
  flex: 0 0 auto;
  min-height: 42px;
  align-items: center;
}

.hero-ton-connect button,
.hero-ton-connect [role="button"] {
  min-height: 42px;
}

/* TonConnect UI injects its own menu into the page; keep it in the same dark dashboard style. */
.hero-ton-connect button,
.hero-ton-connect [role="button"],
[class*="ton-connect"] button,
[class*="tc-"] button,
[class*="tonconnect"] button {
  color: #eaf6ff !important;
  background: rgba(13, 20, 34, 0.96) !important;
  border: 1px solid rgba(97, 218, 251, 0.2) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32) !important;
}

.hero-ton-connect button:hover,
.hero-ton-connect [role="button"]:hover,
[class*="ton-connect"] button:hover,
[class*="tc-"] button:hover,
[class*="tonconnect"] button:hover {
  background: rgba(22, 33, 52, 0.98) !important;
  border-color: rgba(97, 218, 251, 0.34) !important;
}

[class*="ton-connect"] [role="menu"],
[class*="tc-"] [role="menu"],
[class*="tonconnect"] [role="menu"],
[class*="ton-connect"] [class*="dropdown"],
[class*="tc-"] [class*="dropdown"],
[class*="tonconnect"] [class*="dropdown"] {
  color: #eaf6ff !important;
  background: rgba(7, 12, 22, 0.98) !important;
  border: 1px solid rgba(97, 218, 251, 0.22) !important;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5) !important;
}

[class*="ton-connect"] [role="menuitem"],
[class*="tc-"] [role="menuitem"],
[class*="tonconnect"] [role="menuitem"] {
  color: #eaf6ff !important;
  background: rgba(13, 20, 34, 0.96) !important;
}

[class*="ton-connect"] [role="menuitem"]:hover,
[class*="tc-"] [role="menuitem"]:hover,
[class*="tonconnect"] [role="menuitem"]:hover {
  background: rgba(97, 218, 251, 0.1) !important;
}

.tc-dark-menu {
  color: #eaf6ff !important;
  background: rgba(7, 12, 22, 0.98) !important;
  border-color: rgba(97, 218, 251, 0.18) !important;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.52) !important;
}

.tc-dark-action {
  color: #eaf6ff !important;
  background: rgba(13, 20, 34, 0.96) !important;
  border: 1px solid rgba(97, 218, 251, 0.18) !important;
  box-shadow: none !important;
}

.tc-dark-action:hover {
  color: #ffffff !important;
  background: rgba(22, 33, 52, 0.98) !important;
  border-color: rgba(97, 218, 251, 0.34) !important;
}

.tc-dark-action svg,
.tc-dark-action path,
.tc-dark-action span,
.tc-dark-action div {
  color: #eaf6ff !important;
  fill: #eaf6ff !important;
  stroke: #eaf6ff !important;
}

.ton-connect-info {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  text-align: left;
}

.ton-connect-info b {
  color: var(--green);
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(4, 8, 16, 0.72);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(97, 218, 251, 0.75);
  box-shadow: 0 0 0 3px rgba(97, 218, 251, 0.12);
}

.secondary {
  color: #e9f3ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  box-shadow: none;
}

.secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ══ LOADING ══ */
.loading,
.error {
  margin-top: 18px;
  border-radius: 8px;
  padding: 14px 16px;
}

.loading {
  display: grid;
  gap: 10px;
  background: rgba(97, 218, 251, 0.1);
  color: #dff8ff;
}

.loading-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.loading-head b {
  color: var(--green);
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(4, 8, 16, 0.72);
  border: 1px solid var(--line);
}

.progress-bar {
  display: block;
  width: 3%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green), #ffb86c);
  box-shadow: 0 0 22px rgba(74, 255, 187, 0.35);
  transition: width 0.35s ease;
}

.error {
  background: rgba(255, 107, 107, 0.12);
  color: #ffd7d7;
}

.hidden {
  display: none !important;
}

.results {
  margin-top: 22px;
}

/* ══ TOOLBAR ══ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 16px;
  padding: 20px 22px;
}

.toolbar h2,
.section-title h2 {
  margin-bottom: 6px;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
  margin-bottom: 0;
}

/* ══ SUMMARY CARDS ══ */
.summary-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.asset-card,
.section-block {
  border-radius: 16px;
}

.stat-card,
.asset-card {
  border: 1px solid var(--line);
  background: rgba(12, 18, 30, 0.82);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  min-height: 36px;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  font-size: 1.45rem;
}

/* ══ ACTIVITY TIMELINE ══ */
.timeline-section {
  margin-top: 18px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(97, 218, 251, 0.06), rgba(74, 255, 187, 0.04)),
    rgba(12, 18, 30, 0.82);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.timeline-head h2 {
  margin-bottom: 6px;
}

.timeline-switch {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 8, 16, 0.5);
}

.timeline-switch button {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #dce8f8;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.timeline-switch button.is-active {
  color: #06111f;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.timeline-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.timeline-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #dff8ff;
  background: rgba(97, 218, 251, 0.09);
  border: 1px solid rgba(97, 218, 251, 0.14);
  font-size: 0.82rem;
  font-weight: 800;
}

.timeline-chart {
  min-height: 210px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(34px, 1fr);
  align-items: end;
  gap: 8px;
  padding: 14px 8px 4px;
  overflow-x: auto;
}

.timeline-bar {
  min-width: 34px;
  height: 190px;
  display: grid;
  grid-template-rows: 24px 1fr 6px 22px;
  gap: 7px;
  align-items: end;
  justify-items: center;
}

.timeline-bar-value {
  color: #dce8f8;
  font-size: 0.76rem;
  font-weight: 900;
}

.timeline-bar-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 999px;
  background: rgba(4, 8, 16, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.timeline-bar-track span {
  width: 100%;
  min-height: 10px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, var(--green), var(--cyan));
  box-shadow: 0 0 18px rgba(74, 255, 187, 0.22);
}

.timeline-volume {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.timeline-volume span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--green));
}

.timeline-bar small {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}


/* ══ WALLET PROFILE ══ */
.wallet-profile {
  margin-top: 18px;
}

.wallet-profile + .toolbar {
  margin-top: 18px;
}

.wallet-profile-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(97, 218, 251, 0.08), rgba(74, 255, 187, 0.05)),
    rgba(12, 18, 30, 0.86);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  padding: 22px;
  overflow: hidden;
  position: relative;
}

.wallet-profile-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--orange));
}

.wallet-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.wallet-profile-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.wallet-profile-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.activity-badge,
.risk-badge {
  min-width: 0;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 8, 16, 0.56);
  padding: 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.activity-badge span,
.risk-badge span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.activity-badge strong,
.risk-badge strong {
  display: block;
  font-size: 1.15rem;
}

.risk-badge em {
  color: #dceaff;
  font-style: normal;
  font-size: 0.84rem;
}

.activity-badge--safe strong,
.activity-badge--active strong {
  color: var(--green);
}

.activity-badge--neutral strong {
  color: var(--cyan);
}

.activity-badge--nft strong {
  color: #c7a8ff;
}

.activity-badge--warning strong {
  color: var(--orange);
}

.activity-badge--danger strong {
  color: var(--red);
}

.risk-badge--low strong {
  color: var(--green);
}

.risk-badge--medium strong {
  color: var(--orange);
}

.risk-badge--high strong {
  color: var(--red);
}

.wallet-profile-risk {
  margin-top: 16px;
  border: 1px solid rgba(97, 218, 251, 0.18);
  border-radius: 14px;
  background: rgba(4, 8, 16, 0.38);
  padding: 16px;
}

.wallet-profile-risk-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.wallet-profile-risk-head h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.wallet-profile-risk-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
  color: var(--muted);
  font-size: 0.9rem;
}

.wallet-profile-risk-meta b {
  color: var(--text);
}

.wallet-profile-risk--low {
  border-color: rgba(60, 255, 181, 0.22);
}

.wallet-profile-risk--medium {
  border-color: rgba(255, 184, 108, 0.24);
}

.wallet-profile-risk--high {
  border-color: rgba(255, 107, 107, 0.24);
}

.risk-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.risk-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: #dff8ff;
  font-size: 0.84rem;
}

.risk-chip--low,
.risk-chip--safe {
  border-color: rgba(60, 255, 181, 0.24);
  background: rgba(60, 255, 181, 0.08);
}

.risk-chip--medium {
  border-color: rgba(255, 184, 108, 0.24);
  background: rgba(255, 184, 108, 0.1);
}

.risk-chip--high {
  border-color: rgba(255, 107, 107, 0.24);
  background: rgba(255, 107, 107, 0.1);
}

.wallet-profile-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.wallet-profile-metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 8, 16, 0.46);
  padding: 14px;
  min-height: 96px;
}

.wallet-profile-metric span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.wallet-profile-metric b {
  display: block;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.35;
}

.wallet-profile-note {
  margin-top: 14px;
  border: 1px solid rgba(97, 218, 251, 0.18);
  border-radius: 12px;
  background: rgba(97, 218, 251, 0.07);
  color: #dff8ff;
  padding: 12px 14px;
  font-size: 0.9rem;
}

/* ══ ASSET CARDS (TON / USDT / PX) ══ */
.asset-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.asset-card {
  overflow: hidden;
  padding: 20px;
  position: relative;
}

.asset-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.asset-card.usdt::before {
  background: linear-gradient(90deg, #26a17b, #4affbb);
}

.asset-card.px::before {
  background: linear-gradient(90deg, #ffb86c, #ff6b6b);
}

.asset-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.asset-head h3 {
  margin: 8px 0 2px;
  font-size: 1.45rem;
}

.asset-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.coin-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #06111f;
  font-weight: 900;
  background: linear-gradient(135deg, #66e4ff, #4affbb);
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

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

.metric-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.text-button {
  padding: 7px 10px;
  color: var(--cyan);
  background: rgba(97, 218, 251, 0.09);
  box-shadow: none;
  font-size: 0.84rem;
}

/* ══ SECTION BLOCKS ══ */
.section-block {
  margin-top: 18px;
  padding: 22px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.section-actions .muted {
  margin-bottom: 0;
}

/* ══ COINS — новые карточки ══ */
.coins-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.coin-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 16, 28, 0.85);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.coin-card:hover {
  border-color: rgba(97, 218, 251, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.32);
}

.coin-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  opacity: 0.6;
}

.coin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.coin-card-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coin-card-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.78rem;
  color: #06111f;
  background: linear-gradient(135deg, #66e4ff, #4affbb);
  flex-shrink: 0;
}

.coin-card-symbol {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
}

.coin-card-fullname {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1px;
}

.coin-card-diff {
  font-weight: 800;
  font-size: 0.95rem;
  text-align: right;
}

.coin-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.coin-card-metrics span {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(97, 218, 251, 0.12);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(4, 8, 16, 0.35);
  font-size: 0.74rem;
}

.coin-card-metrics b {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
}

.coin-card-bars {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.coin-bar-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
}

.coin-bar-label {
  color: var(--muted);
  width: 68px;
  flex-shrink: 0;
}

.coin-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.coin-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.coin-bar-fill--in {
  background: linear-gradient(90deg, var(--green), #22d4a0);
}

.coin-bar-fill--out {
  background: linear-gradient(90deg, var(--orange), #e07040);
}

.coin-bar-value {
  color: var(--text);
  font-weight: 600;
  min-width: 60px;
  text-align: right;
  font-size: 0.76rem;
}

.coin-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.coin-card-footer span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.coin-card-footer .small-button {
  flex: 0 0 auto;
}

/* TOP WALLETS */
.top-wallets-section {
  background:
    radial-gradient(circle at 16% 0%, rgba(0, 136, 204, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(23, 33, 43, 0.96), rgba(12, 18, 30, 0.94));
}

.top-wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.top-wallet-card {
  min-width: 0;
  border: 1px solid rgba(91, 128, 163, 0.2);
  border-radius: 16px;
  background: rgba(8, 14, 26, 0.74);
  overflow: hidden;
}

.top-wallet-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid rgba(91, 128, 163, 0.16);
  background: rgba(0, 136, 204, 0.055);
}

.top-wallet-card-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-wallet-card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.top-wallet-card-head small {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.top-wallet-list {
  display: grid;
}

.top-wallet-row {
  display: grid;
  grid-template-columns: 24px minmax(104px, 1fr) minmax(110px, 0.9fr) auto 32px 32px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(91, 128, 163, 0.14);
}

.top-wallet-row:last-child {
  border-bottom: 0;
}

.top-wallet-row > * {
  min-width: 0;
}

.top-wallet-main,
.top-wallet-money {
  display: grid;
  gap: 2px;
}

.top-wallet-main a {
  color: #36aee2;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-wallet-main small,
.top-wallet-money small {
  color: var(--muted);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-wallet-money b {
  color: #f3f8fd;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-tag {
  display: inline-flex;
  justify-content: center;
  min-width: 62px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.wallet-tag--exchange {
  color: #dff5ff;
  background: rgba(0, 136, 204, 0.22);
  border: 1px solid rgba(54, 174, 226, 0.34);
}

.wallet-tag--personal {
  color: #dfffea;
  background: rgba(74, 255, 187, 0.12);
  border: 1px solid rgba(74, 255, 187, 0.24);
}

/* ══ ТАБЛИЦА (скрыта, оставлена для совместимости) ══ */
.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: #c7d6eb;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.04);
}

td {
  color: #e8f0fb;
}

tr:last-child td {
  border-bottom: 0;
}

.symbol-pill,
.direction {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
}

.symbol-pill {
  color: #dff8ff;
  background: rgba(97, 218, 251, 0.13);
}

.direction.in {
  color: var(--green);
  background: rgba(60, 255, 181, 0.1);
}

.direction.out {
  color: var(--orange);
  background: rgba(255, 184, 108, 0.12);
}

.small-button,
.icon-button {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 8px;
  box-shadow: none;
  color: #eaf6ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.favorite-quick-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
}

.favorite-quick-icon {
  font-size: 1rem;
  line-height: 1;
}

.favorite-quick-button.is-active {
  color: #06111f;
  background: linear-gradient(135deg, #66e4ff, #4affbb);
  border-color: transparent;
}

.favorite-quick-button.is-active .favorite-quick-icon {
  color: #ff5b8a;
}

.expanded-row td {
  background: rgba(4, 8, 16, 0.45);
}

.details-panel {
  max-width: 100%;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 8, 16, 0.48);
}

.inline-details {
  margin-top: 14px;
}

.detail-controls,
.filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.filters {
  grid-template-columns: 1.5fr repeat(5, minmax(140px, 1fr));
}

.details-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 14px;
}

.details-columns h4 {
  margin-bottom: 10px;
  color: #dceaff;
}

.peer-row {
  display: grid;
  grid-template-columns: 24px minmax(118px, 1fr) minmax(96px, 0.72fr) minmax(116px, 0.9fr) minmax(118px, 0.86fr) minmax(48px, 0.42fr) 34px 28px;
  gap: 7px;
  align-items: center;
  min-height: 54px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  color: #dce8f8;
  font-size: 0.86rem;
}

.peer-row > * {
  min-width: 0;
}

.peer-row a,
.peer-row b,
.peer-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer-row b {
  font-size: 0.9rem;
}

.peer-row:last-child {
  border-bottom: 0;
}

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

.icon-link {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

/* ══ ГРАФ ПУЗЫРЬКОВ — исправленный layout ══ */
.wallet-graph {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 8, 16, 0.42);
  overflow: hidden;
}

.wallet-graph-scroll {
  max-height: 620px;
  overflow: auto;
}

.wallet-graph-canvas {
  position: relative;
  min-width: 1000px;
  overflow: hidden;
}

.graph-node {
  position: absolute;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(12, 18, 30, 0.92);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.graph-main {
  width: 180px;
  min-height: 64px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  text-align: center;
}

.graph-main span,
.graph-peer span {
  color: var(--muted);
  font-size: 0.78rem;
}

.graph-main b {
  color: var(--green);
  font-size: 0.9rem;
}

/* ── Пузырьки: position: absolute → фиксированная позиция без сдвигов ── */
.graph-peer {
  width: 96px;
  /* высота задаётся через --bubble */
  min-height: calc(var(--bubble) + 24px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  justify-items: center;
  align-items: start;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  /* убираем transform — центровка теперь только через left/top в JS */
  transform: none;
}

.graph-bubble {
  width: var(--bubble);
  height: var(--bubble);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #06101d;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), 0 0 22px rgba(97, 218, 251, 0.16);
}

.graph-left .graph-bubble {
  background: linear-gradient(145deg, #ffd087, #ff9f43);
}

.graph-right .graph-bubble {
  background: linear-gradient(145deg, #55ffc3, #22b88a);
}

.graph-bubble span {
  width: 82%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #06101d;
  font-size: 0.68rem;
  font-weight: 900;
}

.graph-bubble b {
  color: #06101d;
  font-size: clamp(0.72rem, calc(var(--bubble) / 58 * 1rem), 1rem);
  line-height: 1;
}

.graph-peer small {
  width: 96px;
  min-width: 0;
  color: #dbe8f8;
  font-size: 0.68rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.graph-peer .icon-button {
  position: absolute;
  top: calc(var(--bubble) - 24px);
  right: 4px;
  min-height: 24px;
  width: 28px;
  padding: 3px 5px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.graph-peer:hover .icon-button {
  opacity: 1;
}

.wallet-graph-mobile {
  display: none;
}

.mobile-graph-group,
.mobile-graph-main {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 14, 26, 0.74);
}

.mobile-graph-main {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 14px;
  text-align: center;
}

.mobile-graph-main span {
  color: var(--muted);
  font-size: 0.8rem;
}

.mobile-graph-main b {
  color: var(--green);
}

.mobile-graph-group {
  padding: 12px;
  overflow: hidden;
}

.mobile-graph-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.mobile-graph-title h4 {
  margin: 0;
}

.mobile-graph-title span {
  color: var(--muted);
  font-size: 0.78rem;
}

.mobile-bubble-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 8px;
  min-height: 132px;
}

.mobile-graph-bubble {
  width: var(--bubble);
  min-width: var(--bubble);
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #06101d;
  text-decoration: none;
  transform: translateY(var(--shift));
}

.mobile-graph-bubble span,
.mobile-graph-bubble b {
  grid-area: 1 / 1;
  z-index: 1;
}

.mobile-graph-bubble::before {
  content: "";
  grid-area: 1 / 1;
  width: var(--bubble);
  height: var(--bubble);
  border-radius: 999px;
  background: linear-gradient(145deg, #ffd087, #ff9f43);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.mobile-graph-bubble.right::before {
  background: linear-gradient(145deg, #55ffc3, #22b88a);
}

.mobile-graph-bubble span {
  align-self: start;
  max-width: calc(var(--bubble) - 10px);
  margin-top: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.58rem;
  font-weight: 900;
}

.mobile-graph-bubble b {
  align-self: center;
  font-size: 1rem;
  line-height: 1;
}

.mobile-graph-bubble small {
  color: #dbe8f8;
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.graph-left {
  left: 38px;
}

.graph-right {
  right: 38px;
}

.graph-peer.graph-left,
.graph-peer.graph-right {
  right: auto;
}

.graph-column-label {
  position: absolute;
  top: 0;
  z-index: 2;
  width: 220px;
  padding: 9px;
  color: #dceaff;
  background: rgba(4, 8, 16, 0.86);
  font-weight: 900;
  font-size: 0.9rem;
}

.graph-left-label {
  left: 38px;
}

.graph-right-label {
  left: calc(100% - 258px);
}

.inline-details .detail-controls {
  grid-template-columns: 1fr;
}

.inline-details .details-columns {
  grid-template-columns: 1fr;
}

.inline-details .peer-row {
  grid-template-columns: 22px minmax(84px, 1fr) minmax(66px, 0.62fr) minmax(86px, 0.82fr) 30px 26px;
  gap: 7px;
}

.inline-details .peer-row span:nth-of-type(3),
.inline-details .peer-row span:nth-of-type(4) {
  display: none;
}

/* ══ TOAST ══ */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ══ СРАВНЕНИЕ КОШЕЛЬКОВ ══ */
.compare-section {
  margin-top: 28px;
  padding: 24px;
}

.compare-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}

.compare-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #c4d3e8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compare-input-row {
  display: flex;
  gap: 8px;
}

.compare-input-row input {
  flex: 1;
}

.compare-vs {
  align-self: end;
  padding-bottom: 12px;
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.compare-results {
  margin-top: 20px;
}

.compare-wallets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 8, 16, 0.4);
}

.compare-wallet-badge {
  font-family: monospace;
  font-size: 0.82rem;
  color: #ffd087;
  background: rgba(255, 184, 108, 0.1);
  border: 1px solid rgba(255, 184, 108, 0.25);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.compare-wallet-badge--b {
  color: #55ffc3;
  background: rgba(85, 255, 195, 0.1);
  border-color: rgba(85, 255, 195, 0.25);
}

.compare-divider-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.compare-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compare-col {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 14, 26, 0.7);
  overflow: hidden;
}

.compare-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-weight: 800;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.compare-col-head--out {
  color: var(--orange);
}

.compare-col-head--in {
  color: var(--green);
}

.compare-col-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 900;
  background: rgba(255, 184, 108, 0.15);
  color: var(--orange);
  flex-shrink: 0;
}

.compare-col-icon--in {
  background: rgba(60, 255, 181, 0.12);
  color: var(--green);
}

.compare-badge {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 184, 108, 0.15);
  color: var(--orange);
}

.compare-badge--in {
  background: rgba(60, 255, 181, 0.12);
  color: var(--green);
}

.compare-col-desc {
  padding: 10px 16px 0;
  font-size: 0.78rem;
}

.compare-list {
  padding: 8px 0;
  max-height: 420px;
  overflow-y: auto;
}

.compare-row {
  display: grid;
  grid-template-columns: 18px 1fr auto auto 26px;
  gap: 8px;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 0.83rem;
  color: #dce8f8;
  transition: background 0.15s;
}

.compare-row:last-child {
  border-bottom: 0;
}

.compare-row:hover {
  background: rgba(97, 218, 251, 0.04);
}

.compare-row-rank {
  color: var(--muted);
  font-size: 0.74rem;
}

.compare-row-addr {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
  font-size: 0.8rem;
}

.compare-row-txs {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.74rem;
}

.compare-row-dot-a {
  color: #ffd087;
  font-weight: 700;
}

.compare-row-dot-b {
  color: #55ffc3;
  font-weight: 700;
}

.compare-row-total {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.compare-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.compare-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* PRICING */
.pricing-section {
  margin-top: 24px;
  background:
    radial-gradient(circle at 84% 0%, rgba(0, 136, 204, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(23, 33, 43, 0.94), rgba(11, 16, 27, 0.94));
}

.pricing-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.pricing-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(91, 128, 163, 0.22);
  border-radius: 18px;
  background: rgba(8, 14, 26, 0.72);
}

.pricing-card--pro {
  border-color: rgba(0, 136, 204, 0.46);
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.2), transparent 42%),
    rgba(8, 14, 26, 0.78);
  box-shadow: 0 18px 44px rgba(0, 136, 204, 0.13);
}

.pricing-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #36aee2;
  font-weight: 900;
}

.pricing-card-head b {
  color: #f3f8fd;
  font-size: 1.05rem;
}

.pricing-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

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

.pricing-card li {
  position: relative;
  padding-left: 22px;
  color: #dbe8f8;
}

.pricing-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #0088cc;
  box-shadow: 0 0 14px rgba(0, 136, 204, 0.6);
}

.pricing-button {
  justify-self: start;
  margin-top: 4px;
}

@media (max-width: 1120px) {
  .top-wallet-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .top-wallet-row {
    grid-template-columns: 20px minmax(0, 1fr) auto;
  }

  .top-wallet-money {
    grid-column: 2 / 4;
  }

  .top-wallet-row .wallet-tag {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }

  .top-wallet-row .icon-button {
    display: none;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

footer {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 34px;
  color: var(--muted);
  text-align: center;
}

/* ══ ANIMATIONS ══ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 12px rgba(60, 255, 181, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(60, 255, 181, 0);
  }
}

/* ══ RESPONSIVE ══ */
@media (max-width: 1060px) {
  .summary-grid,
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .details-columns {
    grid-template-columns: 1fr;
  }

  .peer-row {
    grid-template-columns: 24px minmax(82px, 1fr) minmax(82px, auto) 32px 28px;
  }

  .peer-row span:nth-of-type(3),
  .peer-row span:nth-of-type(4) {
    display: none;
  }

  .wallet-graph-canvas {
    min-width: 760px;
  }

  .graph-peer,
  .graph-column-label {
    width: 150px;
  }

  .graph-right-label {
    left: calc(100% - 188px);
  }

  .compare-inputs {
    grid-template-columns: 1fr 1fr;
  }

  .compare-vs {
    display: none;
  }

  .compare-inputs button:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 16px, 1440px);
    padding-top: 12px;
  }

  .hero {
    margin-top: 8px;
    padding: 16px;
    border-radius: 18px;
    flex-wrap: wrap;
    gap: 14px;
  }

  .hero-brand h1 {
    font-size: 1.35rem;
  }

  .hero-logo {
    width: 36px;
    height: 36px;
  }

  .hero-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .telegram-header-login,
  .telegram-header-user {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 0.76rem;
  }

  .network-badge {
    font-size: 0.76rem;
    padding: 9px 12px;
  }

  .subtitle {
    font-size: 0.86rem;
  }

  .wallet-connect-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .ton-connect-mount,
  .ton-connect-info {
    justify-content: flex-start;
    text-align: left;
  }

  .input-row,
  .summary-grid,
  .asset-grid,
  .detail-controls,
  .filters {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .section-title {
    display: grid;
    gap: 10px;
    align-items: start;
  }

  .section-actions {
    justify-content: flex-start;
    align-items: center;
    margin-top: 0;
  }

  .toolbar-actions {
    margin-top: 14px;
  }

  .control-panel,
  .toolbar,
  .section-block,
  .asset-card {
    border-radius: 12px;
    padding: 13px;
  }

  .section-block {
    margin-top: 14px;
  }

  .section-title h2,
  .toolbar h2 {
    font-size: 1.35rem;
  }

  .metric-list > div {
    grid-template-columns: 1fr auto;
  }

  .metric-list .text-button {
    grid-column: 1 / -1;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #txSearch,
  #addressFilter {
    grid-column: 1 / -1;
  }

  .table-shell {
    border-radius: 10px;
  }

  table {
    min-width: 520px;
    font-size: 0.82rem;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .direction {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 0.72rem;
  }

  .details-panel {
    padding: 8px;
  }

  .timeline-section {
    padding: 13px;
  }

  .timeline-head {
    display: grid;
    gap: 10px;
  }

  .timeline-switch {
    width: fit-content;
  }

  .timeline-chart {
    grid-auto-columns: minmax(28px, 38px);
    min-height: 170px;
    padding-inline: 2px;
  }

  .timeline-bar {
    height: 154px;
    grid-template-rows: 20px 1fr 5px 18px;
  }

  .timeline-bar small {
    font-size: 0.58rem;
  }

  .coins-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .coin-card {
    padding: 13px;
  }

  .coin-card-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .coin-card-metrics span {
    padding: 7px;
    font-size: 0.68rem;
  }

  .coin-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .coin-card-footer .small-button {
    width: 100%;
  }

  .details-columns h4 {
    margin: 12px 0 6px;
    font-size: 1rem;
  }

  .peer-row {
    grid-template-columns: 18px minmax(70px, 1fr) minmax(58px, auto) minmax(64px, auto) 24px;
    min-height: 38px;
    padding: 6px 0;
    gap: 6px;
    font-size: 0.74rem;
  }

  .peer-row b {
    font-size: 0.78rem;
  }

  .peer-row span:nth-of-type(3),
  .peer-row span:nth-of-type(4),
  .peer-row .icon-button {
    display: none;
  }

  .peer-row .icon-link {
    font-size: 0.8rem;
  }

  .inline-details .peer-row {
    grid-template-columns: 18px minmax(72px, 1fr) minmax(52px, auto) minmax(62px, auto) 24px;
  }

  .wallet-graph {
    overflow: hidden;
  }

  .wallet-graph-scroll {
    display: none;
  }

  .wallet-graph-mobile {
    display: grid;
    gap: 12px;
    padding: 10px;
  }

  .compare-inputs {
    grid-template-columns: 1fr;
  }

  .compare-vs {
    display: none;
  }

  .compare-columns {
    grid-template-columns: 1fr;
  }

  .compare-input-row {
    flex-direction: column;
  }
}


@media (max-width: 980px) {
  .wallet-profile-head {
    flex-direction: column;
  }
  .wallet-profile-side {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .activity-badge,
  .risk-badge {
    width: 100%;
  }
  .wallet-profile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wallet-profile-risk-head {
    flex-direction: column;
  }
  .wallet-profile-risk-meta {
    justify-items: start;
  }
}

@media (max-width: 620px) {
  .wallet-profile-side,
  .wallet-profile-metrics {
    grid-template-columns: 1fr;
  }
}

/* ══ MULTI WALLET COMPARE ══ */
textarea {
  width: 100%;
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(4, 8, 16, 0.72);
  outline: none;
  resize: vertical;
  font: inherit;
}

textarea:focus {
  border-color: rgba(97, 218, 251, 0.75);
  box-shadow: 0 0 0 3px rgba(97, 218, 251, 0.12);
}

.multi-compare-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.multi-compare-field label {
  display: block;
  margin-bottom: 10px;
  color: #c4d3e8;
  font-weight: 700;
}

.multi-compare-field .muted {
  margin-top: 9px;
  font-size: 0.9rem;
}

.multi-compare-actions {
  display: grid;
  gap: 10px;
  min-width: 230px;
  align-content: center;
  justify-content: center;
}

.multi-compare-results {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.multi-subtitle,
.compact-title {
  margin-bottom: 10px;
  align-items: flex-start;
}

.multi-subtitle h3,
.compact-title h3 {
  margin-bottom: 6px;
}

.multi-leaders {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.multi-leader-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 8, 16, 0.46);
  padding: 14px;
  min-height: 118px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.multi-leader-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.multi-leader-card strong {
  color: var(--green);
  font-size: 1.05rem;
}

.multi-leader-card p {
  margin-bottom: 0;
  color: #dff8ff;
  font-weight: 700;
}

.multi-leader-card--empty strong {
  color: var(--muted);
}

.multi-table-shell table {
  min-width: 1060px;
}

.multi-wallet-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.multi-wallet-index {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: #06111f;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  font-weight: 900;
  font-size: 0.82rem;
}

.multi-winner {
  color: var(--green);
  font-weight: 900;
}

.multi-winner::before {
  content: "★ ";
}

.multi-common-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
}

.multi-common-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(4, 8, 16, 0.32);
  padding: 18px;
}

.multi-common-list,
.multi-pair-list {
  display: grid;
  gap: 10px;
}

.multi-common-row {
  display: grid;
  grid-template-columns: 24px minmax(120px, 1fr) auto auto 28px;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #dce8f8;
  font-size: 0.88rem;
}

.multi-pair-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.multi-pair-card--wide {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
}

.multi-pair-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.multi-pair-card strong {
  color: var(--text);
}

.multi-pair-card p {
  margin-top: 4px;
}

.multi-pair-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.multi-pair-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(97, 218, 251, 0.18);
  background: rgba(97, 218, 251, 0.08);
  font-size: 0.82rem;
}

.multi-empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
}

.multi-empty p {
  margin-top: 6px;
}

@media (max-width: 1180px) {
  .multi-leaders {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .multi-common-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .multi-compare-panel,
  .multi-pair-card {
    grid-template-columns: 1fr;
  }

  .multi-compare-actions {
    min-width: 0;
  }

  .multi-leaders {
    grid-template-columns: 1fr;
  }

  .multi-common-row {
    grid-template-columns: 24px minmax(0, 1fr) auto 28px;
  }

  .multi-common-row span:nth-child(4) {
    display: none;
  }

  .multi-pair-card--wide .compare-columns {
    grid-template-columns: 1fr;
  }

  .multi-pair-card--wide .compare-row {
    grid-template-columns: 18px minmax(0, 1fr) 26px;
  }

  .multi-pair-card--wide .compare-row-txs,
  .multi-pair-card--wide .compare-row-total {
    grid-column: 2 / 3;
    align-items: flex-start;
    text-align: left;
  }

  .multi-pair-card--wide .compare-row .icon-link {
    grid-column: 3 / 4;
    grid-row: 1 / span 3;
  }
}

/* ══ TELEGRAM AUTH + FAVORITES ══ */
.auth-favorites-section {
  margin-top: 18px;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: stretch;
}

.auth-card,

.favorites-card--single {
  grid-column: 1 / -1;
}

.favorites-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 8, 16, 0.36);
  padding: 18px;
}

.auth-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.auth-card h2,
.favorites-card h2 {
  margin-bottom: 8px;
}

.telegram-login-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.telegram-login-button {
  color: #06111f;
  background: linear-gradient(135deg, #66e4ff, #4affbb);
}

.telegram-excel-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #eaf6ff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.telegram-login-widget {
  min-height: 48px;
  display: flex;
  align-items: center;
}

.auth-note {
  border: 1px solid rgba(97, 218, 251, 0.18);
  border-radius: 12px;
  background: rgba(97, 218, 251, 0.07);
  color: #dff8ff;
  padding: 13px 14px;
  line-height: 1.45;
}

.telegram-user-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(97, 218, 251, 0.18);
  border-radius: 12px;
  background: rgba(97, 218, 251, 0.07);
  padding: 12px;
}

.telegram-user-card img {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  object-fit: cover;
}

.telegram-user-card b,
.telegram-user-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-warning,
.favorites-empty {
  border: 1px solid rgba(255, 184, 108, 0.22);
  border-radius: 12px;
  background: rgba(255, 184, 108, 0.08);
  color: #ffe3bf;
  padding: 13px 14px;
  line-height: 1.45;
}

.favorites-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.favorites-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.favorite-wallet-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 13, 23, 0.66);
  padding: 12px;
}

.favorite-select {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.favorite-select input {
  width: 18px;
  min-height: 18px;
  accent-color: #4affbb;
}

.favorite-wallet-main {
  min-width: 0;
}

.favorite-wallet-main b,
.favorite-wallet-main code,
.favorite-wallet-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-wallet-main code {
  margin-top: 4px;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
}

.favorite-wallet-main small {
  margin-top: 4px;
  color: var(--muted);
}

.favorite-wallet-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .favorites-head {
    flex-direction: column;
  }

  .favorites-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .telegram-user-card,
  .favorite-wallet-card {
    grid-template-columns: 1fr;
  }

  .favorite-select {
    justify-items: start;
  }

  .favorite-wallet-actions {
    justify-content: flex-start;
  }
}

/* ══ TELEGRAM DARK THEME OVERRIDE ══ */
:root {
  --bg: #0e1621;
  --panel: rgba(23, 33, 43, 0.94);
  --panel-strong: #17212b;
  --line: rgba(84, 169, 235, 0.18);
  --text: #f5f8fb;
  --muted: #8ea2b6;
  --green: #35d07f;
  --red: #ff6f6f;
  --orange: #f5a64a;
  --cyan: #54a9eb;
  --blue: #2aabee;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}

body {
  background:
    radial-gradient(circle at 20% 0%, rgba(42, 171, 238, 0.12), transparent 30%),
    linear-gradient(180deg, #0e1621 0%, #101b27 48%, #0b111a 100%);
}

button {
  color: #ffffff;
  background: #2aabee;
  border: 1px solid rgba(84, 169, 235, 0.2);
  box-shadow: 0 10px 24px rgba(42, 171, 238, 0.18);
}

button:hover {
  background: #229ed9;
  box-shadow: 0 14px 30px rgba(42, 171, 238, 0.24);
}

button.secondary,
.small-button,
.icon-button,
.telegram-excel-link {
  color: #e8f3ff;
  background: #232e3c;
  border-color: rgba(120, 144, 170, 0.22);
}

button.secondary:hover,
.small-button:hover,
.icon-button:hover,
.telegram-excel-link:hover {
  background: #2b3848;
  border-color: rgba(84, 169, 235, 0.34);
}

.hero {
  border-color: rgba(84, 169, 235, 0.18);
  background:
    linear-gradient(135deg, rgba(23, 33, 43, 0.98), rgba(17, 27, 39, 0.96)),
    radial-gradient(circle at 12% 0%, rgba(42, 171, 238, 0.16), transparent 34%);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
}

.hero-logo {
  box-shadow: 0 0 24px rgba(42, 171, 238, 0.28);
}

.hero-logo circle {
  fill: #2aabee;
}

.eyebrow {
  color: #54a9eb;
}

.telegram-header-login,
.favorite-quick-button.is-active {
  color: #ffffff;
  background: #2aabee;
  border: 1px solid rgba(84, 169, 235, 0.18);
  box-shadow: 0 10px 24px rgba(42, 171, 238, 0.2);
}

.telegram-header-user,
.network-badge,
.wallet-connect-panel,
.control-panel,
.toolbar,
.section-block,
.wallet-profile-card,
.stat-card,
.asset-card,
.coin-card,
.multi-leader-card,
.multi-common-card,
.favorites-card,
.favorite-wallet-card,
.telegram-user-card {
  background: rgba(23, 33, 43, 0.94);
  border-color: rgba(84, 169, 235, 0.16);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.telegram-header-dropdown,
.tc-dark-menu,
[class*="ton-connect"] [role="menu"],
[class*="tc-"] [role="menu"],
[class*="tonconnect"] [role="menu"] {
  background: #17212b !important;
  border-color: rgba(84, 169, 235, 0.2) !important;
}

.telegram-header-dropdown-item:hover,
.tc-dark-action:hover,
[class*="ton-connect"] [role="menuitem"]:hover,
[class*="tc-"] [role="menuitem"]:hover,
[class*="tonconnect"] [role="menuitem"]:hover {
  background: rgba(84, 169, 235, 0.12) !important;
}

input,
select,
textarea {
  color: #f5f8fb;
  background: #0e1621;
  border-color: rgba(120, 144, 170, 0.24);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(84, 169, 235, 0.85);
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.14);
}

.progress-bar,
.coin-card::before,
.asset-card::before,
.timeline-bar-track span,
.coin-bar-fill--in {
  background: linear-gradient(90deg, #2aabee, #54a9eb);
  box-shadow: 0 0 18px rgba(42, 171, 238, 0.22);
}

.coin-bar-fill--out {
  background: linear-gradient(90deg, #f5a64a, #e9794f);
}

.coin-mark,
.coin-card-mark,
.multi-wallet-index {
  color: #ffffff;
  background: #2aabee;
}

.asset-card.ton,
.asset-card.usdt,
.asset-card.px {
  border-top-color: #2aabee;
}

.asset-card::after {
  opacity: 0.36;
  background: radial-gradient(circle, rgba(42, 171, 238, 0.18), transparent 62%);
}

.direction.in {
  color: #45e58d;
  background: rgba(53, 208, 127, 0.12);
}

.direction.out {
  color: #ffbd73;
  background: rgba(245, 166, 74, 0.12);
}

.graph-left .graph-bubble,
.mobile-graph-bubble::before {
  background: linear-gradient(145deg, #ffbd73, #e58b3d);
}

.graph-right .graph-bubble,
.mobile-graph-bubble.right::before {
  background: linear-gradient(145deg, #54a9eb, #2aabee);
}

.graph-bubble,
.mobile-graph-bubble::before {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.timeline-switch button.is-active {
  color: #ffffff;
  background: #2aabee;
}

.toast {
  background: rgba(23, 33, 43, 0.98);
  border-color: rgba(84, 169, 235, 0.22);
  color: #f5f8fb;
}

/* TELEGRAM UI REFRESH */
:root {
  --bg: #0e1621;
  --panel: rgba(23, 33, 43, 0.96);
  --panel-strong: #17212b;
  --line: rgba(91, 128, 163, 0.24);
  --text: #f3f8fd;
  --muted: #8fa7bb;
  --green: #37d67a;
  --red: #ff7373;
  --orange: #f4a34e;
  --cyan: #62b6f0;
  --blue: #2aabee;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  --tg-bg: #0e1621;
  --tg-panel: #17212b;
  --tg-panel-2: #1f2c3a;
  --tg-panel-3: #223247;
  --tg-blue: #2aabee;
  --tg-blue-2: #62b6f0;
  --tg-bubble-out: #2b5278;
  --tg-bubble-in: #182533;
}

body {
  background:
    radial-gradient(circle at 14% -8%, rgba(42, 171, 238, 0.16), transparent 28%),
    radial-gradient(circle at 92% 5%, rgba(43, 82, 120, 0.22), transparent 30%),
    linear-gradient(180deg, #0e1621 0%, #101b27 48%, #0b111a 100%);
}

.app {
  width: min(1380px, calc(100% - 28px));
}

a {
  color: var(--tg-blue-2);
}

button {
  color: #ffffff;
  background: linear-gradient(180deg, #35baf4 0%, #249bd7 100%);
  border: 1px solid rgba(98, 182, 240, 0.22);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(42, 171, 238, 0.18);
}

button:hover {
  background: linear-gradient(180deg, #45c2f6 0%, #2aabee 100%);
  box-shadow: 0 14px 28px rgba(42, 171, 238, 0.22);
}

button.secondary,
.small-button,
.icon-button,
.text-button,
.telegram-excel-link {
  color: #dcecff;
  background: #223247;
  border: 1px solid rgba(113, 147, 181, 0.28);
  box-shadow: none;
}

button.secondary:hover,
.small-button:hover,
.icon-button:hover,
.text-button:hover,
.telegram-excel-link:hover {
  color: #ffffff;
  background: #2b3e55;
  border-color: rgba(98, 182, 240, 0.45);
}

.hero {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 22px;
  border-color: rgba(98, 182, 240, 0.18);
  background:
    linear-gradient(135deg, rgba(23, 33, 43, 0.98), rgba(17, 27, 39, 0.96)),
    radial-gradient(circle at 8% 0%, rgba(42, 171, 238, 0.16), transparent 34%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(98, 182, 240, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 55%);
}

.hero-left,
.hero-actions {
  position: relative;
  z-index: 1;
}

.hero-brand {
  gap: 12px;
}

.hero-brand h1 {
  font-size: clamp(1.45rem, 2.45vw, 2.1rem);
}

.hero-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(42, 171, 238, 0.08), 0 10px 24px rgba(42, 171, 238, 0.22);
}

.hero-logo circle {
  fill: #2aabee;
}

.eyebrow {
  color: var(--tg-blue-2);
  letter-spacing: 0.06em;
}

.subtitle {
  color: #9fb3c6;
}

.network-badge,
.telegram-header-user,
.telegram-header-login,
.hero-ton-connect button,
.hero-ton-connect [role="button"] {
  min-height: 40px;
  border-radius: 999px !important;
}

.telegram-header-login,
.hero-ton-connect button,
.hero-ton-connect [role="button"] {
  color: #ffffff !important;
  background: #2aabee !important;
  border: 1px solid rgba(98, 182, 240, 0.26) !important;
  box-shadow: 0 10px 22px rgba(42, 171, 238, 0.18) !important;
}

.network-badge,
.telegram-header-user {
  color: #dcecff;
  background: rgba(31, 44, 58, 0.92);
  border: 1px solid rgba(113, 147, 181, 0.26);
  box-shadow: none;
}

.pulse {
  background: #37d67a;
  box-shadow: 0 0 0 6px rgba(55, 214, 122, 0.1);
}

.control-panel,
.toolbar,
.section-block,
.wallet-connect-panel,
.wallet-profile-card,
.stat-card,
.asset-card,
.coin-card,
.auth-card,
.favorites-card,
.favorite-wallet-card,
.telegram-user-card,
.multi-compare-panel,
.multi-leader-card,
.multi-common-card,
.multi-pair-card {
  background:
    linear-gradient(180deg, rgba(27, 39, 52, 0.97), rgba(20, 31, 43, 0.97));
  border: 1px solid rgba(91, 128, 163, 0.2);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.control-panel,
.section-block,
.toolbar {
  padding: 20px;
}

input,
select,
textarea {
  color: #f3f8fd;
  background: #0e1621;
  border: 1px solid rgba(113, 147, 181, 0.26);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

input::placeholder,
textarea::placeholder {
  color: rgba(159, 179, 198, 0.7);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(98, 182, 240, 0.9);
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.13);
}

.loading {
  background: #1f2c3a;
  border: 1px solid rgba(98, 182, 240, 0.16);
  border-radius: 14px;
}

.progress-track {
  background: rgba(8, 16, 25, 0.9);
}

.progress-bar,
.timeline-bar-track span,
.coin-bar-fill--in {
  background: linear-gradient(90deg, #2aabee 0%, #62b6f0 100%);
  box-shadow: 0 0 18px rgba(42, 171, 238, 0.22);
}

.error {
  background: rgba(239, 92, 92, 0.11);
  border: 1px solid rgba(255, 115, 115, 0.22);
  color: #ffd2d2;
}

.summary-grid {
  gap: 12px;
}

.stat-card {
  min-height: 116px;
  background:
    linear-gradient(180deg, rgba(31, 44, 58, 0.94), rgba(23, 33, 43, 0.96));
}

.stat-card span,
.asset-head p,
.coin-card-fullname,
.muted {
  color: #91a8bd;
}

.stat-card strong {
  color: #f7fbff;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.asset-card {
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(42, 171, 238, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(23, 33, 43, 0.98), rgba(15, 24, 35, 0.98));
}

.asset-card::before,
.coin-card::before {
  height: 3px;
  background: linear-gradient(90deg, #2aabee, #62b6f0);
  opacity: 1;
}

.asset-card.usdt::before,
.asset-card.px::before {
  background: linear-gradient(90deg, #2aabee, #62b6f0);
}

.asset-card::after {
  background: radial-gradient(circle, rgba(98, 182, 240, 0.15), transparent 64%);
}

.coin-mark,
.coin-card-mark,
.multi-wallet-index {
  color: #ffffff;
  background: #2aabee;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(42, 171, 238, 0.2);
}

.metric-list > div,
.coin-card-footer,
.peer-row,
th,
td {
  border-color: rgba(91, 128, 163, 0.18);
}

.metric-list .text-button {
  background: #213247;
}

.coins-cards {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.coin-card {
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(23, 33, 43, 0.98), rgba(17, 27, 39, 0.98));
}

.coin-card:hover {
  border-color: rgba(98, 182, 240, 0.42);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

.coin-card-metrics span,
.wallet-profile-metric,
.details-panel,
.table-shell,
.mobile-graph-group,
.mobile-graph-main {
  background: rgba(14, 22, 33, 0.72);
  border-color: rgba(91, 128, 163, 0.2);
}

.coin-bar-track {
  background: rgba(8, 16, 25, 0.9);
}

.symbol-pill {
  color: #d8f0ff;
  background: rgba(42, 171, 238, 0.16);
}

.direction.in {
  color: #50e690;
  background: rgba(55, 214, 122, 0.13);
}

.direction.out {
  color: #ffc06f;
  background: rgba(244, 163, 78, 0.13);
}

.table-shell {
  border-radius: 16px;
}

th {
  color: #b8cbe0;
  background: #1f2c3a;
}

td {
  color: #edf5ff;
}

.filters,
.detail-controls {
  gap: 12px;
}

.details-panel {
  border-radius: 16px;
}

.peer-row a {
  color: #62b6f0;
}

.timeline-section {
  background:
    radial-gradient(circle at top right, rgba(42, 171, 238, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(23, 33, 43, 0.97), rgba(15, 24, 35, 0.97));
}

.timeline-switch {
  background: #0e1621;
  border-color: rgba(91, 128, 163, 0.22);
}

.timeline-switch button {
  background: transparent;
  border: 0;
}

.timeline-switch button.is-active {
  background: #2aabee;
  box-shadow: none;
}

.timeline-chart {
  background: rgba(14, 22, 33, 0.58);
  border: 1px solid rgba(91, 128, 163, 0.18);
  border-radius: 16px;
  padding: 14px 10px;
}

.wallet-graph {
  background:
    radial-gradient(circle at center, rgba(42, 171, 238, 0.08), transparent 38%),
    #0e1621;
  border-color: rgba(91, 128, 163, 0.22);
  border-radius: 18px;
}

.wallet-graph-canvas {
  background:
    linear-gradient(rgba(98, 182, 240, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 182, 240, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}

.graph-main,
.graph-node {
  background: rgba(23, 33, 43, 0.96);
  border-color: rgba(98, 182, 240, 0.24);
}

.graph-main b,
.mobile-graph-main b {
  color: #62b6f0;
}

.graph-left .graph-bubble,
.mobile-graph-bubble::before {
  color: #ffffff;
  background: linear-gradient(145deg, #2b5278, #3b6f9d);
  border-color: rgba(152, 195, 232, 0.26);
}

.graph-right .graph-bubble,
.mobile-graph-bubble.right::before {
  color: #ffffff;
  background: linear-gradient(145deg, #2aabee, #4fc3f7);
  border-color: rgba(190, 230, 255, 0.34);
}

.graph-bubble span,
.graph-bubble b,
.mobile-graph-bubble span,
.mobile-graph-bubble b {
  color: #061522;
}

.graph-peer small,
.mobile-graph-bubble small {
  color: #dcecff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.38);
}

.graph-column-label {
  color: #dcecff;
  background: rgba(31, 44, 58, 0.92);
  border-bottom: 1px solid rgba(91, 128, 163, 0.2);
}

.telegram-header-dropdown,
.tc-dark-menu,
[class*="ton-connect"] [role="menu"],
[class*="tc-"] [role="menu"],
[class*="tonconnect"] [role="menu"] {
  background: #17212b !important;
  border: 1px solid rgba(91, 128, 163, 0.26) !important;
  border-radius: 16px !important;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32) !important;
}

.telegram-header-dropdown-item,
.tc-dark-action,
[class*="ton-connect"] [role="menuitem"],
[class*="tc-"] [role="menuitem"],
[class*="tonconnect"] [role="menuitem"] {
  color: #e8f3ff !important;
  background: transparent !important;
}

.telegram-header-dropdown-item:hover,
.tc-dark-action:hover,
[class*="ton-connect"] [role="menuitem"]:hover,
[class*="tc-"] [role="menuitem"]:hover,
[class*="tonconnect"] [role="menuitem"]:hover {
  background: rgba(42, 171, 238, 0.14) !important;
}

.toast {
  background: #17212b;
  border-color: rgba(98, 182, 240, 0.24);
}

@media (max-width: 760px) {
  .app {
    width: 100%;
    padding: 8px 8px 22px;
  }

  .hero {
    margin-top: 6px;
    padding: 14px;
    border-radius: 18px;
  }

  .hero-brand h1 {
    font-size: 1.45rem;
  }

  .subtitle {
    font-size: 0.84rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .hero-actions > * {
    min-width: 0;
  }

  .network-badge {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .telegram-header-login,
  .hero-ton-connect button,
  .hero-ton-connect [role="button"] {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
  }

  .control-panel,
  .section-block,
  .toolbar,
  .asset-card,
  .coin-card {
    padding: 14px;
    border-radius: 16px;
  }

  .section-title h2,
  .toolbar h2 {
    font-size: 1.18rem;
  }

  .summary-grid,
  .asset-grid {
    gap: 10px;
  }

  .stat-card {
    min-height: 92px;
    padding: 14px;
  }

  .stat-card span {
    font-size: 0.82rem;
  }

  .stat-card strong {
    font-size: 1.35rem;
  }

  .asset-head h3 {
    font-size: 1.25rem;
  }

  .metric-list > div {
    gap: 8px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .table-shell {
    overflow-x: auto;
  }

  table {
    min-width: 640px;
  }

  .wallet-graph-mobile {
    padding: 8px;
  }

  .mobile-bubble-cloud {
    gap: 8px;
    min-height: 104px;
  }

  .mobile-graph-bubble {
    transform: none;
  }
}

@media (max-width: 420px) {
  .hero-actions {
    grid-template-columns: 1fr;
  }

  .coin-card-metrics {
    grid-template-columns: 1fr;
  }

  .coin-card-footer {
    gap: 8px;
  }
}

/* TELEGRAM BLUE + COMPACT MENUS + FISHEYE */
:root {
  --blue: #0088cc;
  --cyan: #36aee2;
  --tg-blue: #0088cc;
  --tg-blue-2: #36aee2;
}

button,
.telegram-header-login,
.hero-ton-connect button,
.hero-ton-connect [role="button"],
.favorite-quick-button.is-active,
.timeline-switch button.is-active {
  background: linear-gradient(180deg, #0088cc 0%, #0077b3 100%) !important;
  border-color: rgba(54, 174, 226, 0.32) !important;
  color: #ffffff !important;
}

button:hover,
.telegram-header-login:hover,
.hero-ton-connect button:hover,
.hero-ton-connect [role="button"]:hover {
  background: linear-gradient(180deg, #0997dc 0%, #0088cc 100%) !important;
}

button.secondary,
.small-button,
.icon-button,
.text-button,
.telegram-excel-link,
.telegram-header-user,
.network-badge {
  background: #1f2c3a !important;
  border-color: rgba(78, 117, 154, 0.34) !important;
}

.hero-logo circle {
  fill: #0088cc;
}

.progress-bar,
.timeline-bar-track span,
.asset-card::before,
.coin-card::before,
.coin-bar-fill--in {
  background: linear-gradient(90deg, #0088cc 0%, #36aee2 100%) !important;
}

.coin-mark,
.coin-card-mark,
.multi-wallet-index {
  background: #0088cc !important;
}

.hero::before {
  background:
    linear-gradient(90deg, rgba(0, 136, 204, 0.1), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 55%);
}

.timeline-section,
.asset-card {
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(23, 33, 43, 0.98), rgba(15, 24, 35, 0.98));
}

.telegram-header-dropdown {
  top: calc(100% + 10px);
  min-width: 210px;
  z-index: 120;
}

.telegram-header-menu:hover .telegram-header-dropdown,
.telegram-header-menu:focus-within .telegram-header-dropdown {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.telegram-header-menu.open .telegram-header-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.telegram-header-dropdown,
.tc-dark-menu,
[class*="ton-connect"] [role="menu"],
[class*="tc-"] [role="menu"],
[class*="tonconnect"] [role="menu"] {
  background: #17212b !important;
  border-color: rgba(54, 174, 226, 0.24) !important;
}

.telegram-header-dropdown-item,
.tc-dark-action,
[class*="ton-connect"] [role="menuitem"],
[class*="tc-"] [role="menuitem"],
[class*="tonconnect"] [role="menuitem"] {
  min-height: 36px !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #e8f3ff !important;
}

.telegram-header-dropdown-item:hover,
.tc-dark-action:hover,
[class*="ton-connect"] [role="menuitem"]:hover,
[class*="tc-"] [role="menuitem"]:hover,
[class*="tonconnect"] [role="menuitem"]:hover {
  background: rgba(0, 136, 204, 0.16) !important;
}

.wallet-graph {
  background:
    radial-gradient(circle at center, rgba(0, 136, 204, 0.1), transparent 38%),
    #0e1621;
}

.wallet-graph-canvas {
  background:
    linear-gradient(rgba(54, 174, 226, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 174, 226, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}

.graph-right .graph-bubble,
.mobile-graph-bubble.right::before {
  background: linear-gradient(145deg, #0088cc, #36aee2) !important;
}

.graph-left .graph-bubble,
.mobile-graph-bubble::before {
  background: linear-gradient(145deg, #2b5278, #4178aa) !important;
}

.graph-peer,
.mobile-graph-bubble {
  --fish-scale: 1;
  transform: scale(var(--fish-scale));
  transform-origin: center;
  transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
  will-change: transform;
}

.graph-peer.fisheye-hot,
.mobile-graph-bubble.fisheye-hot {
  filter: brightness(1.08) saturate(1.08);
}

.graph-peer.fisheye-hot .graph-bubble {
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34),
    0 0 26px rgba(0, 136, 204, 0.24);
}

@media (max-width: 760px) {
  .telegram-header-dropdown {
    left: 0;
    right: auto;
    min-width: min(240px, calc(100vw - 28px));
  }

  .graph-peer,
  .mobile-graph-bubble {
    transform: none;
  }
}

/* SOURCE OF FUNDS MAP */
.source-map-section {
  overflow: hidden;
}

.source-map-title {
  align-items: start;
}

.source-map-controls {
  display: grid;
  grid-template-columns: minmax(140px, auto) minmax(170px, auto) auto;
  gap: 10px;
  align-items: center;
}

.source-map-status {
  margin: -4px 0 14px;
}

.source-map-empty,
.source-map-loader {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 150px;
  border: 1px dashed rgba(54, 174, 226, 0.26);
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(0, 136, 204, 0.1), transparent 42%),
    rgba(14, 22, 33, 0.66);
  color: #dcecff;
  text-align: center;
  padding: 24px;
}

.source-map-empty span {
  color: var(--muted);
}

.source-map-loader span {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(54, 174, 226, 0.2);
  border-top-color: #0088cc;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.source-map-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.source-map-grid::before,
.source-map-grid::after {
  content: "";
  position: absolute;
  top: 74px;
  width: calc(50% - 112px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(54, 174, 226, 0.42), transparent);
  pointer-events: none;
}

.source-map-grid::before {
  left: 24px;
}

.source-map-grid::after {
  right: 24px;
}

.source-map-column {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(91, 128, 163, 0.2);
  border-radius: 18px;
  background: rgba(14, 22, 33, 0.58);
}

.source-map-column h3 {
  margin: 0 0 4px;
  color: #f3f8fd;
  font-size: 1rem;
}

.source-map-root {
  position: sticky;
  top: 12px;
  z-index: 2;
  display: grid;
  gap: 6px;
  justify-items: center;
  align-self: start;
  margin-top: 48px;
  padding: 18px 14px;
  border: 1px solid rgba(54, 174, 226, 0.26);
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(0, 136, 204, 0.18), transparent 54%),
    #17212b;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
  text-align: center;
}

.source-map-root span,
.source-map-root small {
  color: var(--muted);
}

.source-map-root b {
  color: #36aee2;
  font-size: 1.05rem;
}

.source-node {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(91, 128, 163, 0.2);
  border-radius: 16px;
  background: rgba(23, 33, 43, 0.92);
}

.source-node--level-2 {
  margin-left: 18px;
  background: rgba(31, 44, 58, 0.82);
}

.source-node--level-3 {
  margin-left: 34px;
  background: rgba(35, 50, 67, 0.72);
}

.source-node-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.source-node-main a {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #36aee2;
  font-weight: 900;
}

.source-node-main span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.source-node > b {
  color: #f3f8fd;
  font-size: 0.88rem;
  line-height: 1.35;
}

.source-node-children {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(91, 128, 163, 0.16);
}

.source-map-column--source .source-node {
  border-left: 3px solid #2b5278;
}

.source-map-column--destination .source-node {
  border-left: 3px solid #0088cc;
}

@media (max-width: 900px) {
  .source-map-controls {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .source-map-grid {
    grid-template-columns: 1fr;
  }

  .source-map-grid::before,
  .source-map-grid::after {
    display: none;
  }

  .source-map-root {
    position: static;
    order: -1;
    margin-top: 0;
  }
}

@media (max-width: 520px) {
  .source-node,
  .source-map-column {
    padding: 10px;
    border-radius: 14px;
  }

  .source-node--level-2 {
    margin-left: 10px;
  }

  .source-node--level-3 {
    margin-left: 18px;
  }
}

/* Bubble graph: keep only circles, no rectangular cards */
.graph-peer.graph-node,
.graph-peer.graph-left,
.graph-peer.graph-right {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.graph-peer::before,
.graph-peer::after {
  display: none !important;
}

.graph-peer small {
  margin-top: 2px;
  padding: 0;
  background: transparent;
}

.graph-peer .icon-button {
  background: rgba(31, 44, 58, 0.86) !important;
  backdrop-filter: blur(8px);
}

.mobile-graph-bubble {
  background: transparent !important;
  box-shadow: none !important;
}

/* BALANCE HISTORY */
.balance-history-section {
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(23, 33, 43, 0.97), rgba(15, 24, 35, 0.97));
}

.balance-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.balance-head h2 {
  margin-bottom: 6px;
}

.balance-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.balance-kpis article {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(91, 128, 163, 0.2);
  border-radius: 15px;
  background: rgba(14, 22, 33, 0.68);
}

.balance-kpis span,
.balance-kpis small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.balance-kpis b {
  display: block;
  margin-top: 7px;
  color: #f3f8fd;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.balance-chart-wrap {
  border: 1px solid rgba(91, 128, 163, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(rgba(54, 174, 226, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 174, 226, 0.035) 1px, transparent 1px),
    rgba(14, 22, 33, 0.68);
  background-size: 48px 48px;
  padding: 12px;
  overflow: hidden;
}

.balance-chart {
  width: 100%;
  height: 260px;
  display: block;
}

.balance-area {
  fill: rgba(0, 136, 204, 0.16);
}

.balance-line {
  fill: none;
  stroke: #36aee2;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(0, 136, 204, 0.34));
}

.balance-dot {
  fill: #e8f6ff;
  stroke: #0088cc;
  stroke-width: 3;
}

.balance-axis {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.74rem;
}

/* SOURCE CHAINS */
.source-node-actions {
  display: flex;
  gap: 6px;
}

.source-chain-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.source-chain-list {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(91, 128, 163, 0.2);
  border-radius: 18px;
  background: rgba(14, 22, 33, 0.58);
}

.source-chain-list h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.source-chain-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 54px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(91, 128, 163, 0.16);
}

.source-chain-row:last-child {
  border-bottom: 0;
}

.source-chain-row > span {
  padding-top: 2px;
  color: var(--muted);
}

.source-chain-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.source-chain-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  overflow: visible;
  padding: 0;
  line-height: 1.45;
}

.source-chain-path a {
  color: #36aee2;
  font-weight: 900;
}

.source-chain-arrow,
.investigation-chain-list em {
  color: var(--muted);
  font-style: normal;
}

.source-chain-arrow--tx {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(54, 174, 226, 0.22);
  border-radius: 999px;
  color: #36aee2;
  background: rgba(0, 136, 204, 0.08);
  text-decoration: none;
}

.source-chain-arrow--tx:hover {
  text-decoration: none;
  background: rgba(0, 136, 204, 0.16);
}

.source-chain-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.source-chain-meta b {
  color: #f3f8fd;
  font-size: 0.9rem;
}

/* INVESTIGATION MODE */
.investigation-title {
  align-items: start;
}

.investigation-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  min-width: min(620px, 100%);
}

.investigation-workspace {
  margin-top: 12px;
}

.investigation-empty {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 140px;
  border: 1px dashed rgba(54, 174, 226, 0.26);
  border-radius: 18px;
  background: rgba(14, 22, 33, 0.62);
  color: #dcecff;
  text-align: center;
  padding: 24px;
}

.investigation-empty span {
  color: var(--muted);
}

.investigation-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) repeat(3, minmax(150px, 0.7fr));
  gap: 10px;
  margin-bottom: 12px;
}

.investigation-card,
.investigation-panel {
  min-width: 0;
  border: 1px solid rgba(91, 128, 163, 0.2);
  border-radius: 18px;
  background: rgba(14, 22, 33, 0.66);
  padding: 14px;
}

.investigation-card span,
.investigation-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.investigation-card h3,
.investigation-card b {
  margin: 7px 0 0;
  color: #f3f8fd;
}

.investigation-target-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.investigation-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  gap: 12px;
}

.investigation-panel--wide {
  grid-column: span 1;
}

.investigation-panel h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.investigation-tags,
.investigation-quick-tags,
.investigation-tag-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.investigation-tags button {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(0, 136, 204, 0.16) !important;
  color: #dff4ff !important;
}

.investigation-tag-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.investigation-panel textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
}

.investigation-events,
.investigation-chain-list {
  display: grid;
  gap: 8px;
}

.investigation-events article,
.investigation-chain-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px;
  border: 1px solid rgba(91, 128, 163, 0.14);
  border-radius: 12px;
  background: rgba(23, 33, 43, 0.72);
}

.investigation-events small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.investigation-chain-list div {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
}

.investigation-chain-list a {
  flex: 0 0 auto;
  color: #36aee2;
  font-weight: 900;
}

.investigation-chain-list b {
  color: #f3f8fd;
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .balance-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-chain-panel,
  .investigation-grid,
  .investigation-layout {
    grid-template-columns: 1fr;
  }

  .investigation-controls {
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .balance-head {
    display: grid;
  }

  .balance-kpis {
    grid-template-columns: 1fr;
  }

  .balance-chart {
    height: 210px;
  }

  .source-chain-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .source-chain-meta {
    grid-column: auto;
  }

  .investigation-tag-add,
  .investigation-events article,
  .investigation-chain-list article {
    grid-template-columns: 1fr;
  }
}

/* FREE / PRO SUBSCRIPTION */
.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(31, 44, 58, 0.88);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.plan-badge--inline {
  min-height: 24px;
  padding: 4px 9px;
  margin-left: 6px;
  vertical-align: middle;
}

.plan-badge--pro {
  border-color: rgba(54, 174, 226, 0.5);
  background: linear-gradient(180deg, rgba(0, 136, 204, 0.96), rgba(0, 102, 153, 0.96));
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 136, 204, 0.22);
}

.plan-status-card {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(54, 174, 226, 0.22);
  border-radius: 16px;
  background: rgba(14, 22, 33, 0.76);
}

.plan-status-card span,
.plan-status-card small {
  color: var(--muted);
}

.plan-status-card b {
  color: #f3f8fd;
}

.pricing-button.is-active {
  background: #1f2c3a !important;
  border-color: rgba(54, 174, 226, 0.34) !important;
  color: #36aee2 !important;
}

.pro-tools-section {
  margin-top: 24px;
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 136, 204, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(23, 33, 43, 0.94), rgba(11, 16, 27, 0.96));
}

.pro-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pro-tool-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(91, 128, 163, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(8, 14, 26, 0.78)),
    rgba(8, 14, 26, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pro-tool-card--wide {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
}

.pro-tool-card h3 {
  margin: 0;
  color: #f3f8fd;
  font-size: 1.16rem;
}

.pro-tool-card--wide h3,
.pro-tool-card--wide .bulk-results {
  grid-column: 1 / -1;
}

.pro-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.55fr);
  gap: 12px;
  align-items: stretch;
}

.pro-tool-card input,
.pro-tool-card select,
.pro-tool-card textarea {
  width: 100%;
  min-width: 0;
  min-height: 58px;
}

.pro-tool-card textarea {
  min-height: 146px;
  resize: vertical;
}

.pro-tool-card--wide textarea {
  grid-column: 1;
  grid-row: 2 / span 2;
}

.pro-tool-actions {
  display: grid;
  gap: 10px;
  align-self: start;
}

.pro-inline-form button,
.pro-tool-card > button {
  grid-column: 1 / -1;
}

.pro-list {
  display: grid;
  gap: 10px;
  min-height: 72px;
}

.pro-mini-lock,
.pro-tool-empty,
.pro-tool-loading,
.pro-tool-error {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed rgba(54, 174, 226, 0.28);
  border-radius: 14px;
  background: rgba(0, 136, 204, 0.08);
  color: #dbe8f8;
}

.pro-tool-error {
  border-color: rgba(255, 100, 100, 0.28);
  background: rgba(255, 90, 90, 0.08);
}

.pro-row,
.bulk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(91, 128, 163, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.58);
}

.pro-row div,
.bulk-row {
  min-width: 0;
}

.pro-row b,
.bulk-row b {
  display: block;
  color: #f3f8fd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pro-row span,
.pro-row small,
.bulk-row span {
  color: var(--muted);
}

.pro-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pro-row-status {
  justify-self: end;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 136, 204, 0.14);
  color: #36aee2 !important;
  font-weight: 800;
}

.alert-history {
  margin: 4px 0 0;
  padding: 0 0 0 18px;
  color: var(--muted);
}

.bulk-table {
  display: grid;
  gap: 10px;
}

.bulk-row {
  grid-template-columns: minmax(110px, 1.2fr) 0.8fr 0.55fr 0.7fr auto;
}

.bulk-row--error {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-color: rgba(255, 100, 100, 0.24);
}

.pro-locked-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(54, 174, 226, 0.26);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(0, 136, 204, 0.18), transparent 34%),
    rgba(14, 22, 33, 0.9);
}

.pro-locked-card h3 {
  margin: 0;
  color: #f3f8fd;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
}

.pro-locked-card p {
  margin: 0;
  color: var(--muted);
}

.pro-locked-card button {
  justify-self: start;
}

.upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(14px);
}

.upgrade-modal.hidden {
  display: none;
}

.upgrade-card {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(560px, 100%);
  padding: 24px;
  border: 1px solid rgba(54, 174, 226, 0.3);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 136, 204, 0.18), transparent 40%),
    #17212b;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.upgrade-card h2 {
  margin: 0;
  color: #f3f8fd;
  font-size: clamp(1.45rem, 4vw, 2.1rem);
}

.upgrade-card p {
  margin: 0;
  color: #b8c7d9;
}

.upgrade-card a {
  color: #36aee2;
  font-weight: 900;
}

.upgrade-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  padding: 0 !important;
  border-radius: 999px !important;
}

.billing-progress {
  display: grid;
  gap: 8px;
}

.billing-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(91, 128, 163, 0.18);
  border-radius: 12px;
  background: rgba(8, 14, 26, 0.52);
  color: #dbe8f8;
}

.billing-step span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #64748b;
}

.billing-step--active span {
  background: #36aee2;
  box-shadow: 0 0 18px rgba(54, 174, 226, 0.7);
}

.billing-step--done span {
  background: #35f0a8;
}

.upgrade-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .pro-tools-grid {
    grid-template-columns: 1fr;
  }

  .pro-tool-card--wide {
    grid-template-columns: 1fr;
  }

  .pro-tool-card--wide textarea,
  .pro-tool-card--wide .pro-tool-actions,
  .pro-tool-card--wide .bulk-results {
    grid-column: auto;
    grid-row: auto;
  }

  .bulk-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .plan-badge--inline {
    margin-left: 0;
  }

  .pro-inline-form,
  .pro-row,
  .bulk-row,
  .bulk-row--error {
    grid-template-columns: 1fr;
  }

  .pro-row-actions,
  .pro-row-status {
    justify-self: stretch;
  }

  .upgrade-actions {
    display: grid;
  }
}

/* FINAL DARK POLISH */
:root {
  --blue: #0088cc;
  --blue-soft: #35aee2;
  --surface: rgba(13, 20, 32, 0.86);
  --surface-2: rgba(18, 28, 43, 0.92);
  --surface-3: rgba(27, 40, 58, 0.9);
  --stroke: rgba(100, 151, 190, 0.22);
  --stroke-strong: rgba(53, 174, 226, 0.34);
}

body {
  background:
    radial-gradient(circle at 14% -10%, rgba(0, 136, 204, 0.28), transparent 34%),
    radial-gradient(circle at 88% 4%, rgba(53, 174, 226, 0.18), transparent 32%),
    linear-gradient(150deg, #07101a 0%, #0a111d 48%, #070b12 100%);
}

.hero,
.control-panel,
.section-block,
.toolbar,
.asset-card,
.stat-card,
.pricing-card,
.pro-tool-card,
.upgrade-card {
  border-color: var(--stroke) !important;
  background:
    linear-gradient(180deg, rgba(18, 28, 43, 0.92), rgba(9, 15, 26, 0.92)) !important;
  box-shadow:
    0 20px 58px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

.hero {
  padding: 22px 24px;
  border-radius: 24px;
  align-items: center;
  overflow: visible;
}

.hero::before {
  opacity: 0.55;
}

.hero-brand h1 {
  font-size: clamp(1.7rem, 2.4vw, 2.35rem) !important;
  letter-spacing: 0;
}

.hero .subtitle {
  max-width: 760px;
  color: #b9c9da;
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
}

.hero-actions {
  align-items: center;
  gap: 10px;
}

button,
.telegram-header-login,
.hero-ton-connect button,
.hero-ton-connect [role="button"] {
  min-height: 44px;
  border-radius: 14px !important;
  padding: 11px 16px;
  background: linear-gradient(180deg, #149bd7 0%, #0088cc 100%) !important;
  border: 1px solid rgba(80, 181, 231, 0.32) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 30px rgba(0, 136, 204, 0.18) !important;
}

button:hover,
.telegram-header-login:hover,
.hero-ton-connect button:hover,
.hero-ton-connect [role="button"]:hover {
  background: linear-gradient(180deg, #25a9df 0%, #0088cc 100%) !important;
  box-shadow: 0 18px 36px rgba(0, 136, 204, 0.24) !important;
}

button.secondary,
.small-button,
.icon-button,
.text-button,
.telegram-excel-link,
.telegram-header-user,
.network-badge,
.pricing-button.is-active {
  background: rgba(30, 44, 62, 0.92) !important;
  border: 1px solid rgba(109, 145, 181, 0.26) !important;
  color: #e9f3ff !important;
  box-shadow: none !important;
}

button.secondary:hover,
.small-button:hover,
.icon-button:hover,
.text-button:hover,
.telegram-excel-link:hover,
.telegram-header-user:hover {
  background: rgba(41, 59, 82, 0.96) !important;
  border-color: rgba(53, 174, 226, 0.38) !important;
}

input,
select,
textarea {
  border-color: rgba(92, 126, 163, 0.28) !important;
  background: rgba(6, 11, 20, 0.78) !important;
  color: #eef6ff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-soft) !important;
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.18) !important;
  outline: none;
}

.section-title {
  gap: 18px;
}

.section-title h2,
.toolbar h2 {
  letter-spacing: 0;
}

.pricing-section {
  padding: 24px;
}

.pricing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pricing-card {
  position: relative;
  min-height: 100%;
  padding: 22px;
  border-radius: 22px;
}

.pricing-card--pro {
  border-color: var(--stroke-strong) !important;
  background:
    radial-gradient(circle at 92% 0%, rgba(0, 136, 204, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(18, 31, 47, 0.98), rgba(9, 15, 26, 0.96)) !important;
}

.pricing-card-head {
  align-items: flex-start;
}

.pricing-card-head span {
  color: var(--blue-soft);
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pricing-card-head b {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 136, 204, 0.12);
  color: #dff6ff !important;
}

.pricing-card ul {
  gap: 9px;
}

.pricing-card li {
  color: #cddbeb;
}

.pricing-button {
  justify-self: stretch;
  margin-top: auto;
}

.pro-tools-section {
  padding: 24px;
}

.pro-tools-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.pro-tool-card {
  border-radius: 22px;
  padding: 22px;
}

.pro-tool-card h3 {
  font-size: 1.18rem;
}

.pro-tool-copy {
  margin: -6px 0 2px;
  color: #93a8bf;
  line-height: 1.45;
}

.pro-inline-form {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.62fr);
}

.pro-inline-form button {
  min-height: 50px;
}

.pro-tool-card--wide {
  grid-template-columns: minmax(0, 1fr) 270px;
}

.pro-tool-actions {
  align-self: stretch;
}

.pro-tool-actions button {
  height: 100%;
  min-height: 58px;
}

.pro-mini-lock,
.pro-tool-empty,
.pro-tool-loading,
.pro-tool-error {
  border-radius: 16px;
  background: rgba(0, 136, 204, 0.065);
}

.pro-row,
.bulk-row {
  border-radius: 16px;
  background: rgba(9, 15, 26, 0.72);
}

.upgrade-modal {
  background: rgba(3, 8, 15, 0.74);
}

.upgrade-card {
  width: min(620px, 100%);
  padding: 26px;
  border-radius: 26px;
}

.upgrade-card .eyebrow {
  color: var(--blue-soft);
}

.billing-step {
  min-height: 52px;
  border-radius: 15px;
  background: rgba(7, 13, 24, 0.72);
}

.billing-step b {
  line-height: 1.2;
}

.upgrade-actions button {
  flex: 1 1 210px;
}

[class*="ton-connect"] [role="menu"],
[class*="tc-"] [role="menu"],
[class*="tonconnect"] [role="menu"],
[class*="ton-connect"] [class*="dropdown"],
[class*="tc-"] [class*="dropdown"],
[class*="tonconnect"] [class*="dropdown"],
.telegram-header-dropdown {
  border-radius: 18px !important;
  background: rgba(18, 28, 43, 0.98) !important;
  border: 1px solid rgba(91, 128, 163, 0.28) !important;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.36) !important;
}

[class*="ton-connect"] [role="menuitem"],
[class*="tc-"] [role="menuitem"],
[class*="tonconnect"] [role="menuitem"],
.telegram-header-dropdown-item {
  border-radius: 12px !important;
  background: transparent !important;
}

@media (max-width: 980px) {
  .hero {
    align-items: stretch;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .network-badge {
    grid-column: 1 / -1;
  }

  .pricing-grid,
  .pro-tools-grid,
  .pro-tool-card--wide {
    grid-template-columns: 1fr;
  }

  .pro-tool-card--wide textarea,
  .pro-tool-actions {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .app {
    width: 100%;
    padding: 10px 10px 22px;
  }

  .hero,
  .control-panel,
  .section-block,
  .toolbar,
  .pricing-section,
  .pro-tools-section {
    padding: 16px !important;
    border-radius: 20px !important;
  }

  .hero {
    margin-top: 0;
  }

  .hero-brand {
    gap: 10px;
  }

  .hero-logo {
    width: 36px !important;
    height: 36px !important;
  }

  .hero-brand h1 {
    font-size: 1.85rem !important;
  }

  .hero .subtitle {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }

  .telegram-header-login,
  .telegram-header-user,
  .hero-ton-connect button,
  .hero-ton-connect [role="button"],
  .network-badge {
    width: 100% !important;
    justify-content: center !important;
    min-height: 42px !important;
    font-size: 0.84rem !important;
  }

  .input-row,
  .toolbar-actions,
  .filters,
  .pro-inline-form,
  .upgrade-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  input,
  select,
  textarea,
  button {
    min-height: 46px;
    font-size: 0.95rem;
  }

  .pricing-card,
  .pro-tool-card,
  .upgrade-card {
    padding: 16px;
    border-radius: 18px;
  }

  .pricing-card-head {
    display: grid;
  }

  .plan-status-card {
    padding: 12px;
    border-radius: 14px;
  }

  .pro-tool-card textarea {
    min-height: 128px;
  }

  .table-shell {
    border-radius: 16px;
  }

  table {
    font-size: 0.86rem;
  }
}

/* UI ALIGNMENT PASS */
:root {
  --ui-gap: 16px;
  --ui-gap-sm: 10px;
  --ui-radius: 18px;
  --ui-radius-lg: 24px;
  --ui-control: 44px;
}

html {
  scrollbar-gutter: stable;
}

.hidden {
  display: none !important;
}

.app {
  width: min(1320px, calc(100% - 32px));
  padding: 22px 0 26px;
  display: grid;
  gap: var(--ui-gap);
}

.hero,
.control-panel,
.toolbar,
.section-block,
.pricing-section,
.pro-tools-section {
  margin-top: 0 !important;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 20px 22px !important;
  min-height: 0;
}

.hero-left {
  min-width: 0;
  gap: 8px;
}

.hero-brand {
  min-width: 0;
}

.hero-brand h1 {
  font-size: clamp(1.85rem, 2.6vw, 2.55rem) !important;
}

.hero .subtitle {
  max-width: 720px;
}

.hero-actions {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  align-items: center;
  gap: var(--ui-gap-sm);
}

.hero-actions > * {
  min-width: 0;
}

.hero-ton-connect {
  display: inline-flex !important;
  align-items: center;
  width: 100%;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#tonConnectMount > *,
#tonConnectMount > * > * {
  width: 100% !important;
}

#tonConnectMount button,
#tonConnectMount [role="button"] {
  width: 100% !important;
}

button,
.telegram-header-login,
.telegram-header-user,
.hero-ton-connect button,
.hero-ton-connect [role="button"],
.network-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--ui-control) !important;
  line-height: 1.1;
  border-radius: 13px !important;
}

button,
.telegram-header-login,
.telegram-header-user,
.hero-ton-connect button,
.hero-ton-connect [role="button"] {
  white-space: nowrap;
}

.network-badge {
  padding: 0 15px !important;
  font-weight: 800;
}

.control-panel {
  padding: 18px !important;
  border-radius: var(--ui-radius-lg) !important;
}

.wallet-form label {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.input-row {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.22fr) 126px 46px !important;
  gap: var(--ui-gap-sm) !important;
  align-items: stretch;
}

.input-row > * {
  min-width: 0;
}

input,
select,
textarea {
  min-height: var(--ui-control) !important;
  border-radius: 13px !important;
}

#favoriteQuickButton {
  width: 46px;
  padding: 0 !important;
}

.favorite-quick-label {
  display: none;
}

.favorite-quick-icon {
  font-size: 1.15rem;
}

.ton-connect-info {
  margin-top: 10px !important;
  padding: 10px 12px;
  border: 1px solid rgba(91, 128, 163, 0.2);
  border-radius: 14px;
  background: rgba(6, 11, 20, 0.5);
}

.results {
  display: grid;
  gap: var(--ui-gap);
  margin-top: 0 !important;
}

.results > *,
.summary-grid,
.asset-grid,
.wallet-profile + .toolbar {
  margin-top: 0 !important;
}

.toolbar,
.section-title,
.balance-head,
.timeline-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.toolbar {
  padding: 18px !important;
  border-radius: var(--ui-radius-lg) !important;
}

.toolbar-actions {
  display: flex !important;
  justify-content: flex-end;
  gap: 9px;
}

.toolbar-actions button {
  min-height: 40px !important;
  padding-inline: 13px;
}

.section-block {
  padding: 18px !important;
  border-radius: var(--ui-radius-lg) !important;
}

.section-title {
  margin-bottom: 14px !important;
}

.section-title h2,
.toolbar h2,
.balance-head h2,
.timeline-head h2 {
  font-size: clamp(1.28rem, 1.8vw, 1.75rem);
  line-height: 1.15;
}

.muted {
  line-height: 1.45;
}

.summary-grid,
.asset-grid,
.coins-cards,
.pricing-grid,
.pro-tools-grid {
  gap: var(--ui-gap) !important;
}

.stat-card {
  min-height: 112px;
  padding: 18px !important;
  border-radius: 20px !important;
}

.stat-card strong {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.asset-card {
  padding: 18px !important;
  border-radius: 22px !important;
}

.asset-head {
  align-items: flex-start;
}

.metric-list > div {
  min-height: 46px;
}

.metric-list .text-button {
  min-height: 34px !important;
  padding-inline: 10px;
}

.coins-cards {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
}

.coin-card {
  display: grid;
  gap: 12px;
  padding: 16px !important;
  border-radius: 20px !important;
}

.coin-card-head,
.coin-card-metrics,
.coin-card-bars,
.coin-card-footer {
  margin: 0 !important;
}

.coin-card-metrics {
  gap: 7px !important;
}

.coin-card-metrics span {
  min-height: 58px;
  padding: 9px !important;
}

.coin-card-footer {
  padding-top: 10px;
  border-top: 1px solid rgba(91, 128, 163, 0.16);
}

.coin-card-footer .small-button {
  min-height: 38px !important;
}

.filters,
.detail-controls {
  padding: 10px;
  border: 1px solid rgba(91, 128, 163, 0.16);
  border-radius: 18px;
  background: rgba(6, 11, 20, 0.36);
}

.filters {
  grid-template-columns: minmax(220px, 1.25fr) repeat(2, minmax(145px, 0.8fr)) repeat(3, minmax(120px, 0.68fr)) !important;
  gap: 9px !important;
}

.table-shell {
  border-radius: 18px !important;
}

th,
td {
  padding-top: 13px;
  padding-bottom: 13px;
}

.pricing-section,
.pro-tools-section {
  padding: 20px !important;
  border-radius: var(--ui-radius-lg) !important;
}

.pricing-card,
.pro-tool-card,
.upgrade-card {
  border-radius: 22px !important;
}

.pricing-card {
  padding: 20px !important;
}

.pricing-card ul {
  gap: 7px !important;
}

.plan-status-card {
  border-radius: 18px !important;
}

.pro-tools-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.pro-tool-card {
  padding: 18px !important;
}

.pro-inline-form {
  grid-template-columns: minmax(0, 1fr) minmax(128px, 0.5fr) !important;
  gap: 9px !important;
}

.pro-inline-form button,
.pro-tool-card > button {
  min-height: 44px !important;
}

.pro-tool-card--wide {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 240px !important;
}

.pro-mini-lock,
.pro-tool-empty,
.pro-tool-loading,
.pro-tool-error {
  padding: 14px !important;
}

.upgrade-card {
  padding: 24px !important;
}

.timeline-switch {
  justify-self: end;
}

.balance-kpis {
  gap: 10px !important;
}

.balance-kpis article {
  border-radius: 18px !important;
}

footer {
  width: min(1320px, calc(100% - 32px));
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .telegram-header-login,
  .telegram-header-user,
  .hero-ton-connect button,
  .hero-ton-connect [role="button"],
  .network-badge {
    width: 100% !important;
  }

  .pro-tools-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  .app {
    width: 100%;
    padding: 8px 8px 20px;
    gap: 12px;
  }

  .hero,
  .control-panel,
  .toolbar,
  .section-block,
  .pricing-section,
  .pro-tools-section {
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .hero {
    gap: 14px;
  }

  .hero-logo {
    width: 34px !important;
    height: 34px !important;
  }

  .hero-brand h1 {
    font-size: 1.58rem !important;
  }

  .hero .subtitle {
    font-size: 0.88rem;
  }

  .hero-actions {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }

  .network-badge {
    grid-column: 1 / -1;
    min-height: 36px !important;
    font-size: 0.78rem !important;
  }

  .telegram-header-login,
  .telegram-header-user,
  .hero-ton-connect button,
  .hero-ton-connect [role="button"] {
    min-height: 40px !important;
    padding: 9px 10px !important;
    font-size: 0.8rem !important;
  }

  .input-row {
    grid-template-columns: 1fr 1fr 46px !important;
  }

  .input-row input {
    grid-column: 1 / -1;
  }

  .input-row button[type="submit"] {
    grid-column: 1 / -1;
  }

  #clearButton {
    grid-column: 1 / 3;
  }

  #favoriteQuickButton {
    grid-column: 3 / 4;
  }

  .toolbar,
  .section-title,
  .balance-head,
  .timeline-head {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .toolbar-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .toolbar-actions button {
    width: 100%;
    min-height: 40px !important;
    padding-inline: 9px;
    font-size: 0.8rem;
  }

  .summary-grid,
  .asset-grid,
  .coins-cards {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .stat-card {
    min-height: 88px;
    padding: 14px !important;
  }

  .asset-card,
  .coin-card {
    padding: 14px !important;
  }

  .coin-card-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .coin-card-metrics span {
    min-height: 50px;
    font-size: 0.68rem;
  }

  .coin-card-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .coin-card-footer .small-button {
    width: auto !important;
  }

  .filters {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 8px;
  }

  #txSearch,
  #dateFilter {
    grid-column: 1 / -1;
  }

  .timeline-switch {
    justify-self: start;
  }

  .timeline-switch button {
    min-height: 32px !important;
    padding: 6px 10px !important;
    font-size: 0.78rem;
  }

  .pro-inline-form,
  .pro-tool-card--wide {
    grid-template-columns: 1fr !important;
  }

  .upgrade-card {
    padding: 18px !important;
  }
}

@media (max-width: 340px) {
  .hero-actions {
    grid-template-columns: 1fr !important;
  }

  .toolbar-actions,
  .filters,
  .coin-card-metrics {
    grid-template-columns: 1fr !important;
  }

  #dateFilter,
  #txSearch {
    grid-column: auto;
  }
}

/* Final polish overrides */
.hidden,
.hero-actions > .hidden,
.telegram-header-menu.hidden,
.telegram-header-login.hidden,
.network-badge.hidden {
  display: none !important;
}

.hero-logo-image {
  object-fit: cover;
  border-radius: 50%;
  background: #0088cc;
  box-shadow: 0 0 0 1px rgba(54, 174, 226, 0.34), 0 14px 34px rgba(0, 136, 204, 0.24);
}

.asset-card-note {
  display: block;
  max-width: 320px;
  margin-top: 6px;
  color: rgba(190, 210, 232, 0.7);
  font-size: 0.74rem;
  line-height: 1.35;
}

.asset-head strong {
  display: inline-grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
}

.asset-head strong span {
  color: rgba(169, 187, 210, 0.72);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-wallet-main small {
  white-space: nowrap;
}

.top-wallet-money small:empty {
  display: none;
}

@media (min-width: 981px) {
  .hero {
    grid-template-columns: minmax(360px, 1fr) max-content !important;
    align-items: center;
  }

  .hero-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: max-content;
  }

  .telegram-header-login,
  .telegram-header-user,
  .hero-ton-connect,
  .hero-ton-connect button,
  .hero-ton-connect [role="button"],
  .network-badge {
    flex: 0 0 auto;
    width: auto !important;
    max-width: none !important;
  }

  .network-badge {
    min-width: max-content;
    white-space: nowrap;
  }

  .pro-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .pro-tool-card--wide {
    grid-column: 1 / -1 !important;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.36fr) !important;
    align-items: start;
  }
}

@media (max-width: 980px) {
  .asset-head strong {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 760px) {
  .hero-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  .telegram-header-menu,
  .network-badge {
    grid-column: 1 / -1;
  }
}

body [class*="tonconnect"] canvas,
body [class*="ton-connect"] canvas,
body [class*="tc-"] canvas {
  background: #ffffff !important;
  border: 14px solid #ffffff !important;
  border-radius: 18px !important;
  filter: brightness(1.18) contrast(1.32) !important;
}

body [class*="tonconnect"] [class*="qr"],
body [class*="ton-connect"] [class*="qr"],
body [class*="tc-"] [class*="qr"] {
  background: #ffffff !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.96), 0 18px 44px rgba(0, 0, 0, 0.28) !important;
}

.tc-readable-qr-frame {
  background: #ffffff !important;
  border-radius: 18px !important;
  box-shadow: inset 0 0 0 1px rgba(3, 8, 15, 0.08) !important;
}

.tc-readable-qr-media {
  background: #ffffff !important;
  border: 14px solid #ffffff !important;
  border-radius: 16px !important;
  filter: brightness(1.12) contrast(1.42) !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
}

.balance-chart-wrap {
  position: relative;
}

.balance-hit-dot {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
  cursor: crosshair;
}

.balance-tooltip {
  position: absolute;
  z-index: 8;
  max-width: min(360px, calc(100% - 28px));
  padding: 10px 12px;
  border: 1px solid rgba(54, 174, 226, 0.42);
  border-radius: 12px;
  background: rgba(14, 22, 33, 0.98);
  color: #eaf6ff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  white-space: normal;
}

.balance-tooltip.hidden {
  display: none;
}

.investigation-event-link {
  color: #36aee2;
  font-weight: 900;
  text-decoration: none;
}

.investigation-event-link:hover {
  color: #7dd8ff;
}

/* Coin cards: desktop 4 + 4 layout */
@media (min-width: 1181px) {
  .coins-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }

  .coin-card {
    min-height: 336px;
    padding: 20px !important;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .coins-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.coin-card {
  min-width: 0;
  overflow: hidden;
}

.coin-card-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
  align-items: start !important;
  gap: 12px;
}

.coin-card-name,
.coin-card-name > div {
  min-width: 0;
}

.coin-card-symbol,
.coin-card-fullname {
  overflow: hidden;
  text-overflow: ellipsis;
}

.coin-card-diff {
  max-width: 170px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.24;
}

.coin-bar-row {
  min-width: 0;
}

.coin-bar-track {
  min-width: 44px;
}

.coin-bar-value {
  min-width: 118px;
  max-width: 164px;
  overflow-wrap: anywhere;
  line-height: 1.22;
}

.coin-card-footer {
  min-width: 0;
}

.coin-card-footer > span {
  min-width: 0;
  flex-wrap: wrap;
}

/* Latest interface fixes */
.hero-actions {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.telegram-header-login,
.telegram-header-user,
#tonConnectMount button,
#tonConnectMount [role="button"],
.network-badge,
.timeline-switch,
.timeline-switch button {
  border-color: rgba(42, 171, 238, 0.18) !important;
  box-shadow: none !important;
}

.timeline-switch {
  background: rgba(5, 12, 22, 0.66) !important;
}

.timeline-chart {
  align-items: end;
}

.timeline-bar {
  grid-template-rows: 24px 1fr 22px !important;
  height: 176px !important;
}

.timeline-bar-track {
  width: 30px !important;
  position: relative !important;
  display: block !important;
  justify-self: center;
  border-radius: 999px !important;
  overflow: hidden !important;
}

.timeline-bar-track span,
.timeline-bar-track .timeline-count-fill {
  position: absolute !important;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100% !important;
  min-height: 10px;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #18a9df, #0088cc) !important;
}

.timeline-bar-track .timeline-volume-fill {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 46%;
  min-height: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd166, #ff9f43);
  box-shadow: 0 0 14px rgba(255, 159, 67, 0.34);
}

.timeline-volume {
  display: none !important;
}

.balance-chart-wrap {
  background:
    linear-gradient(rgba(42, 171, 238, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 171, 238, 0.032) 1px, transparent 1px),
    linear-gradient(180deg, rgba(14, 22, 33, 0.92), rgba(8, 14, 26, 0.96)) !important;
  background-size: 58px 58px !important;
  box-shadow: inset 0 0 0 1px rgba(42, 171, 238, 0.06);
}

.balance-chart {
  height: 245px !important;
}

.coin-card-fullname {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.25;
}

.coin-card-diff,
.coin-bar-value,
.coin-card-footer b {
  font-variant-numeric: tabular-nums;
}

/* Last-mile compact pass for "Top large wallets". Keep this at the end. */
.top-wallets-section {
  padding: clamp(16px, 1.35vw, 24px) !important;
}

.top-wallets-section .section-title {
  margin-bottom: clamp(10px, 1vw, 14px) !important;
}

.top-wallets-section .section-title h2 {
  font-size: clamp(1.28rem, 1.55vw, 1.72rem) !important;
  line-height: 1.06 !important;
  margin-bottom: 4px !important;
}

.top-wallets-section .section-title .muted {
  max-width: 1260px !important;
  font-size: clamp(0.78rem, 0.82vw, 0.9rem) !important;
  line-height: 1.32 !important;
}

.top-wallet-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(10px, 1vw, 14px) !important;
}

.top-wallet-classified {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(10px, 1vw, 14px) !important;
  margin-top: clamp(10px, 1vw, 14px) !important;
}

.top-wallet-card {
  border-radius: 16px !important;
}

.top-wallet-card-head {
  min-height: 46px !important;
  padding: 10px 12px !important;
  gap: 8px !important;
}

.top-wallet-card-head > div {
  gap: 8px !important;
}

.top-wallet-card .coin-mark {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  font-size: 0.74rem !important;
  box-shadow: 0 10px 24px rgba(0, 136, 204, 0.2) !important;
}

.top-wallet-card-head h3 {
  font-size: 0.92rem !important;
  line-height: 1.08 !important;
}

.top-wallet-card-head small {
  font-size: 0.68rem !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.top-wallet-card .top-wallet-list {
  gap: 0 !important;
}

.top-wallet-card .top-wallet-row,
.top-wallet-row {
  grid-template-columns: 22px minmax(92px, 0.95fr) minmax(112px, 0.85fr) minmax(48px, auto) 30px 30px !important;
  gap: 7px !important;
  min-height: 50px !important;
  padding: 7px 10px !important;
  align-items: center !important;
}

.top-wallet-card .top-wallet-main,
.top-wallet-card .top-wallet-money,
.top-wallet-main,
.top-wallet-money {
  gap: 1px !important;
  max-width: none !important;
  min-width: 0 !important;
}

.top-wallet-row .rank {
  font-size: 0.75rem !important;
  color: rgba(169, 192, 213, 0.92) !important;
}

.top-wallet-card .top-wallet-main a,
.top-wallet-main a {
  font-size: 0.84rem !important;
  line-height: 1.06 !important;
}

.top-wallet-card .top-wallet-money b,
.top-wallet-money b {
  font-size: 0.74rem !important;
  line-height: 1.06 !important;
}

.top-wallet-card .top-wallet-main small,
.top-wallet-card .top-wallet-money small,
.top-wallet-main small,
.top-wallet-money small {
  font-size: 0.62rem !important;
  line-height: 1.08 !important;
  margin: 0 !important;
}

.top-wallet-card .wallet-tag,
.top-wallet-row .wallet-tag {
  min-width: 48px !important;
  height: 23px !important;
  padding: 0 7px !important;
  font-size: 0.62rem !important;
  line-height: 1 !important;
  align-items: center !important;
  justify-self: end !important;
}

.top-wallet-card .top-wallet-row .icon-button,
.top-wallet-row .icon-button {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  border-radius: 11px !important;
  padding: 0 !important;
  font-size: 0.82rem !important;
}

.top-wallet-card--classified .top-wallet-list {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-width: 1380px) {
  .top-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1120px) {
  .top-wallet-grid,
  .top-wallet-classified,
  .top-wallet-card--classified .top-wallet-list {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .top-wallet-card .top-wallet-row,
  .top-wallet-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(78px, auto) 28px !important;
    min-height: 48px !important;
    gap: 6px !important;
    padding: 7px 9px !important;
  }

  .top-wallet-card .wallet-tag,
  .top-wallet-row .wallet-tag,
  .top-wallet-card .top-wallet-row .investigate-address,
  .top-wallet-row .investigate-address {
    display: none !important;
  }

  .top-wallet-card .top-wallet-row .copy-address,
  .top-wallet-row .copy-address {
    display: inline-flex !important;
  }
}

/* Final responsive density override: wide desktop keeps 3 top-wallet cards and 6 balance KPI cards. */
.top-wallet-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(10px, 0.9vw, 14px) !important;
  align-items: stretch !important;
}

.top-wallet-card {
  min-width: 0 !important;
  overflow: hidden !important;
}

.top-wallet-card .top-wallet-row,
.top-wallet-row {
  grid-template-columns: 20px minmax(84px, 1fr) minmax(96px, 0.88fr) 46px 28px 28px !important;
  gap: 6px !important;
  min-height: 46px !important;
  padding: 6px 9px !important;
}

.top-wallet-card .top-wallet-main,
.top-wallet-card .top-wallet-money,
.top-wallet-card .top-wallet-main a,
.top-wallet-card .top-wallet-money b,
.top-wallet-card .top-wallet-main small,
.top-wallet-card .top-wallet-money small {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.top-wallet-card .top-wallet-main a {
  font-size: 0.8rem !important;
}

.top-wallet-card .top-wallet-money b {
  font-size: 0.7rem !important;
}

.top-wallet-card .top-wallet-main small,
.top-wallet-card .top-wallet-money small {
  font-size: 0.58rem !important;
}

.top-wallet-card .wallet-tag {
  width: 46px !important;
  min-width: 46px !important;
  height: 22px !important;
  padding: 0 5px !important;
  font-size: 0.58rem !important;
}

.top-wallet-card .top-wallet-row .icon-button,
.top-wallet-row .icon-button {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  border-radius: 10px !important;
}

.balance-kpis--premium {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: clamp(8px, 0.8vw, 12px) !important;
  margin-bottom: clamp(14px, 1vw, 18px) !important;
}

.balance-stat-card {
  min-width: 0 !important;
  min-height: 104px !important;
  height: 100% !important;
  padding: 12px !important;
  border-radius: 17px !important;
}

.balance-stat-icon {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  margin-bottom: 8px !important;
  border-radius: 11px !important;
  font-size: 0.62rem !important;
}

.balance-stat-label {
  margin-bottom: 4px !important;
  font-size: 0.72rem !important;
  line-height: 1.16 !important;
}

.balance-stat-card b {
  font-size: clamp(0.82rem, 0.82vw, 0.98rem) !important;
  line-height: 1.18 !important;
  overflow-wrap: anywhere !important;
}

.balance-stat-card small {
  margin-top: 5px !important;
  font-size: 0.68rem !important;
  line-height: 1.2 !important;
  overflow-wrap: anywhere !important;
}

.balance-chart-shell {
  width: 100% !important;
  min-width: 0 !important;
  clear: both !important;
}

@media (max-width: 1180px) {
  .top-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .balance-kpis--premium {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {
  .top-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .top-wallet-card .top-wallet-row,
  .top-wallet-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(82px, auto) 28px !important;
  }

  .top-wallet-card .wallet-tag,
  .top-wallet-card .top-wallet-row .investigate-address {
    display: none !important;
  }

  .balance-kpis--premium {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  .top-wallet-grid {
    grid-template-columns: 1fr !important;
  }

  .top-wallet-card .top-wallet-row,
  .top-wallet-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(78px, auto) 28px !important;
  }

  .balance-kpis--premium {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile analytics polish: compact profile, local activity tooltip, clean transaction filters */
@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden !important;
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .results,
  .section-block,
  .wallet-profile,
  .wallet-profile-card,
  .timeline-section,
  .table-shell,
  #transactionsPanel,
  #transactionsPanel .filters {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .timeline-section {
    overflow: hidden !important;
    padding: 16px !important;
  }

  .activity-head {
    gap: 12px !important;
    margin-bottom: 14px !important;
  }

  .activity-summary {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  .activity-summary article {
    min-height: 74px !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
  }

  .activity-chart {
    position: relative !important;
    grid-auto-columns: minmax(34px, 44px) !important;
    min-height: 230px !important;
    max-width: 100% !important;
    padding: 18px 12px 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .activity-bar {
    height: 176px !important;
    grid-template-rows: 22px 1fr 24px !important;
  }

  .activity-tooltip-portal.is-mobile-inline {
    position: absolute !important;
    z-index: 30 !important;
    width: auto !important;
    min-width: min(270px, calc(100% - 24px)) !important;
    max-width: calc(100% - 24px) !important;
    pointer-events: none !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  .activity-tooltip-portal.is-mobile-inline .activity-tooltip-title {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .activity-tooltip-portal.is-mobile-inline .activity-tooltip-row {
    gap: 12px !important;
  }

  .activity-tooltip-portal.is-mobile-inline .activity-tooltip-row b {
    max-width: 58% !important;
  }

  .wallet-profile-card {
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .wallet-profile-head {
    display: grid !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
  }

  .wallet-profile-head h2 {
    margin-bottom: 5px !important;
    font-size: clamp(1.2rem, 7vw, 1.65rem) !important;
    line-height: 1.08 !important;
  }

  .wallet-profile-head .muted {
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
  }

  .wallet-profile-side,
  .wallet-profile-metrics {
    width: 100% !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  .activity-badge,
  .risk-badge {
    min-height: 76px !important;
    padding: 10px 8px !important;
    border-radius: 14px !important;
    gap: 4px !important;
  }

  .activity-badge span,
  .risk-badge span {
    font-size: 0.58rem !important;
    letter-spacing: 0.08em !important;
  }

  .activity-badge strong,
  .risk-badge strong {
    font-size: 0.96rem !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere;
  }

  .risk-badge em {
    font-size: 0.72rem !important;
  }

  .wallet-profile-metric {
    min-height: 74px !important;
    padding: 10px !important;
    border-radius: 13px !important;
  }

  .wallet-profile-metric span {
    margin-bottom: 6px !important;
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
  }

  .wallet-profile-metric b {
    font-size: 0.88rem !important;
    line-height: 1.24 !important;
    overflow-wrap: anywhere;
  }

  .wallet-profile-risk {
    margin-top: 12px !important;
    padding: 12px !important;
    border-radius: 15px !important;
  }

  .wallet-profile-risk-head {
    display: grid !important;
    gap: 10px !important;
    margin-bottom: 10px !important;
  }

  .wallet-profile-risk-head h3 {
    font-size: 0.95rem !important;
  }

  .wallet-profile-risk-meta {
    justify-items: start !important;
    gap: 5px !important;
    font-size: 0.72rem !important;
  }

  .risk-chip-list {
    gap: 6px !important;
  }

  .risk-chip {
    min-height: 28px !important;
    padding: 6px 9px !important;
    font-size: 0.72rem !important;
  }

  #transactionsPanel {
    margin-top: 12px !important;
  }

  #transactionsPanel .filters {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 0 12px !important;
    padding: 10px !important;
    border: 1px solid rgba(42, 171, 238, 0.16) !important;
    border-radius: 18px !important;
    background:
      radial-gradient(circle at 12% 0%, rgba(42, 171, 238, 0.09), transparent 36%),
      rgba(5, 12, 22, 0.56) !important;
  }

  #transactionsPanel .filters > input,
  #transactionsPanel .filters > select {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 12px !important;
    border-radius: 13px !important;
    font-size: 0.86rem !important;
    line-height: 1.2 !important;
  }

  #transactionsPanel #txSearch,
  #transactionsPanel #addressFilter {
    grid-column: 1 / -1 !important;
  }

  #transactionsPanel #dateFilter,
  #transactionsPanel #amountFilter {
    grid-column: auto !important;
  }

  .section-actions {
    display: grid !important;
    grid-template-columns: 1fr auto;
    gap: 10px !important;
    align-items: center !important;
  }

  .section-actions .muted {
    margin: 0 !important;
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
  }

  #toggleTransactionsButton {
    min-height: 42px !important;
    padding: 0 14px !important;
    border-radius: 13px !important;
    white-space: nowrap !important;
  }

  #transactionsPanel .table-shell {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px !important;
  }

  #transactionsPanel table {
    min-width: 660px !important;
    table-layout: fixed;
  }

  #transactionsPanel th,
  #transactionsPanel td {
    padding: 10px 9px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #transactionsPanel th {
    font-size: 0.68rem !important;
    line-height: 1.15 !important;
  }
}

@media (max-width: 380px) {
  #transactionsPanel .filters,
  .wallet-profile-side,
  .wallet-profile-metrics {
    grid-template-columns: 1fr !important;
  }

  #transactionsPanel .filters > * {
    grid-column: 1 / -1 !important;
  }
}

/* Responsive density final override for analytics layout. */
.top-wallet-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(10px, 0.9vw, 14px) !important;
  align-items: stretch !important;
}

.top-wallet-card {
  min-width: 0 !important;
  overflow: hidden !important;
}

.top-wallet-card .top-wallet-row,
.top-wallet-row {
  grid-template-columns: 20px minmax(84px, 1fr) minmax(96px, 0.88fr) 46px 28px 28px !important;
  gap: 6px !important;
  min-height: 46px !important;
  padding: 6px 9px !important;
}

.top-wallet-card .top-wallet-main,
.top-wallet-card .top-wallet-money,
.top-wallet-card .top-wallet-main a,
.top-wallet-card .top-wallet-money b,
.top-wallet-card .top-wallet-main small,
.top-wallet-card .top-wallet-money small {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.top-wallet-card .top-wallet-main a {
  font-size: 0.8rem !important;
}

.top-wallet-card .top-wallet-money b {
  font-size: 0.7rem !important;
}

.top-wallet-card .top-wallet-main small,
.top-wallet-card .top-wallet-money small {
  font-size: 0.58rem !important;
}

.top-wallet-card .wallet-tag {
  width: 46px !important;
  min-width: 46px !important;
  height: 22px !important;
  padding: 0 5px !important;
  font-size: 0.58rem !important;
}

.top-wallet-card .top-wallet-row .icon-button,
.top-wallet-row .icon-button {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  border-radius: 10px !important;
}

.balance-kpis--premium {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: clamp(8px, 0.8vw, 12px) !important;
  margin-bottom: clamp(14px, 1vw, 18px) !important;
}

.balance-stat-card {
  min-width: 0 !important;
  min-height: 104px !important;
  height: 100% !important;
  padding: 12px !important;
  border-radius: 17px !important;
}

.balance-stat-icon {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  margin-bottom: 8px !important;
  border-radius: 11px !important;
  font-size: 0.62rem !important;
}

.balance-stat-label {
  margin-bottom: 4px !important;
  font-size: 0.72rem !important;
  line-height: 1.16 !important;
}

.balance-stat-card b {
  font-size: clamp(0.82rem, 0.82vw, 0.98rem) !important;
  line-height: 1.18 !important;
  overflow-wrap: anywhere !important;
}

.balance-stat-card small {
  margin-top: 5px !important;
  font-size: 0.68rem !important;
  line-height: 1.2 !important;
  overflow-wrap: anywhere !important;
}

.balance-chart-shell {
  width: 100% !important;
  min-width: 0 !important;
  clear: both !important;
}

@media (max-width: 1180px) {
  .top-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .balance-kpis--premium {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {
  .top-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .top-wallet-card .top-wallet-row,
  .top-wallet-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(82px, auto) 28px !important;
  }

  .top-wallet-card .wallet-tag,
  .top-wallet-card .top-wallet-row .investigate-address {
    display: none !important;
  }

  .balance-kpis--premium {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  .top-wallet-grid {
    grid-template-columns: 1fr !important;
  }

  .top-wallet-card .top-wallet-row,
  .top-wallet-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(78px, auto) 28px !important;
  }

  .balance-kpis--premium {
    grid-template-columns: 1fr !important;
  }
}

/* Dense top-wallets view: make 100% browser zoom feel close to the old 67% layout. */
.top-wallets-section {
  padding: clamp(16px, 1.35vw, 24px) !important;
}

.top-wallets-section .section-title {
  margin-bottom: clamp(10px, 1vw, 14px) !important;
}

.top-wallets-section .section-title h2 {
  font-size: clamp(1.28rem, 1.55vw, 1.72rem) !important;
  line-height: 1.06 !important;
  margin-bottom: 4px !important;
}

.top-wallets-section .section-title .muted {
  max-width: 1260px !important;
  font-size: clamp(0.78rem, 0.82vw, 0.9rem) !important;
  line-height: 1.32 !important;
}

.top-wallet-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(10px, 1vw, 14px) !important;
}

.top-wallet-classified {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(10px, 1vw, 14px) !important;
  margin-top: clamp(10px, 1vw, 14px) !important;
}

.top-wallet-card {
  border-radius: 16px !important;
}

.top-wallet-card-head {
  min-height: 46px !important;
  padding: 10px 12px !important;
  gap: 8px !important;
}

.top-wallet-card-head > div {
  gap: 8px !important;
}

.top-wallet-card .coin-mark {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  font-size: 0.74rem !important;
  box-shadow: 0 10px 24px rgba(0, 136, 204, 0.2) !important;
}

.top-wallet-card-head h3 {
  font-size: 0.92rem !important;
  line-height: 1.08 !important;
}

.top-wallet-card-head small {
  font-size: 0.68rem !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.top-wallet-card .top-wallet-list {
  gap: 0 !important;
}

.top-wallet-card .top-wallet-row,
.top-wallet-row {
  grid-template-columns: 22px minmax(92px, 0.95fr) minmax(112px, 0.85fr) minmax(48px, auto) 30px 30px !important;
  gap: 7px !important;
  min-height: 50px !important;
  padding: 7px 10px !important;
  align-items: center !important;
}

.top-wallet-card .top-wallet-main,
.top-wallet-card .top-wallet-money,
.top-wallet-main,
.top-wallet-money {
  gap: 1px !important;
  max-width: none !important;
  min-width: 0 !important;
}

.top-wallet-row .rank {
  font-size: 0.75rem !important;
  color: rgba(169, 192, 213, 0.92) !important;
}

.top-wallet-card .top-wallet-main a,
.top-wallet-main a {
  font-size: 0.84rem !important;
  line-height: 1.06 !important;
}

.top-wallet-card .top-wallet-money b,
.top-wallet-money b {
  font-size: 0.74rem !important;
  line-height: 1.06 !important;
}

.top-wallet-card .top-wallet-main small,
.top-wallet-card .top-wallet-money small,
.top-wallet-main small,
.top-wallet-money small {
  font-size: 0.62rem !important;
  line-height: 1.08 !important;
  margin: 0 !important;
}

.top-wallet-card .wallet-tag,
.top-wallet-row .wallet-tag {
  min-width: 48px !important;
  height: 23px !important;
  padding: 0 7px !important;
  font-size: 0.62rem !important;
  line-height: 1 !important;
  align-items: center !important;
  justify-self: end !important;
}

.top-wallet-card .top-wallet-row .icon-button,
.top-wallet-row .icon-button {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  border-radius: 11px !important;
  padding: 0 !important;
  font-size: 0.82rem !important;
}

.top-wallet-card--classified .top-wallet-list {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-width: 1380px) {
  .top-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1120px) {
  .top-wallet-grid,
  .top-wallet-classified,
  .top-wallet-card--classified .top-wallet-list {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .top-wallet-card .top-wallet-row,
  .top-wallet-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(78px, auto) 28px !important;
    min-height: 48px !important;
    gap: 6px !important;
    padding: 7px 9px !important;
  }

  .top-wallet-card .wallet-tag,
  .top-wallet-row .wallet-tag,
  .top-wallet-card .top-wallet-row .investigate-address,
  .top-wallet-row .investigate-address {
    display: none !important;
  }

  .top-wallet-card .top-wallet-row .copy-address,
  .top-wallet-row .copy-address {
    display: inline-flex !important;
  }
}

/* Compact wallet rows: address, volume, tag and actions must stay on one line. */
.top-wallet-card .top-wallet-list {
  gap: 0 !important;
}

.top-wallet-card .top-wallet-row {
  display: grid !important;
  grid-template-columns: 28px minmax(132px, 220px) minmax(150px, 1fr) auto 40px 40px !important;
  gap: 12px !important;
  align-items: center !important;
  min-height: 68px !important;
  padding: 10px 20px !important;
}

.top-wallet-card .top-wallet-main,
.top-wallet-card .top-wallet-money {
  display: grid !important;
  align-content: center !important;
  gap: 3px !important;
  min-width: 0 !important;
}

.top-wallet-card .top-wallet-main {
  max-width: 220px !important;
}

.top-wallet-card .top-wallet-money {
  justify-self: start !important;
  max-width: 280px !important;
}

.top-wallet-card .top-wallet-main a,
.top-wallet-card .top-wallet-money b,
.top-wallet-card .top-wallet-main small,
.top-wallet-card .top-wallet-money small {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.top-wallet-card .wallet-tag {
  justify-self: end !important;
  white-space: nowrap !important;
}

.top-wallet-card .top-wallet-row .icon-button {
  display: inline-flex !important;
  justify-self: end !important;
  width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
}

@media (max-width: 1180px) {
  .top-wallet-card .top-wallet-row {
    grid-template-columns: 24px minmax(118px, 180px) minmax(120px, 1fr) auto 36px 36px !important;
    gap: 9px !important;
    padding-inline: 14px !important;
  }
}

@media (max-width: 720px) {
  .top-wallet-card .top-wallet-row {
    grid-template-columns: 22px minmax(0, 1fr) minmax(90px, auto) auto !important;
    min-height: 60px !important;
    padding: 9px 12px !important;
  }

  .top-wallet-card .top-wallet-row .icon-button {
    display: none !important;
  }
}

/* UI hardening pass: final overrides for responsive layout, activity and balance charts. */
body {
  min-width: 0;
}

.app > *,
.results > *,
.section-block,
.hero,
.control-panel,
.wallet-profile,
.dashboard-grid,
.coins-cards,
.top-wallet-grid,
.top-wallet-classified,
.pro-tools-grid {
  min-width: 0 !important;
}

.hero {
  overflow: visible !important;
}

.hero-logo-image,
img.hero-logo {
  aspect-ratio: 1 / 1 !important;
  border-radius: 999px !important;
  object-fit: cover !important;
  flex: 0 0 auto !important;
}

.hero-title,
.hero-subtitle,
.section-title h2,
.section-title p,
.card-title,
.top-wallet-address,
.wallet-chip,
.metric-card,
.coin-card,
.transaction-table,
.top-table {
  overflow-wrap: anywhere;
}

.hero-actions {
  align-items: center !important;
  justify-content: flex-end !important;
}

.hero-actions > * {
  flex: 0 1 auto;
  min-width: 0;
}

.top-wallet-row {
  overflow: hidden !important;
}

.top-wallet-address,
.top-wallet-money,
.top-wallet-meta {
  min-width: 0 !important;
}

.top-wallet-money b,
.top-wallet-address b,
.top-wallet-address a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-wallet-row {
  grid-template-columns: 28px minmax(132px, 220px) minmax(145px, 1fr) auto 40px 40px !important;
  gap: 12px !important;
  align-items: center !important;
  min-height: 72px !important;
  padding: 12px 20px !important;
}

.top-wallet-main {
  max-width: 220px;
}

.top-wallet-main,
.top-wallet-money {
  align-self: center;
}

.top-wallet-money {
  justify-self: start;
  max-width: 260px;
}

.top-wallet-row .wallet-tag {
  justify-self: end;
  white-space: nowrap;
}

.top-wallet-row .icon-button {
  justify-self: end;
  width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
}

.activity-chart {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(38px, 1fr);
  gap: clamp(8px, 1.15vw, 18px) !important;
  align-items: end;
  min-height: 250px;
  padding: clamp(20px, 2vw, 30px) clamp(16px, 1.8vw, 28px) 16px !important;
  border-radius: 24px !important;
  border: 1px solid rgba(42, 171, 238, 0.16) !important;
  background:
    linear-gradient(rgba(42, 171, 238, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 171, 238, 0.024) 1px, transparent 1px),
    radial-gradient(circle at 50% 20%, rgba(0, 136, 204, 0.12), transparent 46%),
    rgba(6, 12, 22, 0.52) !important;
  background-size: 72px 72px, 72px 72px, auto, auto !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

.activity-bar {
  position: relative;
  display: grid !important;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 8px;
  min-width: 0 !important;
  height: 190px !important;
}

.activity-bar .timeline-bar-value {
  color: rgba(234, 246, 255, 0.94) !important;
  font-size: 0.82rem !important;
  line-height: 1;
}

.activity-bar .timeline-bar-track {
  width: clamp(18px, 1.7vw, 28px) !important;
  min-height: 118px !important;
  border-radius: 999px !important;
  background: rgba(2, 8, 16, 0.66) !important;
  border: 1px solid rgba(42, 171, 238, 0.08) !important;
  box-shadow: inset 0 10px 22px rgba(0, 0, 0, 0.3) !important;
}

.activity-bar .timeline-count-fill {
  background: linear-gradient(180deg, #2bdcff 0%, #0088cc 100%) !important;
  box-shadow: 0 0 18px rgba(42, 171, 238, 0.32) !important;
}

.activity-bar small {
  max-width: 56px;
  color: rgba(169, 192, 213, 0.86) !important;
  font-size: 0.72rem !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#balanceHistory.balance-history-section {
  overflow: hidden !important;
  background:
    radial-gradient(circle at 22% 0%, rgba(0, 136, 204, 0.16), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(42, 171, 238, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(17, 30, 46, 0.95), rgba(6, 12, 22, 0.98)) !important;
}

#balanceHistory .balance-chart-shell,
.balance-history-section .balance-chart-shell {
  position: relative !important;
  overflow: hidden !important;
  padding: clamp(14px, 1.45vw, 22px) !important;
  border: 1px solid rgba(42, 171, 238, 0.18) !important;
  outline: none !important;
  border-radius: 26px !important;
  background-color: #0b1420 !important;
  background-image:
    linear-gradient(rgba(42, 171, 238, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 171, 238, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 50% 34%, rgba(0, 136, 204, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(15, 27, 42, 0.98), rgba(6, 12, 22, 0.98)) !important;
  background-size: 76px 76px, 76px 76px, auto, auto !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -72px 120px rgba(0, 0, 0, 0.22),
    0 24px 70px rgba(0, 0, 0, 0.28) !important;
}

#balanceHistory .balance-chart-shell::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 20px;
  pointer-events: none;
  background:
    radial-gradient(circle at 76% 28%, rgba(35, 215, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 55%);
}

#balanceHistory svg.balance-chart,
#balanceHistory .balance-chart--premium,
.balance-history-section .balance-chart--premium {
  position: relative !important;
  z-index: 1;
  display: block !important;
  width: 100% !important;
  height: clamp(250px, 24vw, 350px) !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#balanceHistory .balance-line {
  fill: none !important;
  stroke: #22dcff !important;
  stroke-width: 3.5 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  filter: drop-shadow(0 0 13px rgba(34, 220, 255, 0.38)) !important;
}

#balanceHistory .balance-area {
  fill: url("#balanceFillGradient") !important;
  opacity: 0.95 !important;
}

#balanceHistory .balance-axis {
  position: relative;
  z-index: 1;
}

#balanceHistory .balance-mini-summary {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr !important;
  }

  .hero-actions {
    justify-content: flex-start !important;
  }

  .top-wallet-row {
    grid-template-columns: 24px minmax(120px, 190px) minmax(130px, 1fr) auto 36px 36px !important;
  }
}

@media (max-width: 820px) {
  .activity-chart {
    grid-auto-columns: 34px;
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
  }

  .hero-actions .btn,
  .hero-actions .wallet-connect,
  .hero-actions .telegram-header-pill,
  .hero-actions .api-status {
    width: 100%;
    justify-content: center;
  }

  .balance-kpis--premium {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .app {
    padding-inline: 10px !important;
  }

  .hero-brand {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .hero-logo-image,
  img.hero-logo {
    width: 48px !important;
    height: 48px !important;
  }

  .hero-title {
    font-size: clamp(2.1rem, 12vw, 3.2rem) !important;
    line-height: 0.98 !important;
  }

  .balance-kpis--premium,
  #balanceHistory .balance-mini-summary,
  .activity-summary {
    grid-template-columns: 1fr !important;
  }

  .activity-chart {
    min-height: 220px;
    padding-inline: 14px !important;
  }

  #balanceHistory svg.balance-chart,
  #balanceHistory .balance-chart--premium {
    height: 235px !important;
  }

  .top-wallet-row {
    grid-template-columns: 22px minmax(0, 1fr) minmax(100px, auto) auto !important;
    gap: 8px !important;
  }

  .top-wallet-row .top-wallet-money {
    grid-column: auto;
  }

  .top-wallet-row .icon-button {
    display: none !important;
  }
}

/* Final UI stabilization pass: layout, logo, activity and balance sections */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden !important;
}

.app,
.hero,
.control-panel,
.section-block,
.wallet-profile,
.toolbar,
.top-wallet-card,
.asset-card,
.coin-card,
.timeline-section,
.balance-history-section {
  min-width: 0;
  max-width: 100%;
}

.hero {
  align-items: flex-start !important;
  gap: clamp(18px, 2.2vw, 34px) !important;
}

.hero-left,
.hero-actions,
.hero-brand,
.toolbar,
.section-title,
.wallet-profile-head,
.timeline-head,
.balance-head {
  min-width: 0;
}

.hero-brand {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px !important;
}

.hero-logo-image,
img.hero-logo {
  width: clamp(54px, 4.2vw, 74px) !important;
  height: clamp(54px, 4.2vw, 74px) !important;
  flex: 0 0 auto;
  object-fit: cover !important;
  object-position: center;
  border-radius: 50% !important;
  border: 1px solid rgba(42, 171, 238, 0.36);
  padding: 0 !important;
  background: #07111f !important;
  box-shadow: 0 0 0 8px rgba(42, 171, 238, 0.08), 0 18px 44px rgba(0, 136, 204, 0.24);
}

.hero-brand h1,
.hero .subtitle {
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.hero-actions > * {
  flex: 0 1 auto;
  min-width: 0;
}

.network-badge,
.telegram-header-login,
.telegram-header-user,
#tonConnectMount button,
#tonConnectMount [role="button"] {
  white-space: nowrap;
}

.input-row,
.filters,
.comparison-form,
.pro-form,
.favorites-actions,
.toolbar-actions {
  min-width: 0;
}

.input-row > *,
.filters > *,
.comparison-form > *,
.pro-form > * {
  min-width: 0;
}

.table-wrap,
.transactions-table-wrap,
.source-chain-panel,
.top-wallet-card {
  overflow-x: auto;
  scrollbar-width: thin;
}

/* Safer top-wallet cards: no overlapping action buttons on narrow cards */
.top-wallet-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr)) !important;
  gap: 18px !important;
}

.top-wallet-classified {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)) !important;
}

.top-wallet-card {
  border-radius: 22px !important;
}

.top-wallet-card--classified .top-wallet-list,
.top-wallet-list {
  display: grid !important;
  grid-template-columns: 1fr !important;
}

.top-wallet-row {
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1.1fr) minmax(0, 0.95fr) auto auto !important;
  gap: 10px !important;
  min-width: 0 !important;
  padding: 12px 14px !important;
}

.top-wallet-row .wallet-tag {
  min-width: 0 !important;
  width: fit-content;
  max-width: 100%;
}

.top-wallet-row .icon-button {
  width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
}

/* Clean activity timeline */
.timeline-section {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(42, 171, 238, 0.16) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(42, 171, 238, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(17, 29, 44, 0.94), rgba(8, 15, 27, 0.96)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 24px 70px rgba(0, 0, 0, 0.22);
}

.activity-head {
  align-items: flex-start !important;
  margin-bottom: 18px !important;
}

.activity-summary {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px !important;
  margin: 0 0 16px !important;
}

.activity-summary article {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(121, 169, 204, 0.14);
  border-radius: 18px;
  background: rgba(7, 15, 27, 0.62);
  backdrop-filter: blur(14px);
}

.activity-summary span {
  display: block !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: rgba(166, 190, 212, 0.88) !important;
  background: transparent !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
}

.activity-summary b {
  display: block;
  margin-top: 7px;
  color: #f4f9ff;
  font-size: 1.22rem;
  overflow-wrap: anywhere;
}

.activity-chart {
  min-height: 230px !important;
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(24px, 1fr) !important;
  align-items: end !important;
  gap: clamp(6px, 0.8vw, 12px) !important;
  padding: 18px 16px 12px !important;
  border: 1px solid rgba(121, 169, 204, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(rgba(42, 171, 238, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 171, 238, 0.018) 1px, transparent 1px),
    rgba(5, 12, 22, 0.52);
  background-size: 100% 52px, 74px 100%, auto;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

.activity-bar {
  position: relative;
  min-width: 24px !important;
  height: 188px !important;
  grid-template-rows: 22px 1fr 24px !important;
  gap: 8px !important;
}

.activity-bar .timeline-bar-value {
  color: rgba(221, 235, 248, 0.86);
  font-size: 0.72rem;
}

.activity-bar .timeline-bar-track {
  width: 100% !important;
  max-width: 30px;
  min-width: 18px;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(6, 13, 24, 0.78) !important;
  box-shadow: inset 0 0 0 1px rgba(121, 169, 204, 0.08) !important;
}

.activity-bar .timeline-count-fill {
  background: linear-gradient(180deg, #35d8ff, #0088cc) !important;
  box-shadow: 0 0 18px rgba(42, 171, 238, 0.22) !important;
}

.activity-bar small {
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-bar::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 8;
  width: max-content;
  max-width: 260px;
  padding: 9px 11px;
  border: 1px solid rgba(42, 171, 238, 0.38);
  border-radius: 12px;
  color: #eaf6ff;
  background: rgba(5, 12, 22, 0.96);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36);
  transform: translate(-50%, 6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.35;
}

.activity-bar:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.activity-bar::after {
  display: none !important;
  content: none !important;
}

.activity-tooltip-portal {
  position: fixed;
  z-index: 2147483000;
  box-sizing: border-box;
  width: max-content;
  min-width: min(260px, calc(100vw - 24px));
  max-width: min(360px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(42, 171, 238, 0.52);
  border-radius: 14px;
  color: #eef8ff;
  background:
    radial-gradient(circle at 20% 0%, rgba(42, 171, 238, 0.16), transparent 40%),
    rgba(5, 12, 22, 0.98);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.46), 0 0 22px rgba(42, 171, 238, 0.12);
  backdrop-filter: blur(16px);
  pointer-events: none;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.38;
  transform: translate3d(0, 0, 0);
}

.activity-tooltip-portal.hidden {
  display: none;
}

.activity-tooltip-title {
  margin-bottom: 9px;
  color: #f4fbff;
  font-size: 0.84rem;
  font-weight: 950;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-tooltip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding-top: 7px;
  border-top: 1px solid rgba(121, 169, 204, 0.14);
}

.activity-tooltip-row + .activity-tooltip-row {
  margin-top: 7px;
}

.activity-tooltip-row span {
  flex: 0 0 auto;
  color: rgba(166, 190, 212, 0.9);
  white-space: nowrap;
}

.activity-tooltip-row b {
  min-width: 0;
  color: #eef8ff;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-volume,
.timeline-volume-fill {
  display: none !important;
}

/* Balance chart: premium dark area, no white frame */
#balanceHistory .balance-chart-shell {
  border: 1px solid rgba(42, 171, 238, 0.16) !important;
  outline: 0 !important;
  border-radius: 24px !important;
  background:
    linear-gradient(rgba(42, 171, 238, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 171, 238, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 48% 36%, rgba(0, 136, 204, 0.13), transparent 46%),
    linear-gradient(180deg, rgba(13, 25, 39, 0.96), rgba(5, 11, 21, 0.98)) !important;
  background-size: 68px 68px, 80px 80px, auto, auto !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 -80px 140px rgba(0, 0, 0, 0.18),
    0 24px 65px rgba(0, 0, 0, 0.24) !important;
}

#balanceHistory .balance-chart,
#balanceHistory svg.balance-chart {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#balanceHistory .balance-line {
  stroke: #27dfff !important;
  stroke-width: 3.2 !important;
}

#balanceHistory .balance-area {
  fill: url("#balanceFillGradient") !important;
}

#balanceHistory .balance-axis {
  margin-top: 12px !important;
  color: rgba(162, 187, 210, 0.86) !important;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr !important;
  }

  .hero-actions {
    justify-content: flex-start !important;
  }

  .top-wallet-row {
    grid-template-columns: 24px minmax(0, 1fr) auto auto !important;
  }

  .top-wallet-money {
    grid-column: 2 / -1;
  }
}

@media (max-width: 820px) {
  .toolbar,
  .section-title,
  .wallet-profile-head,
  .timeline-head,
  .balance-head {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .activity-summary {
    grid-template-columns: 1fr !important;
  }

  .timeline-switch {
    width: 100%;
    justify-content: stretch;
  }

  .timeline-switch button {
    flex: 1 1 0;
  }
}

@media (max-width: 640px) {
  .app {
    padding-inline: 10px !important;
  }

  .hero,
  .control-panel,
  .section-block,
  .wallet-profile,
  .toolbar {
    padding: 16px !important;
    border-radius: 20px !important;
  }

  .hero-brand {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px !important;
  }

  .hero-logo-image,
  img.hero-logo {
    width: 50px !important;
    height: 50px !important;
  }

  .hero-brand h1 {
    font-size: clamp(2rem, 12vw, 3.1rem) !important;
  }

  .hero-actions,
  .toolbar-actions,
  .input-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
  }

  .hero-actions > *,
  .toolbar-actions > *,
  .input-row > * {
    width: 100% !important;
  }

  .top-wallet-row {
    grid-template-columns: 22px minmax(0, 1fr) auto !important;
  }

  .top-wallet-row .icon-button {
    display: none !important;
  }

  .activity-chart {
    grid-auto-columns: minmax(28px, 34px) !important;
    padding-inline: 12px !important;
  }

  .balance-chart--premium {
    height: 230px !important;
  }
}

/* Premium balance history redesign */
#balanceHistory.balance-history-section {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(42, 171, 238, 0.18) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(42, 171, 238, 0.16), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(0, 136, 204, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(16, 28, 43, 0.96), rgba(7, 13, 24, 0.98) 68%, rgba(8, 18, 32, 0.96)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 28px 80px rgba(0, 0, 0, 0.28);
}

#balanceHistory.balance-history-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(42, 171, 238, 0.055), transparent),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: auto, 100% 72px;
  opacity: 0.6;
}

#balanceHistory > * {
  position: relative;
  z-index: 1;
}

.balance-head--premium {
  align-items: flex-start;
  margin-bottom: 22px;
}

.balance-analytics-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 10px;
  padding: 7px 11px;
  border: 1px solid rgba(42, 171, 238, 0.24);
  border-radius: 999px;
  color: #7dd8ff;
  background: rgba(42, 171, 238, 0.09);
  box-shadow: 0 0 28px rgba(42, 171, 238, 0.1);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.balance-head--premium h2 {
  font-size: clamp(1.75rem, 2.5vw, 2.55rem);
  line-height: 1.06;
}

.balance-period-switch {
  padding: 5px !important;
  border: 1px solid rgba(42, 171, 238, 0.2) !important;
  background: rgba(5, 12, 22, 0.58) !important;
  border-radius: 999px !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 14px 35px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.balance-period-switch button {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.balance-period-switch button.is-active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #36d7ff, #0088cc) !important;
  box-shadow: 0 12px 30px rgba(0, 136, 204, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}

.balance-kpis--premium {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.balance-stat-card {
  position: relative;
  min-height: 132px;
  padding: 16px !important;
  border: 1px solid rgba(121, 169, 204, 0.16) !important;
  border-radius: 20px !important;
  background:
    linear-gradient(180deg, rgba(18, 31, 46, 0.72), rgba(9, 16, 28, 0.74)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 45px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(16px);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  animation: balanceFadeUp 0.48s ease both;
}

.balance-stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(42, 171, 238, 0.44) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 24px 60px rgba(0, 136, 204, 0.14);
}

.balance-stat-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: 14px;
  color: #ffffff !important;
  background: linear-gradient(135deg, #35d8ff, #0088cc);
  box-shadow: 0 12px 30px rgba(0, 136, 204, 0.28);
  font-size: 0.72rem !important;
  font-weight: 950;
  letter-spacing: 0;
}

.balance-stat-label {
  display: block !important;
  margin-bottom: 6px;
  color: rgba(174, 196, 216, 0.88) !important;
  font-size: 0.82rem !important;
}

.balance-stat-card b {
  margin: 0 !important;
  color: #f4f9ff !important;
  font-size: clamp(1rem, 1.05vw, 1.18rem) !important;
  line-height: 1.22;
}

.balance-stat-card small {
  margin-top: 7px;
  color: rgba(142, 169, 194, 0.92) !important;
}

.balance-stat-card--income .balance-stat-icon {
  background: linear-gradient(135deg, #43f0a4, #0bbd78);
  box-shadow: 0 12px 30px rgba(67, 240, 164, 0.2);
}

.balance-stat-card--outcome .balance-stat-icon {
  background: linear-gradient(135deg, #ffb25f, #ff6677);
  box-shadow: 0 12px 30px rgba(255, 102, 119, 0.18);
}

.balance-chart-shell {
  position: relative;
  overflow: hidden;
  padding: clamp(16px, 1.4vw, 22px);
  border: 1px solid rgba(42, 171, 238, 0.18);
  border-radius: 26px;
  background:
    linear-gradient(rgba(42, 171, 238, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 171, 238, 0.028) 1px, transparent 1px),
    radial-gradient(circle at 46% 32%, rgba(0, 136, 204, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(14, 26, 40, 0.94), rgba(6, 12, 22, 0.96));
  background-size: 72px 72px, 72px 72px, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -90px 130px rgba(0, 0, 0, 0.2),
    0 24px 70px rgba(0, 0, 0, 0.28);
  animation: balanceFadeUp 0.5s ease both;
}

.balance-chart--premium {
  display: block;
  width: 100%;
  height: clamp(260px, 25vw, 360px);
  background: transparent !important;
}

#balanceHistory .balance-area {
  fill: url("#balanceFillGradient") !important;
}

#balanceHistory .balance-line {
  fill: none !important;
  stroke: #23d7ff !important;
  stroke-width: 4 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.balance-marker-line {
  stroke: rgba(42, 171, 238, 0.18);
  stroke-width: 1;
  stroke-dasharray: 5 8;
}

.balance-marker--in .balance-marker-line {
  stroke: rgba(67, 240, 164, 0.28);
}

.balance-marker--out .balance-marker-line {
  stroke: rgba(255, 117, 117, 0.28);
}

.balance-marker-halo {
  fill: rgba(42, 171, 238, 0.12);
  stroke: rgba(42, 171, 238, 0.42);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 12px rgba(42, 171, 238, 0.48));
}

.balance-marker-dot {
  fill: #eaf9ff;
  stroke: #23d7ff;
  stroke-width: 2.5;
}

.balance-marker--in .balance-marker-dot {
  stroke: #43f0a4;
}

.balance-marker--out .balance-marker-dot {
  stroke: #ff7785;
}

.balance-hit-dot {
  fill: transparent !important;
  stroke: transparent !important;
  pointer-events: all;
  cursor: crosshair;
}

.balance-tooltip {
  padding: 12px 14px !important;
  border: 1px solid rgba(42, 171, 238, 0.48) !important;
  border-radius: 16px !important;
  background: rgba(6, 14, 25, 0.94) !important;
  color: #eff8ff !important;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42), 0 0 30px rgba(0, 136, 204, 0.16) !important;
  backdrop-filter: blur(16px);
}

.balance-tooltip span,
.balance-tooltip b,
.balance-tooltip small {
  display: block;
}

.balance-tooltip span {
  color: rgba(174, 196, 216, 0.92);
  font-size: 0.76rem;
}

.balance-tooltip b {
  margin-top: 4px;
  font-size: 1rem;
}

.balance-tooltip small {
  margin-top: 5px;
  font-weight: 900;
}

.balance-tooltip .positive,
.balance-mini-summary .positive b {
  color: #43f0a4;
}

.balance-tooltip .negative,
.balance-mini-summary .negative b {
  color: #ff7785;
}

.balance-tooltip .neutral,
.balance-mini-summary .neutral b {
  color: #9fb4c8;
}

.balance-mini-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.balance-mini-summary article {
  padding: 14px 16px;
  border: 1px solid rgba(121, 169, 204, 0.14);
  border-radius: 18px;
  background: rgba(11, 21, 34, 0.62);
  backdrop-filter: blur(14px);
}

.balance-mini-summary span {
  display: block;
  color: rgba(164, 188, 210, 0.82);
  font-size: 0.78rem;
  font-weight: 800;
}

.balance-mini-summary b {
  display: block;
  margin-top: 6px;
  color: #f4f9ff;
  font-size: 1.02rem;
}

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

@media (max-width: 1280px) {
  .balance-kpis--premium {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .balance-head--premium {
    flex-direction: column;
  }

  .balance-kpis--premium,
  .balance-mini-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #balanceHistory.balance-history-section {
    border-radius: 22px !important;
  }

  .balance-kpis--premium,
  .balance-mini-summary {
    grid-template-columns: 1fr;
  }

  .balance-chart-shell {
    padding: 12px;
    border-radius: 20px;
  }

  .balance-chart--premium {
    height: 240px;
  }
}

#balanceHistory [data-balance-chart="dark"] {
  background-color: #0b1420 !important;
  background-image:
    linear-gradient(rgba(42, 171, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 171, 238, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 48% 34%, rgba(0, 136, 204, 0.13), transparent 46%),
    linear-gradient(180deg, #101b2a 0%, #09111d 100%) !important;
  background-size: 76px 76px, 76px 76px, auto, auto !important;
}

#balanceHistory [data-balance-svg="dark"] {
  background: transparent !important;
}

/* Final balance chart skin: keep the graph dark even if cached TonConnect/QR rules
   or browser defaults try to paint nested SVG/canvas blocks white. */
.balance-history-section .balance-chart-wrap {
  position: relative !important;
  isolation: isolate !important;
  padding: clamp(14px, 1.4vw, 18px) !important;
  border: 1px solid rgba(42, 171, 238, 0.18) !important;
  border-radius: 22px !important;
  background-color: #0b1420 !important;
  background-image:
    linear-gradient(rgba(42, 171, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 171, 238, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 48% 34%, rgba(0, 136, 204, 0.13), transparent 46%),
    linear-gradient(180deg, #101b2a 0%, #09111d 100%) !important;
  background-size: 76px 76px, 76px 76px, auto, auto !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 -60px 110px rgba(0, 0, 0, 0.18),
    0 22px 60px rgba(0, 0, 0, 0.26) !important;
}

.balance-history-section .balance-chart {
  display: block !important;
  width: 100% !important;
  height: clamp(240px, 24vw, 330px) !important;
  background: transparent !important;
}

.balance-history-section .balance-area {
  fill: rgba(42, 171, 238, 0.14) !important;
}

.balance-history-section .balance-line {
  stroke: #2aabee !important;
  stroke-width: 3.5 !important;
  filter: drop-shadow(0 0 12px rgba(42, 171, 238, 0.34)) !important;
}

.balance-history-section .balance-dot {
  display: none !important;
}

.balance-history-section .balance-axis {
  color: rgba(169, 192, 213, 0.86) !important;
}

.top-wallet-classified {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.top-wallet-card--classified .top-wallet-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.top-wallet-card--classified .top-wallet-row {
  min-width: 0;
}

.investigation-panel h3 small {
  color: rgba(154, 176, 201, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
}

.bulk-row {
  align-items: center;
}

.bulk-warning {
  grid-column: 1 / -1;
  color: #ffc978;
  font-size: 0.8rem;
}

body [role="dialog"] .tc-readable-qr-frame,
body [class*="tonconnect"] .tc-readable-qr-frame,
body [class*="ton-connect"] .tc-readable-qr-frame {
  background: #ffffff !important;
}

body [role="dialog"] .tc-readable-qr-media,
body [class*="tonconnect"] .tc-readable-qr-media,
body [class*="ton-connect"] .tc-readable-qr-media {
  background: #ffffff !important;
  border-color: #ffffff !important;
  filter: contrast(1.45) brightness(1.18) !important;
}

@media (max-width: 1180px) {
  .top-wallet-classified,
  .top-wallet-card--classified .top-wallet-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .timeline-bar {
    min-width: 28px !important;
    height: 142px !important;
  }

  .timeline-bar-track {
    width: 24px !important;
  }

  .balance-chart {
    height: 210px !important;
  }
}

/* Final May polish */
html,
body {
  max-width: 100%;
  overflow-x: hidden !important;
}

.app,
.results,
.hero,
.control-panel,
.section-block,
.wallet-profile,
.toolbar {
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

@media (min-width: 1200px) {
  .app {
    width: min(100%, 1840px);
    padding-inline: clamp(18px, 1.6vw, 30px);
  }

  .hero,
  .control-panel,
  .section-block,
  .wallet-profile {
    padding: clamp(22px, 1.7vw, 30px) !important;
  }
}

.balance-chart-wrap {
  background:
    linear-gradient(rgba(0, 136, 204, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 136, 204, 0.028) 1px, transparent 1px),
    radial-gradient(circle at 50% 30%, rgba(0, 136, 204, 0.12), transparent 42%),
    #0e1621 !important;
  border-color: rgba(42, 171, 238, 0.18) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 22px 60px rgba(0, 0, 0, 0.22) !important;
}

.balance-dot {
  display: none !important;
}

.balance-hit-dot {
  fill: transparent !important;
  stroke: transparent !important;
}

.balance-line {
  stroke: #2aabee !important;
  stroke-width: 4 !important;
  filter: drop-shadow(0 0 10px rgba(42, 171, 238, 0.28));
}

.balance-area {
  fill: rgba(42, 171, 238, 0.13) !important;
}

.pro-tools-grid {
  align-items: start !important;
}

.pro-tool-card {
  align-self: start !important;
}

#alertsList {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

#alertsList .pro-row {
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center;
}

.alert-delete-button {
  width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  border-radius: 12px !important;
  color: #ff8f8f !important;
  background: rgba(255, 102, 102, 0.08) !important;
  border-color: rgba(255, 102, 102, 0.18) !important;
}

.alert-history {
  max-height: 120px;
  overflow-y: auto;
  padding-right: 4px !important;
}

.bulk-results {
  max-height: 520px;
  overflow-y: auto;
}

.telegram-header-dropdown {
  padding: 8px !important;
  border-radius: 20px !important;
  background: rgba(12, 20, 32, 0.96) !important;
  border: 1px solid rgba(42, 171, 238, 0.18) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38) !important;
}

.telegram-header-dropdown-item {
  border: 0 !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border-radius: 14px !important;
}

.telegram-header-dropdown-item:hover {
  background: rgba(0, 136, 204, 0.18) !important;
}

body [role="dialog"] {
  background: #0e1621 !important;
  color: #eaf6ff !important;
}

body [role="dialog"] * {
  color: inherit !important;
}

body [role="dialog"] button,
body [role="dialog"] [role="button"] {
  background: rgba(16, 28, 43, 0.98) !important;
  border-color: rgba(42, 171, 238, 0.18) !important;
  color: #eaf6ff !important;
}

body [role="dialog"] canvas,
body [role="dialog"] img {
  background: #ffffff !important;
}

body [role="dialog"] .tc-readable-qr-frame,
body [role="dialog"] [class*="qr"] {
  background: #ffffff !important;
  border-radius: 22px !important;
}

body [role="dialog"] .tc-readable-qr-media {
  background: #ffffff !important;
  border: 16px solid #ffffff !important;
  border-radius: 18px !important;
  filter: contrast(1.55) brightness(1.16) !important;
}

.wallet-graph {
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 50% 26%, rgba(0, 136, 204, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(14, 22, 33, 0.96), rgba(8, 14, 26, 0.98)) !important;
}

.wallet-graph-canvas {
  background:
    linear-gradient(rgba(42, 171, 238, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 171, 238, 0.028) 1px, transparent 1px) !important;
  background-size: 56px 56px !important;
}

.graph-main {
  border-color: rgba(42, 171, 238, 0.34) !important;
  background:
    radial-gradient(circle at top, rgba(42, 171, 238, 0.16), transparent 62%),
    rgba(12, 20, 32, 0.96) !important;
  box-shadow: 0 24px 70px rgba(0, 136, 204, 0.14) !important;
}

.coins-cards {
  align-items: stretch;
}

.coin-card {
  min-height: 0 !important;
}

.coin-card-diff,
.coin-bar-value,
.coin-card-footer b {
  font-variant-numeric: tabular-nums;
}

/* Last-mile compact pass for "Top large wallets". Keep this at the end. */
.top-wallets-section {
  padding: clamp(16px, 1.35vw, 24px) !important;
}

.top-wallets-section .section-title {
  margin-bottom: clamp(10px, 1vw, 14px) !important;
}

.top-wallets-section .section-title h2 {
  font-size: clamp(1.28rem, 1.55vw, 1.72rem) !important;
  line-height: 1.06 !important;
  margin-bottom: 4px !important;
}

.top-wallets-section .section-title .muted {
  max-width: 1260px !important;
  font-size: clamp(0.78rem, 0.82vw, 0.9rem) !important;
  line-height: 1.32 !important;
}

.top-wallet-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(10px, 1vw, 14px) !important;
}

.top-wallet-classified {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(10px, 1vw, 14px) !important;
  margin-top: clamp(10px, 1vw, 14px) !important;
}

.top-wallet-card {
  border-radius: 16px !important;
}

.top-wallet-card-head {
  min-height: 46px !important;
  padding: 10px 12px !important;
  gap: 8px !important;
}

.top-wallet-card-head > div {
  gap: 8px !important;
}

.top-wallet-card .coin-mark {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  font-size: 0.74rem !important;
  box-shadow: 0 10px 24px rgba(0, 136, 204, 0.2) !important;
}

.top-wallet-card-head h3 {
  font-size: 0.92rem !important;
  line-height: 1.08 !important;
}

.top-wallet-card-head small {
  font-size: 0.68rem !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.top-wallet-card .top-wallet-list {
  gap: 0 !important;
}

.top-wallet-card .top-wallet-row,
.top-wallet-row {
  grid-template-columns: 22px minmax(92px, 0.95fr) minmax(112px, 0.85fr) minmax(48px, auto) 30px 30px !important;
  gap: 7px !important;
  min-height: 50px !important;
  padding: 7px 10px !important;
  align-items: center !important;
}

.top-wallet-card .top-wallet-main,
.top-wallet-card .top-wallet-money,
.top-wallet-main,
.top-wallet-money {
  gap: 1px !important;
  max-width: none !important;
  min-width: 0 !important;
}

.top-wallet-row .rank {
  font-size: 0.75rem !important;
  color: rgba(169, 192, 213, 0.92) !important;
}

.top-wallet-card .top-wallet-main a,
.top-wallet-main a {
  font-size: 0.84rem !important;
  line-height: 1.06 !important;
}

.top-wallet-card .top-wallet-money b,
.top-wallet-money b {
  font-size: 0.74rem !important;
  line-height: 1.06 !important;
}

.top-wallet-card .top-wallet-main small,
.top-wallet-card .top-wallet-money small,
.top-wallet-main small,
.top-wallet-money small {
  font-size: 0.62rem !important;
  line-height: 1.08 !important;
  margin: 0 !important;
}

.top-wallet-card .wallet-tag,
.top-wallet-row .wallet-tag {
  min-width: 48px !important;
  height: 23px !important;
  padding: 0 7px !important;
  font-size: 0.62rem !important;
  line-height: 1 !important;
  align-items: center !important;
  justify-self: end !important;
}

.top-wallet-card .top-wallet-row .icon-button,
.top-wallet-row .icon-button {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  border-radius: 11px !important;
  padding: 0 !important;
  font-size: 0.82rem !important;
}

.top-wallet-card--classified .top-wallet-list {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-width: 1380px) {
  .top-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1120px) {
  .top-wallet-grid,
  .top-wallet-classified,
  .top-wallet-card--classified .top-wallet-list {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .top-wallet-card .top-wallet-row,
  .top-wallet-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(78px, auto) 28px !important;
    min-height: 48px !important;
    gap: 6px !important;
    padding: 7px 9px !important;
  }

  .top-wallet-card .wallet-tag,
  .top-wallet-row .wallet-tag,
  .top-wallet-card .top-wallet-row .investigate-address,
  .top-wallet-row .investigate-address {
    display: none !important;
  }

  .top-wallet-card .top-wallet-row .copy-address,
  .top-wallet-row .copy-address {
    display: inline-flex !important;
  }
}
/* FINAL EOF LAYOUT OVERRIDE */
.top-wallet-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(10px, 0.9vw, 14px) !important;
  align-items: stretch !important;
}

.top-wallet-card {
  min-width: 0 !important;
  overflow: hidden !important;
}

.top-wallet-card .top-wallet-row,
.top-wallet-row {
  grid-template-columns: 20px minmax(84px, 1fr) minmax(96px, 0.88fr) 46px 28px 28px !important;
  gap: 6px !important;
  min-height: 46px !important;
  padding: 6px 9px !important;
}

.top-wallet-card .top-wallet-main,
.top-wallet-card .top-wallet-money,
.top-wallet-card .top-wallet-main a,
.top-wallet-card .top-wallet-money b,
.top-wallet-card .top-wallet-main small,
.top-wallet-card .top-wallet-money small {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.top-wallet-card .top-wallet-main a {
  font-size: 0.8rem !important;
}

.top-wallet-card .top-wallet-money b {
  font-size: 0.7rem !important;
}

.top-wallet-card .top-wallet-main small,
.top-wallet-card .top-wallet-money small {
  font-size: 0.58rem !important;
}

.top-wallet-card .wallet-tag {
  width: 46px !important;
  min-width: 46px !important;
  height: 22px !important;
  padding: 0 5px !important;
  font-size: 0.58rem !important;
}

.top-wallet-card .top-wallet-row .icon-button,
.top-wallet-row .icon-button {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  border-radius: 10px !important;
}

.balance-kpis--premium {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: clamp(8px, 0.8vw, 12px) !important;
  margin-bottom: clamp(14px, 1vw, 18px) !important;
}

.balance-stat-card {
  min-width: 0 !important;
  min-height: 104px !important;
  height: 100% !important;
  padding: 12px !important;
  border-radius: 17px !important;
}

.balance-stat-icon {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  margin-bottom: 8px !important;
  border-radius: 11px !important;
  font-size: 0.62rem !important;
}

.balance-stat-label {
  margin-bottom: 4px !important;
  font-size: 0.72rem !important;
  line-height: 1.16 !important;
}

.balance-stat-card b {
  font-size: clamp(0.82rem, 0.82vw, 0.98rem) !important;
  line-height: 1.18 !important;
  overflow-wrap: anywhere !important;
}

.balance-stat-card small {
  margin-top: 5px !important;
  font-size: 0.68rem !important;
  line-height: 1.2 !important;
  overflow-wrap: anywhere !important;
}

.balance-chart-shell {
  width: 100% !important;
  min-width: 0 !important;
  clear: both !important;
}

@media (max-width: 1180px) {
  .top-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .balance-kpis--premium {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {
  .top-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .top-wallet-card .top-wallet-row,
  .top-wallet-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(82px, auto) 28px !important;
  }

  .top-wallet-card .wallet-tag,
  .top-wallet-card .top-wallet-row .investigate-address {
    display: none !important;
  }

  .balance-kpis--premium {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  .top-wallet-grid {
    grid-template-columns: 1fr !important;
  }

  .top-wallet-card .top-wallet-row,
  .top-wallet-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(78px, auto) 28px !important;
  }

  .balance-kpis--premium {
    grid-template-columns: 1fr !important;
  }
}
