/* =========================================================================
   NightRug — App shell additions
   Top bar, modals, dropdowns, token detail, settings panels, explorer polish
   ========================================================================= */

/* ----- Top bar: enhanced version with price, notif, profile ----- */
.app-top {
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 20, 27, 0.85);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  position: sticky; top: 0; z-index: 30;
  gap: 16px;
}
.app-top-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.app-top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--t3); }
.crumbs .here { color: var(--t); font-weight: 600; }
.crumbs .sep { color: var(--t4); }
.crumbs a { color: var(--t3); transition: color var(--t-hover) var(--ease-out); }
.crumbs a:hover { color: var(--t); }

/* Price ticker pill */
.price-ticker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  transition: border-color var(--t-hover) var(--ease-out), background var(--t-hover) var(--ease-out);
  cursor: default;
}
.price-ticker:hover { background: var(--s3); }
.price-ticker .net-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 600;
  padding: 2px 6px; border-radius: 6px;
}
.price-ticker .net-badge.pos { color: var(--pos); background: rgba(95,224,160,0.10); }
.price-ticker .net-badge.neg { color: var(--neg); background: rgba(255,122,138,0.10); }
.price-ticker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 6px var(--pos); animation: pulse 2.4s var(--ease-out) infinite; }
.price-ticker .ticker-age {
  font-size: 10.5px; font-weight: 500;
  color: var(--t3);
  padding-left: 4px;
  border-left: 1px solid var(--line);
  margin-left: 2px;
  letter-spacing: 0.02em;
}
.price-ticker [data-ticker-price].tick-up { color: var(--pos); transition: color 0.4s var(--ease-out); }
.price-ticker [data-ticker-price].tick-down { color: var(--neg); transition: color 0.4s var(--ease-out); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Network pill */
.net-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--t2);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out);
}
.net-pill:hover { background: var(--s3); }
.net-pill .net-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); }

/* Bell + badge */
.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border-radius: 10px;
  color: var(--t2);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out), border-color var(--t-hover) var(--ease-out);
}
.icon-btn:hover { background: var(--s2); color: var(--t); border-color: var(--line); }
.icon-btn .badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--neg);
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: inline-grid; place-items: center;
  border: 2px solid var(--s1);
}

/* Profile chip + dropdown */
.profile-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out), border-color var(--t-hover) var(--ease-out);
  font-size: 13.5px; font-weight: 600;
  color: var(--t);
}
.profile-chip:hover { background: var(--s3); border-color: rgba(255,255,255,0.12); }
.profile-chip .avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 12px; }

.signed-out-btn { font-size: 14px; height: 38px; padding: 0 14px; }

/* Dropdowns */
.dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 320px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.2);
  z-index: 100;
  overflow: hidden;
  opacity: 0; transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.dropdown.open { opacity: 1; transform: none; pointer-events: auto; }

.dropdown-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: var(--t3);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.dropdown-head a, .dropdown-head button.link {
  font-size: 12px; color: var(--accent); font-weight: 600;
  text-transform: none; letter-spacing: 0;
  background: none; border: 0; padding: 0; cursor: pointer;
}

.dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  font-size: 14px; color: var(--t2);
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out);
  text-align: left; width: 100%;
  background: none; border: 0;
}
.dropdown-item:hover { background: var(--s3); color: var(--t); }
.dropdown-item .icn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--s3); color: var(--t2);
  flex: 0 0 auto;
}
.dropdown-item:hover .icn { background: rgba(167,255,138,0.12); color: var(--accent); }
.dropdown-item .it-body { flex: 1; min-width: 0; }
.dropdown-item .it-title { font-size: 14px; color: var(--t); font-weight: 500; }
.dropdown-item .it-sub { font-size: 12.5px; color: var(--t3); margin-top: 1px; }
.dropdown-item.danger:hover .icn { background: rgba(255,122,138,0.12); color: var(--neg); }
.dropdown-item.danger:hover .it-title { color: var(--neg); }

.dropdown-divider { height: 1px; background: var(--line); margin: 4px 0; }

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--t-hover) var(--ease-out);
  cursor: pointer;
  position: relative;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--s3); }
.notif-item.unread::before {
  content: ''; position: absolute; top: 18px; left: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.notif-item .n-icn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px; flex: 0 0 auto;
}
.notif-item .n-icn.pos { background: rgba(95,224,160,0.12); color: var(--pos); }
.notif-item .n-icn.neg { background: rgba(255,122,138,0.12); color: var(--neg); }
.notif-item .n-icn.warn { background: rgba(255,197,106,0.12); color: var(--warn); }
.notif-item .n-icn.info { background: rgba(138,184,255,0.12); color: var(--info); }
.notif-item .n-body { flex: 1; min-width: 0; }
.notif-item .n-title { font-size: 14px; color: var(--t); font-weight: 500; line-height: 1.4; }
.notif-item .n-sub { font-size: 12.5px; color: var(--t3); margin-top: 3px; line-height: 1.4; }
.notif-item .n-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 6px;
}
.notif-item .n-time { font-size: 11.5px; color: var(--t4); }
.notif-item .n-cta {
  font-size: 12px; font-weight: 600; color: var(--accent);
  letter-spacing: 0.01em;
}
.notif-item:hover .n-cta { text-decoration: underline; text-underline-offset: 2px; }
.notif-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13.5px; color: var(--t3);
}
button.notif-item {
  width: 100%;
  background: none; border: 0;
  font: inherit; color: inherit;
  text-align: left;
}

/* Profile dropdown */
.profile-card {
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--line);
}
.profile-card .avatar { width: 44px; height: 44px; font-size: 16px; border-radius: 50%; }
.profile-card .p-info { flex: 1; min-width: 0; }
.profile-card .p-name { font-size: 15px; font-weight: 600; }
.profile-card .p-mail { font-size: 12.5px; color: var(--t3); margin-top: 1px; word-break: break-all; }

/* Container for dropdown triggers (relative parent) */
.has-dd { position: relative; }

/* ----- Modal framework ----- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 220ms var(--ease-out);
}
.modal-backdrop.open { display: flex; opacity: 1; }
.modal {
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  transform: translateY(8px) scale(0.98);
  transition: transform 220ms var(--ease-out);
}
.modal-backdrop.open .modal { transform: none; }
.modal.lg { max-width: 720px; }
.modal.xl { max-width: 920px; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 18px; }
.modal-close {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--t3);
  transition: background var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out);
  cursor: pointer;
}
.modal-close:hover { background: var(--s2); color: var(--t); }

.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--s2);
}

/* Sign In modal */
.auth-tabs { display: flex; gap: 4px; background: var(--s2); border-radius: 10px; padding: 3px; margin-bottom: 22px; }
.auth-tab {
  flex: 1; padding: 8px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600;
  color: var(--t3);
  text-align: center;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out);
}
.auth-tab.is-on { background: var(--s3); color: var(--t); }
.auth-form .field { margin-bottom: 14px; }
.auth-form .helper {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 18px;
  font-size: 13px;
  color: var(--t3);
}
.auth-form .helper label { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.auth-form .helper input { accent-color: var(--accent); }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--t4);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 18px 0;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.wallet-btn {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  color: var(--t);
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out), border-color var(--t-hover) var(--ease-out);
}
.wallet-btn:hover { background: var(--s3); border-color: rgba(255,255,255,0.12); }
.wallet-btn .icn { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; }
.wallet-btn .desc { font-size: 12.5px; color: var(--t3); font-weight: 500; margin-left: auto; }

/* ----- Token detail modal ----- */
.td-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
}
@media (max-width: 720px) { .td-grid { grid-template-columns: 1fr; } }

.td-token { display: flex; align-items: center; gap: 14px; }
.td-token .avatar { width: 56px; height: 56px; border-radius: 30%; font-size: 22px; }
.td-token .name { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.td-token .sym { font-size: 14px; color: var(--t3); margin-top: 2px; }

.td-price {
  display: flex; align-items: baseline; gap: 12px;
  margin-top: 20px;
}
.td-price .v {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px; font-weight: 600;
  letter-spacing: -0.02em;
}
.td-price .c {
  font-size: 14px; font-weight: 600;
  padding: 4px 10px; border-radius: 8px;
}
.td-price .c.pos { color: var(--pos); background: rgba(95,224,160,0.10); }
.td-price .c.neg { color: var(--neg); background: rgba(255,122,138,0.10); }

.td-mint {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px; color: var(--t3);
  font-family: 'JetBrains Mono', monospace;
  word-break: break-all;
}
.td-mint .lbl { font-size: 11px; color: var(--t4); text-transform: uppercase; letter-spacing: 0.1em; margin-right: 6px; }
.td-mint button {
  margin-left: auto; flex-shrink: 0;
  background: var(--s3); color: var(--t2);
  border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 8px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out);
}
.td-mint button:hover { background: var(--s4); }

.td-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.td-stat {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.td-stat .l { font-size: 12px; color: var(--t3); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.td-stat .vv { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.td-stat .vv-sm { font-family: 'JetBrains Mono', monospace; font-size: 14px; }

.td-chart {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-top: 18px;
}
.td-chart .ch-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.td-chart .ch-head h3 { font-size: 14px; color: var(--t2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.td-chart .ranges { display: flex; gap: 4px; }
.td-chart .ranges button {
  padding: 4px 10px; border-radius: 6px;
  background: transparent; color: var(--t3);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out);
}
.td-chart .ranges button.is-on { background: var(--s3); color: var(--t); }
.td-chart .ranges button:hover { color: var(--t); }
.td-chart svg { width: 100%; height: 140px; display: block; }

.td-side h4 {
  font-size: 13px; color: var(--t3);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600;
  margin: 0 0 10px;
}
.td-side .trade-card {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.td-side .tabs { display: flex; background: var(--s3); padding: 3px; border-radius: 10px; margin-bottom: 14px; }
.td-side .tabs .tab { flex: 1; padding: 6px 10px; font-size: 13px; }
.td-side .tabs .tab.is-on { background: var(--s1); color: var(--t); }
.td-side .amt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.td-side .amt-row .input { flex: 1; }
.td-side .pct-row { display: flex; gap: 4px; margin-bottom: 14px; }
.td-side .pct-row button { flex: 1; padding: 5px 0; font-size: 12px; background: var(--s3); color: var(--t2); border-radius: 6px; cursor: pointer; }
.td-side .pct-row button:hover { background: var(--s4); }

.td-side .badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.td-side .badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
}
.td-side .badge.ok { background: rgba(95,224,160,0.10); color: var(--pos); }
.td-side .badge.warn { background: rgba(255,197,106,0.10); color: var(--warn); }
.td-side .badge.bad { background: rgba(255,122,138,0.10); color: var(--neg); }
.td-side .badge.neu { background: var(--s3); color: var(--t2); }

.td-info-list {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.td-info-list .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; }
.td-info-list .row + .row { border-top: 1px solid var(--line-soft); }
.td-info-list .k { color: var(--t3); }
.td-info-list .v { font-weight: 500; }

/* Rugged badge */
.rugged-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  background: rgba(255,122,138,0.10);
  color: var(--neg);
  border: 1px solid rgba(255,122,138,0.20);
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.fresh-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  background: rgba(95,224,160,0.10);
  color: var(--pos);
  border: 1px solid rgba(95,224,160,0.20);
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* ----- Toast notifications ----- */
.toast-stack {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--t);
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  min-width: 280px; max-width: 360px;
  pointer-events: auto;
  transform: translateX(20px); opacity: 0;
  transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}
.toast.in { transform: none; opacity: 1; }
.toast .ti {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  flex-shrink: 0;
}
.toast .ti.ok { background: rgba(95,224,160,0.12); color: var(--pos); }
.toast .ti.err { background: rgba(255,122,138,0.12); color: var(--neg); }
.toast .ti.info { background: rgba(138,184,255,0.12); color: var(--info); }
.toast .ti.warn { background: rgba(255,197,106,0.12); color: var(--warn); }
.toast .tb { flex: 1; min-width: 0; }
.toast .tt { font-weight: 600; }
.toast .ts { font-size: 12.5px; color: var(--t3); margin-top: 1px; }

/* ----- Settings: functional panels ----- */
.settings-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: flex-start;
}
@media (max-width: 820px) { .settings-grid { grid-template-columns: 1fr; } }

.settings-side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.settings-side button {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: var(--t2);
  cursor: pointer;
  background: none; border: 0; text-align: left;
  transition: background var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out);
}
.settings-side button:hover { background: var(--s2); color: var(--t); }
.settings-side button.is-on { background: var(--s2); color: var(--t); }
.settings-side button.is-on .icn { color: var(--accent); }
.settings-side button .icn { width: 18px; height: 18px; color: var(--t3); flex: 0 0 auto; }
.settings-side button.danger:hover { color: var(--neg); }
.settings-side button.danger .icn { color: var(--t4); }

.settings-section { display: none; }
.settings-section.is-on { display: block; }

.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row .info { flex: 1; min-width: 0; }
.settings-row h4 { font-size: 15px; font-weight: 600; }
.settings-row p { color: var(--t3); font-size: 13.5px; margin: 4px 0 0; line-height: 1.5; }

.notif-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
}
.notif-row .icn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--s3); color: var(--t2);
  flex-shrink: 0;
}
.notif-row .lbl { flex: 1; }
.notif-row .lbl .t { font-size: 14px; font-weight: 500; }
.notif-row .lbl .s { font-size: 12.5px; color: var(--t3); margin-top: 2px; }

.api-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  word-break: break-all;
}
.api-row .lbl-key { color: var(--t3); font-weight: 600; flex-shrink: 0; }
.api-row .v-key { color: var(--t2); flex: 1; min-width: 0; }
.api-row button {
  flex-shrink: 0;
  padding: 6px 10px;
  background: var(--s3);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--t2);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.api-row button:hover { background: var(--s4); }

.session-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
}
.session-row .icn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--s3); color: var(--t2);
  flex-shrink: 0;
}
.session-row .lbl { flex: 1; min-width: 0; }
.session-row .lbl .t { font-size: 14px; font-weight: 500; }
.session-row .lbl .s { font-size: 12.5px; color: var(--t3); margin-top: 2px; }
.session-row.this .lbl .s { color: var(--pos); }
.session-row button {
  padding: 6px 10px;
  background: var(--s3);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--t2);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.session-row button.danger { color: var(--neg); }
.session-row button:hover { background: var(--s4); }

/* ----- Explorer enhancements ----- */
.explorer-panel { padding: 24px; }
.explorer-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.explorer-head .lead { font-size: 15px; color: var(--t2); margin: 0; max-width: 60ch; }

.explorer-controls {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search { flex: 1; min-width: 220px; position: relative; }
.search .input { padding-left: 38px; }
.search .icn {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--t3); pointer-events: none;
}
.search .clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px;
  display: none;
  align-items: center; justify-content: center;
  color: var(--t3);
  background: var(--s3);
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
}
.search .clear.show { display: flex; }
.search .clear:hover { background: var(--s4); color: var(--t); }

.sort-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px; height: 44px;
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  color: var(--t2);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out), border-color var(--t-hover) var(--ease-out);
}
.sort-btn:hover { background: var(--s2); border-color: rgba(255,255,255,0.12); }
.sort-btn .icn { width: 14px; height: 14px; }
.sort-btn .dir { color: var(--accent); }

.ex-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.6fr) minmax(0, 0.8fr) minmax(0, 0.7fr) minmax(0, 0.9fr) minmax(0, 0.8fr) minmax(0, 0.7fr) 84px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out);
  position: relative;
}
.ex-row .ex-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ex-row:hover { background: var(--s2); }
.ex-row + .ex-row { margin-top: 2px; }
.ex-row.is-rugged { opacity: 0.85; }
.ex-row.is-rugged:hover { opacity: 1; }

.ex-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.6fr) minmax(0, 0.8fr) minmax(0, 0.7fr) minmax(0, 0.9fr) minmax(0, 0.8fr) minmax(0, 0.7fr) 84px;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  font-size: 11.5px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.ex-head span { white-space: nowrap; }
.ex-head .h-sortable { display: inline-flex; align-items: center; gap: 4px; }
.ex-head > *:nth-child(3),
.ex-head > *:nth-child(4),
.ex-head > *:nth-child(5),
.ex-head > *:nth-child(6),
.ex-head > *:nth-child(7),
.ex-head > *:nth-child(8) { justify-self: end; }
.ex-head > *:nth-child(8) { display: inline-flex; }
.ex-head .h-sortable { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 4px; }
.ex-head .h-sortable:hover { color: var(--t2); }
.ex-head .h-sortable.is-on { color: var(--accent); }
.ex-head .h-sortable .arr { font-size: 10px; }

.ex-row .col-tx { font-size: 12.5px; color: var(--t3); display: flex; align-items: center; gap: 6px; }
.ex-row .ex-rank { color: var(--t4); font-size: 13.5px; font-weight: 600; }
.ex-row .ex-id .name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.ex-row .ex-id .sym { color: var(--t3); font-size: 13px; margin-top: 2px; }

.ex-row .ex-num { text-align: right; font-size: 14.5px; justify-self: end; }
.ex-row .ex-rank { justify-self: start; }
.ex-row .ex-num.pos { color: var(--pos); }
.ex-row .ex-num.neg { color: var(--neg); }
.ex-row .ex-num.muted { color: var(--t4); font-style: italic; }

.ex-spark { display: flex; justify-content: flex-end; align-items: center; }
.ex-spark-svg { display: block; }
.ex-spark .pill-mini {
  font-size: 11px; font-weight: 600;
  padding: 3px 7px; border-radius: 5px;
  display: inline-flex; align-items: center; gap: 4px;
}
.ex-spark .pill-mini.pos { background: rgba(95,224,160,0.10); color: var(--pos); }
.ex-spark .pill-mini.neg { background: rgba(255,122,138,0.10); color: var(--neg); }
.ex-spark .pill-mini.neu { background: var(--s3); color: var(--t3); }

.ex-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--t3);
}
.ex-empty .icn {
  width: 48px; height: 48px;
  display: inline-grid; place-items: center;
  background: var(--s2);
  border-radius: 12px;
  margin-bottom: 14px;
  color: var(--t3);
}
.ex-empty h3 { font-size: 17px; color: var(--t2); margin: 0 0 4px; }
.ex-empty p { font-size: 13.5px; margin: 0; }

.ex-tabs { margin-bottom: 18px; }
.ex-tabs .tab { display: inline-flex; align-items: center; gap: 6px; }
.ex-tabs .tab .count {
  font-size: 11px;
  padding: 1px 7px;
  background: var(--s3);
  color: var(--t3);
  border-radius: 999px;
  font-weight: 600;
}
.ex-tabs .tab.is-on .count { background: var(--accent); color: var(--accent-ink); }

.ex-summary {
  display: flex; align-items: center; gap: 18px;
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}
.ex-summary .lbl { color: var(--t3); }
.ex-summary .v { color: var(--t); font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.ex-summary .sep { color: var(--t4); }

/* Explorer mobile row layout */
@media (max-width: 900px) {
  .ex-head { display: none; }
  .ex-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-areas: "rank id price" "rank meta meta";
    row-gap: 6px;
  }
  .ex-row .ex-rank { grid-area: rank; align-self: start; padding-top: 6px; }
  .ex-row .ex-id { grid-area: id; }
  .ex-row .ex-num.col-pri { grid-area: price; }
  .ex-row .col-meta-row {
    grid-area: meta;
    display: flex; flex-wrap: wrap; gap: 12px;
    font-size: 12.5px; color: var(--t3);
    border-top: 1px solid var(--line-soft);
    padding-top: 8px;
  }
  .ex-row .col-meta-row span { display: inline-flex; align-items: center; gap: 4px; }
  .ex-row .col-meta-row .v { color: var(--t2); font-weight: 600; }
  .ex-row .ex-spark { display: none; }
}

/* ----- Dashboard enhancements ----- */
.balance-card {
  background: linear-gradient(135deg, rgba(167,255,138,0.04), rgba(138,184,255,0.03));
  border: 1px solid var(--line);
  border-radius: var(--r-block);
  padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.balance-card .b-l { flex: 1; min-width: 220px; }
.balance-card .b-eyebrow { font-size: 12px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-bottom: 6px; }
.balance-card .b-v { font-family: 'Space Grotesk', sans-serif; font-size: 36px; font-weight: 600; letter-spacing: -0.02em; }
.balance-card .b-sub { font-size: 13px; color: var(--t3); margin-top: 4px; }
.balance-card .b-r { display: flex; gap: 10px; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 22px;
}
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}
.kpi .l { font-size: 12px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 6px; }
.kpi .v { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.kpi .d { font-size: 12.5px; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .d.pos { color: var(--pos); }
.kpi .d.neg { color: var(--neg); }

.dash-activity {
  display: flex; flex-direction: column;
  gap: 1px;
  background: var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
}
.dash-act-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--s1);
}
.dash-act-item .icn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  flex-shrink: 0;
}
.dash-act-item .icn.pos { background: rgba(95,224,160,0.12); color: var(--pos); }
.dash-act-item .icn.info { background: rgba(138,184,255,0.12); color: var(--info); }
.dash-act-item .icn.warn { background: rgba(255,197,106,0.12); color: var(--warn); }
.dash-act-item .lbl { flex: 1; min-width: 0; }
.dash-act-item .lbl .t { font-size: 14px; font-weight: 500; }
.dash-act-item .lbl .s { font-size: 12.5px; color: var(--t3); margin-top: 2px; }
.dash-act-item .when { font-size: 12.5px; color: var(--t3); flex-shrink: 0; }

.dash-act-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 44px 24px 40px;
  background: var(--s1);
  gap: 4px;
}
.dash-act-empty .t { font-size: 15px; font-weight: 600; color: var(--t1); margin-top: 10px; }
.dash-act-empty .s { font-size: 13px; color: var(--t3); max-width: 360px; line-height: 1.5; }

/* ----- Auth (email + 6-digit code sign-in) ----- */
.auth-body { padding: 6px 4px 4px; }
.auth-steps {
  display: flex; align-items: center; gap: 6px;
  margin: -4px 0 18px;
}
.auth-steps .dot {
  width: 22px; height: 4px; border-radius: 99px;
  background: var(--line);
  transition: background .25s var(--ease-out), width .25s var(--ease-out);
}
.auth-steps .dot.is-on { background: var(--accent); }
.auth-steps .dot.done  { background: var(--pos); }

.auth-step { display: none; animation: authStepIn .28s var(--ease-out); }
.auth-step.is-on { display: block; }
@keyframes authStepIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.auth-sub {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--t2);
  line-height: 1.55;
}
.auth-sub strong.auth-target { color: var(--t1); font-weight: 600; }

/* Mode banner inside the code step — "Sign in" or "Create your account" */
.auth-sub [data-mode-banner] {
  display: inline-block;
  padding: 2px 9px;
  margin-right: 2px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(124, 92, 255, 0.14);
  color: #7C5CFF;
  vertical-align: 1px;
}
.auth-sub [data-mode-banner][data-mode="register"] {
  background: rgba(95, 224, 160, 0.14);
  color: #5FE0A0;
}
.auth-sub [data-mode-banner][data-mode="signin"] {
  background: rgba(138, 184, 255, 0.14);
  color: #8AB8FF;
}

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .field { display: flex; flex-direction: column; gap: 6px; }
.auth-form label {
  font-size: 12px; font-weight: 600;
  color: var(--t2); letter-spacing: 0.02em;
}
.auth-form .input {
  height: 44px;
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--t1);
  font-size: 15px;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.auth-form .input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--s2);
}
.auth-form .field-err {
  min-height: 16px;
  font-size: 12.5px;
  color: var(--neg);
  line-height: 1.4;
}
/* The inline "switch mode" link inside the error message */
.auth-form .field-err .link-btn {
  display: inline;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 2px;
}
.auth-form .field-err .link-btn:hover { color: var(--t1); }

.auth-submit {
  position: relative;
  width: 100%;
  height: 46px;
  font-size: 14.5px;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-submit .spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: none;
  animation: spin .8s linear infinite;
}
.auth-submit.is-busy .spinner { display: inline-block; }
.auth-submit.is-busy .lbl { opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Generic button loading state (for support form, etc.) */
.btn .spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: none; animation: spin .8s linear infinite; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .lbl { opacity: 0.6; }
.btn:disabled { cursor: not-allowed; opacity: 0.7; }

.auth-badges {
  list-style: none; padding: 0; margin: 20px 0 0;
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}
.auth-badges li {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--t2);
}
.auth-badges .b-icn {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--t1);
}
.auth-badges svg { width: 12px; height: 12px; }

/* Tabbed auth panels (Sign in / Create account share the same modal) */
.auth-panel { display: none; animation: authStepIn .28s var(--ease-out); }
.auth-panel.is-on { display: block; }

/* Password input with show/hide toggle */
.input-pw {
  position: relative;
  display: flex;
  align-items: center;
}
.input-pw .input {
  width: 100%;
  padding-right: 44px; /* leave room for the toggle */
}
.pw-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--t3);
  cursor: pointer;
  transition: color .15s var(--ease-out), background .15s var(--ease-out);
}
.pw-toggle:hover { color: var(--t1); background: var(--s2); }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle .eye-off { display: none; }
.pw-toggle.is-shown .eye-on  { display: none; }
.pw-toggle.is-shown .eye-off { display: block; }

/* Password strength meter (register panel only) */
.pw-meter {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  height: 4px;
}
.pw-meter-bar {
  flex: 1;
  height: 100%;
  background: var(--s2);
  border-radius: 2px;
  transition: background .2s var(--ease-out);
}
.pw-meter-bar.is-on[data-s="1"] { background: var(--neg); }
.pw-meter-bar.is-on[data-s="2"] { background: #f59e0b; }
.pw-meter-bar.is-on[data-s="3"] { background: #eab308; }
.pw-meter-bar.is-on[data-s="4"] { background: var(--pos); }
.pw-hint {
  font-size: 12px;
  color: var(--t3);
  min-height: 16px;
  margin-top: 2px;
}
.pw-hint[data-tone="ok"]  { color: var(--pos); }
.pw-hint[data-tone="mid"] { color: #eab308; }
.pw-hint[data-tone="bad"] { color: var(--neg); }

/* "Forgot password?" inline link inside the sign-in form */
.auth-forgot {
  align-self: flex-end;
  margin-top: -4px;
  font-size: 12.5px;
  color: var(--t2);
  text-decoration: none;
  cursor: pointer;
  background: none; border: none; padding: 0;
  font: inherit;
  transition: color .15s var(--ease-out);
}
.auth-forgot:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Google button slot (Google Identity Services renders inside .google-slot) */
.google-slot {
  display: flex;
  justify-content: center;
  min-height: 44px; /* prevent layout jump when GIS injects the button */
}
.google-slot > div,
.google-slot > iframe { width: 100% !important; }
.btn-google {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--s1);
  color: var(--t1);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s var(--ease-out), border-color .15s var(--ease-out);
}
.btn-google:hover { background: var(--s2); border-color: rgba(255,255,255,0.14); }
.btn-google:disabled { cursor: not-allowed; opacity: .65; }
.btn-google svg { width: 18px; height: 18px; }

/* Compact "switch tab" link between Sign in / Create account */
.auth-switch {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--t3);
}
.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: none; border: none; padding: 0;
  font: inherit;
}
.auth-switch a:hover { color: var(--t1); text-decoration: underline; text-underline-offset: 2px; }

/* success state */
.auth-done { text-align: center; padding: 18px 0 8px; }
.auth-done-mark {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(95,224,160,0.12);
  color: var(--pos);
  display: grid; place-items: center;
  animation: donePop .45s var(--ease-out);
}
@keyframes donePop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.auth-done h3 { font-size: 20px; margin: 0 0 6px; color: var(--t1); }
.auth-done p  { font-size: 13.5px; color: var(--t3); margin: 0; }

/* ----- Sidebar balance: live updating ----- */
.sidebar-balance .val { display: flex; align-items: baseline; gap: 4px; }
.sidebar-balance .val-usd { font-size: 11.5px; color: var(--t3); font-weight: 500; }
.sidebar-balance .bal-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 2.4s var(--ease-out) infinite; }

/* ----- Empty helper states (used after delete, etc.) ----- */
.empty-inline {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--t3);
}
.empty-inline .icn { width: 40px; height: 40px; display: inline-grid; place-items: center; background: var(--s2); color: var(--t3); border-radius: 10px; margin-bottom: 12px; }
.empty-inline h4 { font-size: 15px; color: var(--t2); margin: 0 0 4px; }
.empty-inline p { font-size: 13px; margin: 0; max-width: 36ch; }

/* ----- Number input + buttons polish ----- */
.btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-success { background: var(--pos); color: var(--accent-ink); border-color: transparent; }
.btn-success:hover { background: #4DC890; }

/* ----- Hover row in tables subtle ----- */
.clickable { cursor: pointer; }

/* ----- Switch (toggle) ----- */
.switch {
  position: relative;
  width: 44px; height: 26px;
  background: var(--s3);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out), border-color var(--t-hover) var(--ease-out);
  flex-shrink: 0;
  padding: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--t2);
  border-radius: 50%;
  transition: transform var(--t-hover) var(--ease-out), background var(--t-hover) var(--ease-out);
}
.switch.is-on { background: var(--accent); border-color: transparent; }
.switch.is-on::after { transform: translateX(18px); background: #0c0e12; }
.switch:hover { border-color: rgba(255,255,255,0.18); }

/* ----- Field ----- */
.field { display: block; margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; color: var(--t3); margin-bottom: 8px; font-weight: 600; }
.field .input { width: 100%; }
.field textarea.input { resize: vertical; min-height: 80px; }

/* ----- Profile row (used in settings) ----- */
.profile-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.profile-row:last-child { border-bottom: 0; }
.profile-row .lbl { font-size: 12px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 4px; }
.profile-row .val { font-size: 15px; font-weight: 500; color: var(--t); }

/* ----- Settings page cards ----- */
.settings-grid .card {
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 26px;
}
.settings-grid .card.danger { border-color: rgba(255,122,138,0.25); background: linear-gradient(180deg, rgba(255,122,138,0.04), var(--s1)); }
.settings-grid .card h2 { font-size: 18px; margin: 0; }
.settings-grid .card .desc { color: var(--t3); font-size: 13.5px; margin: 0; }
.settings-grid .card .hint { font-size: 12.5px; color: var(--t3); margin-top: 8px; line-height: 1.5; }

/* ----- Settings pill ----- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--s3);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t2);
}

/* ----- Settings tabs (top) - unused, kept for compat ----- */
.tabs { display: flex; align-items: center; gap: 4px; }
.tab {
  padding: 8px 14px;
  font-size: 14px; font-weight: 500;
  color: var(--t3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out);
}
.tab:hover { color: var(--t2); background: var(--s2); }
.tab.is-on {
  background: var(--s2);
  color: var(--t);
  border-color: var(--line);
}
.tab.is-on::after { display: none; } /* underline by default - disable */

/* ----- Switch (modern) ----- */
.switch[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ----- Locked badge ----- */
.locked {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--t3);
  padding: 3px 8px;
  background: var(--s3);
  border-radius: 6px;
  font-weight: 600;
}

/* ----- select.input ----- */
select.input { padding-right: 36px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; appearance: none; -webkit-appearance: none; }

/* ----- explorer table - small additions ----- */
.explorer-table { background: var(--s1); border-radius: 14px; }

/* ----- settings-side fix: make sure it's an actual nav ----- */
.settings-side { padding: 0; background: transparent; border: 0; }

/* =========================================================================
   WALLET UI — connect button, connected chip, dropdown, picker, gate
   ========================================================================= */

/* Topbar control wrapper — keeps it sitting nicely next to the ticker */
.wallet-ctrl { position: relative; display: inline-flex; }
.wallet-ctrl .signed-out-btn { font-size: 14px; height: 38px; padding: 0 14px; }

/* "Connect wallet" button (topbar) */
.wallet-connect-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px;
  font-size: 13.5px; font-weight: 600;
  color: var(--t2);
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out),
              border-color var(--t-hover) var(--ease-out),
              color var(--t-hover) var(--ease-out);
}
.wallet-connect-btn:hover {
  background: var(--s3);
  border-color: rgba(255,255,255,0.12);
  color: var(--t);
}
.wallet-connect-btn .wallet-icn {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px;
  color: var(--accent);
}

/* Connected chip (topbar) */
.wallet-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px 0 12px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px; font-weight: 600;
  color: var(--t);
  transition: background var(--t-hover) var(--ease-out),
              border-color var(--t-hover) var(--ease-out);
}
.wallet-chip:hover {
  background: var(--s3);
  border-color: rgba(255,255,255,0.14);
}
.wallet-chip .wallet-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 6px var(--pos);
  flex: 0 0 auto;
}
.wallet-chip .wallet-addr {
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--t);
}
.wallet-chip .wallet-chev {
  display: inline-grid; place-items: center;
  color: var(--t3);
  margin-left: 2px;
}

/* Wallet dropdown */
.wallet-dd { min-width: 360px; }
.wallet-dd-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(167,255,138,0.05) 0%, transparent 100%);
}
.wallet-dd-eyebrow {
  font-size: 11px; font-weight: 700;
  color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.wallet-dd-addr {
  font-size: 12.5px;
  color: var(--t);
  word-break: break-all;
  line-height: 1.45;
  max-height: 4.5em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wallet-dd-sub {
  font-size: 12px; color: var(--t3);
  margin-top: 6px;
  text-transform: capitalize;
}

/* Wallet picker (modal) */
.wallet-picker {
  padding: 18px 18px 16px;
}
.wallet-picker-sub {
  font-size: 13.5px;
  color: var(--t3);
  margin: 0 0 14px;
  line-height: 1.55;
  max-width: 44ch;
}
.wallet-list {
  display: flex; flex-direction: column;
  gap: 6px;
}
.wallet-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--t);
  text-align: left;
  transition: background var(--t-hover) var(--ease-out),
              border-color var(--t-hover) var(--ease-out),
              transform var(--t-hover) var(--ease-out);
}
.wallet-row:hover {
  background: var(--s3);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}
.wallet-row.is-loading {
  opacity: 0.6;
  pointer-events: none;
}
.wallet-row .wallet-icn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  flex: 0 0 auto;
}
.wallet-row .wallet-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.wallet-row .wallet-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--t);
}
.wallet-row .wallet-sub {
  font-size: 12px;
  color: var(--t3);
}
.wallet-row .wallet-go {
  display: inline-grid; place-items: center;
  color: var(--t3);
}

.wallet-picker-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.wallet-picker-foot p {
  font-size: 12.5px;
  color: var(--t3);
  margin: 0 0 8px;
  line-height: 1.55;
}
.wallet-picker-foot p:last-child { margin-bottom: 0; }
.wallet-safety {
  color: var(--t4) !important;
  font-size: 11.5px !important;
  font-style: italic;
}

/* ----- WALLET GATE (withdraw page) -----
   The card that sits above the withdrawal form. Two visual states:
   - locked: orange/warn tint, urgent CTA "Connect wallet"
   - connected: green tint, "Use as destination" + "Change" actions
   ============================================== */
.wallet-gate {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  margin-bottom: 18px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 14px;
  position: relative;
  transition: background var(--t-hover) var(--ease-out),
              border-color var(--t-hover) var(--ease-out);
}
.wallet-gate.is-locked {
  background: linear-gradient(180deg, rgba(255,180,80,0.06) 0%, var(--s2) 100%);
  border-color: rgba(255,180,80,0.25);
}
.wallet-gate.is-connected {
  background: linear-gradient(180deg, rgba(95,224,160,0.07) 0%, var(--s2) 100%);
  border-color: rgba(95,224,160,0.22);
}
.wallet-gate .wg-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255,180,80,0.14);
  color: var(--warn);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.wallet-gate .wg-icon-ok {
  background: rgba(95,224,160,0.14);
  color: var(--pos);
}
.wallet-gate .wg-body {
  flex: 1; min-width: 0;
}
.wallet-gate .wg-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--t);
  margin-bottom: 4px;
}
.wallet-gate .wg-sub {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.55;
}
.wallet-gate .wg-addr {
  color: var(--t2);
  font-weight: 600;
  margin: 0 4px;
}
.wallet-gate .wg-provider {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--s3);
  border-radius: 4px;
  font-size: 11px;
  color: var(--t2);
  text-transform: capitalize;
}
.wallet-gate .wg-cta {
  display: flex; gap: 8px; align-items: center;
  flex: 0 0 auto;
}
.wallet-gate .wg-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pos); box-shadow: 0 0 6px var(--pos);
  display: inline-block;
}

/* Compact gate on smaller screens */
@media (max-width: 720px) {
  .wallet-gate { flex-direction: column; align-items: stretch; }
  .wallet-gate .wg-cta { width: 100%; }
  .wallet-gate .wg-cta .btn { flex: 1; }
}

/* ----- Locked form panel state -----
   When the form is locked (wallet not connected), the panel stays
   visible so the user can read the layout, but is dimmed and inputs
   are not actionable. The wallet gate card above is the primary
   signal. The "Review" button is the only control whose state we
   change in the DOM (disabled + label change).
   ============================================== */
.app-content .panel.is-locked {
  opacity: 0.55;
  filter: saturate(0.4);
  transition: opacity var(--t-hover) var(--ease-out),
              filter var(--t-hover) var(--ease-out);
}
.app-content .panel.is-locked .input,
.app-content .panel.is-locked .preset {
  background: var(--s1);
  color: var(--t3);
  cursor: not-allowed;
}
.btn.is-disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: saturate(0.4);
}
.btn[disabled]:hover { background: var(--accent); }
.btn-danger[disabled]:hover { background: var(--neg); }

/* =========================================================================
   Liquidity / rug-pull page
   ========================================================================= */
.liq-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.3fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .liq-layout { grid-template-columns: 1fr; }
}

.liq-list-panel { padding: 22px; }
.liq-token-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 560px; overflow-y: auto;
  margin: 0 -6px; padding: 0 6px;
}
.liq-token {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 12px 14px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color var(--t-hover) var(--ease-out),
              background var(--t-hover) var(--ease-out),
              transform 120ms var(--ease-out);
}
.liq-token:hover { background: var(--s3); border-color: rgba(255,255,255,0.12); }
.liq-token.is-on {
  border-color: rgba(255,122,138,0.45);
  background: rgba(255,122,138,0.06);
  box-shadow: inset 0 0 0 1px rgba(255,122,138,0.18);
}
.liq-token.is-dead { opacity: 0.55; }
.liq-token-av {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #fff;
  flex-shrink: 0;
}
.liq-token-meta { flex: 1; min-width: 0; }
.liq-token-meta .n {
  font-weight: 600; font-size: 14.5px; color: var(--t);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.liq-token-meta .s { font-size: 12.5px; color: var(--t3); margin-top: 2px; }
.liq-token-liq { text-align: right; flex-shrink: 0; }
.liq-token-liq .v { font-weight: 600; font-size: 14px; color: var(--t); }
.liq-token-liq .v span { color: var(--t3); font-weight: 500; font-size: 12px; }
.liq-token-liq .k { font-size: 11.5px; color: var(--t3); margin-top: 2px; }

.liq-drain-panel {
  padding: 28px;
  border-color: rgba(255,122,138,0.18);
  background:
    radial-gradient(1200px 400px at 100% -10%, rgba(255,70,90,0.10), transparent 55%),
    var(--s1);
}
.liq-drain-panel.is-disabled { opacity: 0.5; pointer-events: none; }

.liq-warn-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: rgba(255,122,138,0.08);
  border: 1px solid rgba(255,122,138,0.22);
  border-radius: 12px;
  color: #ffb0ba;
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 22px;
}
.liq-warn-banner svg { flex-shrink: 0; margin-top: 2px; color: var(--neg); }

.liq-selected {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 24px;
}
.liq-sel-avatar {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px; color: #fff;
  background: var(--s4);
  flex-shrink: 0;
}
.liq-sel-meta { flex: 1; min-width: 0; }
.liq-sel-name { font-size: 17px; font-weight: 600; }
.liq-sel-sub { font-size: 12.5px; color: var(--t3); margin-top: 3px; }
.liq-sel-pool { text-align: right; }
.liq-sel-pool .lbl {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--t3); font-weight: 600;
}
.liq-sel-pool .val {
  font-size: 18px; font-weight: 700; color: var(--neg); margin-top: 2px;
}

.liq-section { margin-bottom: 22px; }
.liq-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 6px;
}
.liq-section-head h3 { font-size: 15px; font-weight: 600; }
.liq-pct-badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,122,138,0.12);
  color: var(--neg);
  font-size: 13px; font-weight: 700;
  min-width: 52px; justify-content: center;
  transition: background var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out);
}
.liq-pct-badge.is-rug {
  background: var(--neg); color: #1a0a0c;
  box-shadow: 0 0 18px rgba(255,70,90,0.35);
}
.liq-hint {
  font-size: 13.5px; color: var(--t3); margin: 0 0 16px; line-height: 1.45;
}

.liq-slider-wrap { padding: 4px 2px 0; }
.liq-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(255,122,138,0.25) 0%,
    rgba(255,122,138,0.55) 50%,
    var(--neg) 100%);
  outline: none; cursor: pointer;
  margin: 0;
}
.liq-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff;
  border: 3px solid var(--neg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35), 0 0 0 4px rgba(255,122,138,0.18);
  cursor: grab;
  transition: transform 120ms var(--ease-out);
}
.liq-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.08); }
.liq-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff;
  border: 3px solid var(--neg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  cursor: grab;
}
.liq-slider:disabled { opacity: 0.4; cursor: not-allowed; }

.liq-slider-marks {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.liq-slider-marks button {
  flex: 1; min-width: 64px;
  height: 34px; padding: 0 10px;
  border-radius: 10px;
  background: var(--s2);
  border: 1px solid var(--line);
  color: var(--t2);
  font-size: 12.5px; font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  transition: background var(--t-hover) var(--ease-out),
              border-color var(--t-hover) var(--ease-out),
              color var(--t-hover) var(--ease-out);
}
.liq-slider-marks button:hover { background: var(--s3); color: var(--t); }
.liq-slider-marks button.is-on {
  background: rgba(255,122,138,0.14);
  border-color: rgba(255,122,138,0.4);
  color: var(--neg);
}
.liq-slider-marks button.is-rug.is-on,
.liq-slider-marks button.is-rug:hover {
  background: var(--neg);
  border-color: transparent;
  color: #1a0a0c;
}

.liq-breakdown {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.liq-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0;
  font-size: 14px; color: var(--t2);
}
.liq-row .mono { color: var(--t); font-weight: 500; }
.liq-row.soft { color: var(--t3); font-size: 13px; }
.liq-row.soft .mono { color: var(--t3); font-weight: 400; }
.liq-row.total {
  margin-top: 6px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-weight: 600; color: var(--t); font-size: 15px;
}
.liq-row.total .mono {
  color: var(--neg); font-size: 18px; font-weight: 700;
}

.liq-drain-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px;
}
.liq-foot-note {
  margin: 14px 0 0;
  font-size: 12.5px; color: var(--t3); text-align: center; line-height: 1.45;
}

/* Confirm modal bits */
.liq-confirm-warn {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: rgba(255,122,138,0.08);
  border: 1px solid rgba(255,122,138,0.25);
  border-radius: 12px;
  color: #ffb0ba;
  font-size: 14px; line-height: 1.45;
  margin-bottom: 16px;
}
.liq-confirm-warn svg { color: var(--neg); flex-shrink: 0; margin-top: 1px; }
.liq-confirm-warn strong { color: var(--neg); }
.liq-confirm-card {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.liq-confirm-card .row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0; font-size: 14px; color: var(--t2);
}
.liq-confirm-card .row.soft { color: var(--t3); font-size: 13px; }
.liq-confirm-card .row.total {
  margin-top: 6px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-weight: 600; color: var(--t);
}
.liq-confirm-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; color: var(--t2); line-height: 1.45;
  cursor: pointer; user-select: none;
  padding: 4px 2px 8px;
}
.liq-confirm-check input {
  margin-top: 3px;
  width: 16px; height: 16px; accent-color: var(--neg); flex-shrink: 0;
  cursor: pointer;
}
