:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.planet-background {
  position: relative;
}

.planet-background::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--planet-bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}

.planet-background > * {
  position: relative;
  z-index: 1;
}

button,
input,
select,
textarea {
  font: inherit;
}

.nav-tab {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.8);
  color: rgb(226, 232, 240);
  padding: 0.75rem 1rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: 160ms ease;
}

.nav-tab:hover {
  border-color: rgba(34, 211, 238, 0.45);
  color: rgb(103, 232, 249);
}

.nav-tab.is-active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.24), rgba(16, 185, 129, 0.18));
  border-color: rgba(34, 211, 238, 0.45);
  color: white;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.15) inset;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(15, 23, 42, 0.82);
  border-radius: 1.5rem;
  padding: 1.25rem;
  backdrop-filter: blur(14px);
}

.panel-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 700;
  color: white;
}

.panel-subtitle {
  margin: 0;
  color: rgb(148, 163, 184);
  font-size: 0.92rem;
}

.metric-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1.25rem;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.55);
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgb(148, 163, 184);
}

.metric-value {
  margin-top: 0.6rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
}

.data-grid {
  display: grid;
  gap: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-info {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.3);
  color: rgb(103, 232, 249);
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: rgb(110, 231, 183);
}

.badge-warning {
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.35);
  color: rgb(253, 224, 71);
}

.badge-danger {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
  color: rgb(253, 164, 175);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.8rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(15, 23, 42, 0.85);
  color: rgb(148, 163, 184);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

td {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgb(226, 232, 240);
}

.mini-button {
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.75);
  color: white;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: 150ms ease;
}

.mini-button:hover {
  border-color: rgba(34, 211, 238, 0.45);
  color: rgb(103, 232, 249);
}

.mini-button.primary {
  background: rgb(34, 211, 238);
  border-color: rgba(34, 211, 238, 0.4);
  color: rgb(8, 15, 28);
}

.mini-button.primary:hover {
  color: rgb(8, 15, 28);
  filter: brightness(1.06);
}

.mini-button.success {
  background: rgb(16, 185, 129);
  border-color: rgba(16, 185, 129, 0.4);
  color: rgb(3, 10, 8);
}

.mini-button.danger {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.35);
  color: rgb(253, 164, 175);
}

.mini-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.asset-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.form-select,
.form-input {
  width: 100%;
  border-radius: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.7);
  color: white;
  padding: 0.7rem 0.85rem;
  outline: none;
}

.form-select:focus,
.form-input:focus {
  border-color: rgba(34, 211, 238, 0.5);
}

.helper {
  color: rgb(148, 163, 184);
  font-size: 0.86rem;
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  overflow: hidden;
  width: 100%;
  height: 0.6rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgb(34, 211, 238), rgb(16, 185, 129));
}

.mobile-modal-shell {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.mobile-modal-card {
  max-height: calc(100vh - 1.5rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.mobile-modal-header {
  position: sticky;
  top: -1.5rem;
  z-index: 10;
  background: rgba(20, 24, 35, 0.96);
  backdrop-filter: blur(10px);
}

.mobile-modal-footer {
  position: sticky;
  bottom: -1.5rem;
  z-index: 10;
  background: linear-gradient(to top, rgba(15, 22, 37, 0.98), rgba(15, 22, 37, 0.88));
  padding-top: 0.75rem;
}

.touch-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.rpc-menu-panel {
  max-width: min(22rem, calc(100vw - 1rem));
}

@media (max-width: 768px) {
  .panel {
    padding: 1rem;
  }

  .mobile-modal-card {
    max-height: calc(100vh - 1rem);
    border-radius: 1.25rem;
    padding: 1rem;
  }

  .mobile-modal-header {
    top: -1rem;
  }

  .mobile-modal-footer {
    bottom: -1rem;
  }

  #rpc-menu.rpc-menu-panel {
    position: fixed !important;
    top: 4.5rem !important;
    left: 0.5rem !important;
    right: 0.5rem !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    margin-top: 0 !important;
    max-height: calc(100vh - 5.5rem) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}
