:root {
  color-scheme: dark;
  --rwi-fg: rgba(255, 255, 255, 0.92);
  --rwi-muted: rgba(255, 255, 255, 0.78);
  --rwi-panel: rgba(0, 0, 0, 0.55);
  --rwi-panel-strong: rgba(0, 0, 0, 0.78);
  --rwi-line: rgba(255, 255, 255, 0.12);
  --rwi-green: rgba(120, 255, 180, 0.85);
  --rwi-blue: #386bb7;
  --rwi-orange: #ff6b00;
  --rwi-info: #a0e1e1;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #101013;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  font-family: "Golos Text", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--rwi-fg);
  background: #101013;
}

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

.rwi-page {
  min-height: 100vh;
}

.rwi-hero {
  position: relative;
  min-height: 100vh;
  padding: 6rem 1rem;
  isolation: isolate;
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("../assets/images/bg-robbi-wallet-inspector.png");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

.rwi-shell {
  width: min(100%, 1200px);
  margin: 0 auto;
}

.rwi-wrap {
  width: 100%;
  margin: 0 auto;
}

.rwi-title {
  margin: 0 0 8rem;
  font-family: "Dela Gothic One", system-ui, sans-serif;
  font-size: clamp(2.2rem, 3.2vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.12;
  text-align: center;
}

.rwi-sub {
  max-width: 880px;
  margin: 0 auto 18px;
  color: var(--rwi-muted);
  text-align: center;
}

.rwi-panel {
  width: 100%;
  margin: 0 auto;
  padding: 14px;
  color: var(--rwi-fg);
  text-align: left;
  background: var(--rwi-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rwi-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  align-items: start;
}

.rwi-filter-stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

#rwi_token_slots {
  display: grid;
  max-height: min(72vh, 860px);
  padding-right: 4px;
  overflow: auto;
  scrollbar-color: rgba(120, 255, 180, 0.55) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.rwi-label {
  display: block;
  margin: 0 0 6px;
  color: var(--rwi-muted);
  font-size: 0.95rem;
}

.rwi-textarea,
.rwi-input,
.rwi-select {
  width: 100%;
  padding: 11px 12px;
  color: inherit;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  outline: none;
}

.rwi-textarea {
  min-height: 180px;
  resize: vertical;
}

.rwi-textarea:focus,
.rwi-input:focus,
.rwi-select:focus,
.rwi-dd-btn:focus {
  border-color: rgba(120, 255, 180, 0.45);
  box-shadow: 0 0 0 3px rgba(120, 255, 180, 0.14);
}

.rwi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 10px;
}

.btn {
  min-height: 42px;
  padding: 0.7rem 1.15rem;
  color: #fff;
  font-family: "Dela Gothic One", system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.btn-primary {
  background: var(--rwi-blue);
  border-color: var(--rwi-blue);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #5785cb;
  border-color: #5785cb;
}

.btn-secondary {
  background: var(--rwi-orange);
  border-color: var(--rwi-orange);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #ff8933;
  border-color: #ff8933;
}

.rwi-status {
  color: var(--rwi-muted);
}

.rwi-toast {
  display: none;
  padding: 8px 10px;
  color: var(--rwi-fg);
  font-size: 0.92rem;
  background: rgba(120, 255, 180, 0.12);
  border: 1px solid rgba(120, 255, 180, 0.25);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.rwi-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.rwi-note {
  margin-top: 8px;
  color: var(--rwi-muted);
  font-size: 0.95rem;
}

.rwi-privacy {
  opacity: 0.9;
}

.rwi-disclaimer {
  margin-top: 80px;
  opacity: 0.92;
}

.rwi-check {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.rwi-check input {
  width: 16px;
  height: 16px;
  accent-color: #78ffb4;
}

.rwi-token-slot {
  margin-bottom: 10px;
}

.rwi-token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 1fr);
  gap: 10px;
}

.rwi-dd {
  position: relative;
  width: 100%;
}

.rwi-dd-btn {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 12px;
  color: var(--rwi-fg);
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  outline: none;
}

.rwi-dd-ico {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}

.rwi-dd-txt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rwi-dd-caret {
  opacity: 0.8;
}

.rwi-dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 50;
  display: none;
  max-height: 260px;
  padding: 6px;
  overflow: auto;
  background: var(--rwi-panel-strong);
  border: 1px solid var(--rwi-line);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rwi-dd.open .rwi-dd-menu {
  display: block;
}

.rwi-dd-item {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  color: var(--rwi-fg);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.rwi-dd-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.rwi-dd-group {
  padding: 10px 10px 6px;
  color: rgba(120, 255, 180, 0.9);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.rwi-dd-search + .rwi-dd-group,
.rwi-dd-group:first-child {
  border-top: 0;
}

.rwi-dd-search {
  width: calc(100% - 12px);
  margin: 6px 6px 8px;
  padding: 10px;
  color: var(--rwi-fg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  outline: none;
}

.rwi-dd-item.is-hidden,
.rwi-dd-group.is-hidden {
  display: none;
}

.rwi-tablewrap {
  max-height: 60vh;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(120, 255, 180, 0.55) rgba(255, 255, 255, 0.08);
  scrollbar-gutter: stable both-edges;
  scrollbar-width: auto;
  -webkit-overflow-scrolling: touch;
}

.rwi-tablewrap::-webkit-scrollbar {
  width: 12px;
  height: 14px;
}

.rwi-tablewrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.rwi-tablewrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(120, 255, 180, 0.55), rgba(120, 255, 180, 0.35));
  border: 3px solid rgba(0, 0, 0, 0.35);
  border-radius: 999px;
}

.rwi-tablewrap::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(120, 255, 180, 0.75), rgba(120, 255, 180, 0.55));
}

.rwi-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

.rwi-table th,
.rwi-table td {
  padding: 10px 12px;
  color: var(--rwi-muted);
  font-size: 0.95rem;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rwi-table td {
  text-align: right;
}

.rwi-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--rwi-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rwi-table td:first-child,
.rwi-table th:first-child {
  text-align: left;
}

tr.rwi-match td {
  background: rgba(120, 255, 180, 0.16);
}

tr.rwi-match:hover td {
  background: rgba(120, 255, 180, 0.22);
}

tr.rwi-match td:first-child {
  box-shadow: inset 4px 0 0 var(--rwi-green);
}

.rwi-wallet-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.rwi-wallet-short {
  color: var(--rwi-fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
}

.rwi-copy-btn,
.rwi-scan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--rwi-fg);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

.rwi-copy-btn {
  position: relative;
  cursor: pointer;
}

.rwi-copy-btn:hover,
.rwi-scan-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(120, 255, 180, 0.45);
}

.rwi-copy-btn svg,
.rwi-scan-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.9;
}

.rwi-copy-pop {
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  z-index: 999;
  padding: 6px 10px;
  color: var(--rwi-fg);
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(120, 255, 180, 0.35);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 150ms ease, transform 150ms ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rwi-copy-pop.show {
  opacity: 1;
  transform: translateY(-50%) translateX(-2px);
}

.rwi-saved {
  position: relative;
}

.rwi-saved-btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.rwi-btn-saved {
  color: rgba(24, 97, 123, 0.88);
  background: rgb(21, 199, 190);
  border-color: rgba(28, 172, 198, 0.45);
}

.rwi-btn-saved:hover,
.rwi-btn-saved:focus {
  background: rgba(4, 167, 193, 0.85);
  border-color: rgba(18, 207, 204, 0.75);
}

.rwi-saved-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  display: none;
  width: min(420px, calc(100vw - 32px));
  min-width: 320px;
  padding: 10px;
  background: var(--rwi-panel-strong);
  border: 1px solid var(--rwi-line);
  border-radius: 14px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rwi-saved.open .rwi-saved-menu {
  display: block;
}

.rwi-saved-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rwi-saved-save {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 12px;
}

.rwi-saved-cap {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  opacity: 0.8;
}

.rwi-saved-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  padding-right: 4px;
  overflow: auto;
}

.rwi-saved-item {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.rwi-saved-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(120, 255, 180, 0.25);
}

.rwi-saved-copy {
  min-width: 0;
}

.rwi-saved-name {
  overflow: hidden;
  color: var(--rwi-fg);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rwi-saved-meta {
  font-size: 0.85rem;
  opacity: 0.75;
  white-space: nowrap;
}

.rwi-saved-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}

.rwi-saved-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 28px;
  padding: 0 8px;
  color: var(--rwi-fg);
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
}

.rwi-saved-ico:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(120, 255, 180, 0.35);
}

.rwi-saved-empty {
  padding: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  opacity: 0.85;
}

.rwi-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem max(1rem, calc((100vw - 1200px) / 2));
  color: #83fdff;
  background: #366ba1;
}

.rwi-footer a {
  color: var(--rwi-info);
  text-decoration: none;
}

.rwi-wrap ::placeholder {
  color: var(--rwi-muted);
  opacity: 0.55;
}

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

  .rwi-col-filters {
    padding-top: 1rem;
  }

  #rwi_token_slots {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 768px) {
  .rwi-hero {
    padding: 4rem 0.75rem;
    background-attachment: scroll;
  }

  .rwi-title {
    margin-bottom: 5rem;
  }

  .rwi-actions {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .rwi-token-row {
    grid-template-columns: 1fr;
  }

  .rwi-saved-menu {
    left: 50%;
    min-width: min(320px, calc(100vw - 32px));
    transform: translateX(-50%);
  }

  .rwi-footer {
    justify-content: center;
    text-align: center;
  }
}
