:root {
  color-scheme: dark;
  --bg: #070910;
  --surface: rgb(13 18 29 / 86%);
  --surface-2: rgb(255 255 255 / 7%);
  --surface-3: rgb(255 255 255 / 11%);
  --text: #f8fafc;
  --soft-text: #d8e0eb;
  --muted: #8995a8;
  --line: rgb(255 255 255 / 11%);
  --line-strong: rgb(255 255 255 / 20%);
  --accent: #68f7d4;
  --gold: #f7c56b;
  --danger: #ff8a8a;
  --focus: #9ecbff;
  --shadow: 0 18px 54px rgb(0 0 0 / 42%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -9rem, rgb(104 247 212 / 24%), transparent 25rem),
    radial-gradient(circle at 85% 8rem, rgb(247 197 107 / 12%), transparent 18rem),
    linear-gradient(180deg, #121826 0%, #080b13 44%, #05070b 100%);
}

body {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 4%), transparent 18rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
}

.mobile-only-notice {
  display: none;
}

@media (min-width: 601px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
  }

  body > *:not(.mobile-only-notice) {
    display: none;
  }

  .mobile-only-notice {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    color: var(--soft-text);
    font-size: 16px;
    font-weight: 820;
    text-align: center;
  }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgb(255 255 255 / 2.8%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 2.8%) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 64%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 11px 8px;
  background: linear-gradient(180deg, rgb(7 9 16 / 96%), rgb(7 9 16 / 74%));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.top-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.icon-btn,
.close-btn {
  display: grid;
  place-items: center;
  width: 29px;
  min-width: 29px;
  height: 29px;
  min-height: 29px;
  padding: 0;
}

.icon-btn {
  gap: 3px;
}

.icon-btn span {
  display: block;
  width: 13px;
  height: 1px;
  background: currentColor;
}

.close-btn {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.menu {
  position: fixed;
  top: 52px;
  right: max(8px, calc((100vw - 430px) / 2 + 8px));
  z-index: 20;
  width: min(210px, calc(100vw - 16px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgb(13 18 29 / 97%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  animation: menuIn 160ms ease both;
}

.menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line);
}

.menu-nav {
  display: grid;
  gap: 5px;
  padding-top: 8px;
}

.menu-link {
  width: 100%;
  text-align: left;
}

.menu-link.active {
  border-color: rgb(104 247 212 / 58%);
  background: rgb(104 247 212 / 12%);
  color: var(--accent);
}

.view-section {
  display: none;
}

main[data-view="activity"] .view-section[data-view="activity"],
main[data-view="logs"] .view-section[data-view="logs"],
main[data-view="settings"] .view-section[data-view="settings"],
main[data-view="wallets"] .view-section[data-view="wallets"] {
  display: block;
}

.hero.view-section {
  display: none;
}

main[data-view="home"] .hero.view-section {
  display: grid;
}

main[data-view="home"] .live-panel.view-section {
  display: block;
}

main[data-view="wallets"] .split {
  display: grid;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border: 1px solid rgb(104 247 212 / 52%);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgb(104 247 212 / 28%), rgb(247 197 107 / 15%)),
    rgb(255 255 255 / 7%);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 24px rgb(104 247 212 / 13%);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 16px;
  line-height: 1.05;
  font-weight: 850;
}

h2 {
  font-size: 13px;
  line-height: 1.15;
  font-weight: 820;
}

.eyebrow {
  color: var(--accent);
  font-size: 9px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 9px 8px 34px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  min-height: 92px;
  margin-bottom: 9px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(138deg, rgb(104 247 212 / 19%), transparent 46%),
    linear-gradient(315deg, rgb(247 197 107 / 13%), transparent 45%),
    linear-gradient(180deg, rgb(255 255 255 / 12%), rgb(255 255 255 / 5%));
  box-shadow: var(--shadow);
  animation: floatIn 520ms ease both;
}

.hero h2 {
  max-width: 292px;
  margin-top: 4px;
  font-size: 19px;
  line-height: 1.04;
  font-weight: 900;
}

.hero-message {
  max-width: 292px;
  margin-top: 6px;
  color: var(--soft-text);
  font-size: 11px;
  line-height: 1.35;
}

.status-pill {
  align-self: start;
  padding: 5px 7px;
  border: 1px solid rgb(104 247 212 / 48%);
  border-radius: 999px;
  background: rgb(104 247 212 / 12%);
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.status-pill.live {
  border-color: rgb(247 197 107 / 58%);
  background: rgb(247 197 107 / 13%);
  color: var(--gold);
}

.panel {
  width: 100%;
  margin-bottom: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 4%)),
    var(--surface);
  box-shadow: 0 12px 34px rgb(0 0 0 / 20%);
  backdrop-filter: blur(18px);
}

.panel.entering {
  animation: riseIn 360ms ease both;
  animation-delay: var(--stagger, 0ms);
}

.panel-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.live-panel {
  padding-bottom: 9px;
}

.session-actions {
  display: flex;
  gap: 7px;
  margin-bottom: 8px;
}

.session-actions button {
  flex: 1;
}

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

.live-card {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(3 7 18 / 30%);
}

.live-card small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
}

.live-card strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.latest-event {
  margin-top: 8px;
  padding: 8px;
  border-left: 2px solid var(--accent);
  background: rgb(104 247 212 / 6%);
  color: var(--soft-text);
  font-size: 10px;
  line-height: 1.35;
}

.live-updates {
  display: grid;
  gap: 4px;
  max-height: 230px;
  margin-top: 8px;
  overflow: auto;
}

.live-update {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgb(3 7 18 / 30%);
  color: var(--soft-text);
  font-family: inherit;
  font-size: 10px;
  line-height: 1.3;
}

.live-update time {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
}

.tabs {
  position: sticky;
  top: 48px;
  z-index: 9;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 -8px 9px;
  padding: 7px 8px;
  background: linear-gradient(180deg, rgb(7 9 16 / 94%), rgb(7 9 16 / 74%));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

button,
.tab {
  width: auto;
  min-height: 29px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--soft-text);
  font-size: 10.5px;
  font-weight: 820;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

button:hover,
button:focus-visible {
  border-color: rgb(104 247 212 / 58%);
  color: var(--accent);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0) scale(0.98);
}

.tab {
  width: 100%;
}

.tab.active {
  border-color: rgb(104 247 212 / 58%);
  background: linear-gradient(135deg, rgb(104 247 212 / 20%), rgb(255 255 255 / 6%));
  color: var(--accent);
}

.ghost-btn {
  min-width: 58px;
}

.primary-btn {
  justify-self: end;
  min-width: 62px;
  border-color: rgb(104 247 212 / 44%);
  background: linear-gradient(135deg, rgb(104 247 212 / 21%), rgb(104 247 212 / 7%));
  color: #defcf6;
}

button.danger {
  min-width: 46px;
  min-height: 27px;
  padding: 0 7px;
  border-color: rgb(255 138 138 / 34%);
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  transform: none;
}

button.pulse {
  animation: buttonPulse 360ms ease;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.activity-panel {
  padding-bottom: 9px;
}

.activity-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 9px;
}

.activity-stats div {
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(3 7 18 / 30%);
}

.activity-stats span {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.activity-stats small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
}

.activity-list {
  display: grid;
  gap: 7px;
}

.bot-log-list {
  display: grid;
  gap: 6px;
}

.log-line {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(104 247 212 / 6%), transparent 42%),
    rgb(2 6 14 / 52%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%);
}

.log-line.warn {
  border-color: rgb(247 197 107 / 28%);
}

.log-line.error {
  border-color: rgb(255 138 138 / 30%);
}

.log-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.log-level {
  min-width: 34px;
  padding: 3px 5px;
  border: 1px solid rgb(104 247 212 / 28%);
  border-radius: 999px;
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.log-line.warn .log-level {
  border-color: rgb(247 197 107 / 34%);
  color: var(--gold);
}

.log-line.error .log-level {
  border-color: rgb(255 138 138 / 36%);
  color: var(--danger);
}

.log-top time {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 9px;
}

.log-line pre {
  max-height: 92px;
  margin: 0;
  overflow: auto;
  color: var(--soft-text);
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 9.8px;
  line-height: 1.36;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.activity-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 8px;
  min-height: 68px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 6%), transparent),
    rgb(3 7 18 / 30%);
}

.activity-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 99px;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgb(137 149 168 / 10%);
}

.activity-item.success .activity-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(104 247 212 / 12%);
}

.activity-item.warning .activity-dot {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgb(247 197 107 / 12%);
}

.activity-item.error .activity-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgb(255 138 138 / 12%);
}

.activity-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.activity-meta {
  margin-top: 3px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 9.5px;
}

.activity-message {
  margin-top: 5px;
  color: var(--soft-text);
  font-size: 10.5px;
  line-height: 1.3;
}

.activity-money {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 7px;
}

.activity-money strong,
.activity-money span,
.activity-money a {
  min-height: 23px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--soft-text);
  font-size: 9.5px;
  font-weight: 820;
  text-decoration: none;
}

.activity-money strong {
  border-color: rgb(104 247 212 / 34%);
  color: var(--accent);
}

.micro-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(3 7 18 / 28%);
}

.micro-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
}

.micro-field input,
.micro-field select {
  width: 92px;
  min-height: 28px;
  padding: 4px 8px;
  text-align: right;
}

.settings-panel .primary-btn {
  min-width: 56px;
  min-height: 28px;
}

.form-grid,
.split,
.inline-form,
.inline-form.two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.split.view-section {
  display: none;
}

main[data-view="wallets"] .split.view-section {
  display: grid;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
}

input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  background: rgb(3 7 18 / 45%);
  color: var(--text);
  font-size: 12px;
}

input::placeholder {
  color: rgb(137 149 168 / 68%);
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.list {
  display: grid;
  gap: 6px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 49px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(3 7 18 / 29%);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.row:hover {
  border-color: rgb(104 247 212 / 24%);
  background: rgb(255 255 255 / 7%);
  transform: translateY(-1px);
}

.row-title {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.row-sub {
  margin-top: 3px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 10px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.muted,
#counts {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.empty-state {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgb(3 7 18 / 22%);
  font-size: 11px;
  text-align: center;
}

.pagination {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.pagination button {
  min-width: 52px;
  min-height: 27px;
}

#tokenPageInfo,
#activityPageInfo,
#logsPageInfo {
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  text-align: center;
}

.toast {
  position: fixed;
  right: max(9px, calc((100vw - 430px) / 2 + 9px));
  bottom: 10px;
  left: max(9px, calc((100vw - 430px) / 2 + 9px));
  z-index: 20;
  max-width: 412px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgb(8 11 18 / 92%);
  color: white;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  font-size: 11px;
}

.toast.error {
  border-color: rgb(255 138 138 / 40%);
  background: rgb(80 18 26 / 94%);
}

.login-body {
  display: grid;
  align-items: center;
}

.login-shell {
  padding-top: 18px;
}

.login-hero {
  min-height: 118px;
}

.login-hero h2 {
  font-size: 28px;
}

.login-panel h1 {
  font-size: 15px;
}

.login-form {
  display: grid;
  gap: 9px;
}

.login-button {
  justify-self: stretch;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes buttonPulse {
  0% {
    box-shadow: 0 0 0 0 rgb(104 247 212 / 28%);
  }

  100% {
    box-shadow: 0 0 0 12px rgb(104 247 212 / 0%);
  }
}
