:root {
  --bg-top: #12071f;
  --bg-bottom: #090f1d;
  --panel: rgba(16, 12, 30, 0.82);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-main: #f7f5ff;
  --text-soft: #b9b0d3;
  --accent-green: #14f195;
  --accent-purple: #9945ff;
  --accent-blue: #00c2ff;
  --safe: #14f195;
  --risky: #f4b740;
  --danger: #ff6b81;
  --shadow: 0 24px 65px rgba(0, 0, 0, 0.35);
}

body.light-theme {
  --bg-top: #f6f2ff;
  --bg-bottom: #edf8ff;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-border: rgba(114, 73, 196, 0.12);
  --text-main: #191428;
  --text-soft: #685d82;
  --input-bg: rgba(103, 78, 155, 0.06);
  --input-border: rgba(103, 78, 155, 0.18);
  --secondary-bg: rgba(103, 78, 155, 0.08);
  --secondary-border: rgba(103, 78, 155, 0.18);
  --safe: #0ea96b;
  --risky: #ba7d0b;
  --danger: #cf4762;
  --shadow: 0 22px 48px rgba(92, 73, 150, 0.18);
}

:root {
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-border: rgba(255, 255, 255, 0.12);
  --secondary-bg: rgba(255, 255, 255, 0.06);
  --secondary-border: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(20, 241, 149, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(153, 69, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom center, rgba(0, 194, 255, 0.12), transparent 24%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
  transition: background 0.3s ease, color 0.3s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}

.app-shell {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 52px 20px 72px;
}

.hero-card,
.result-card,
.feature-teaser-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-card {
  text-align: center;
  padding: 34px 28px 32px;
}

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.28));
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(20, 241, 149, 0.14), rgba(153, 69, 255, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.eyebrow,
.card-label,
.metric-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--text-soft);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  margin-top: 14px;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1.02;
}

.subtitle {
  width: min(100%, 680px);
  margin: 18px auto 0;
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 1.04rem;
}

.hero-spotlight {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  width: min(100%, 760px);
  margin: 28px auto 0;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(20, 241, 149, 0.08), rgba(153, 69, 255, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-logo {
  width: 100%;
  max-width: 220px;
  justify-self: center;
  object-fit: contain;
  filter: drop-shadow(0 28px 32px rgba(0, 0, 0, 0.28));
}

.hero-copy {
  text-align: left;
}

.hero-copy-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.hero-copy-text {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.input-panel {
  margin-top: 30px;
}

.input-row,
.rpc-input-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

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

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

input {
  width: min(100%, 640px);
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--input-bg);
  color: var(--text-main);
  border: 1px solid var(--input-border);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

select,
textarea {
  background: var(--input-bg);
  color: var(--text-main);
  border: 1px solid var(--input-border);
}

input::placeholder {
  color: var(--text-soft);
}

input:focus {
  border-color: rgba(20, 241, 149, 0.75);
  box-shadow: 0 0 0 4px rgba(20, 241, 149, 0.14);
  transform: translateY(-1px);
}

button {
  padding: 18px 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-purple));
  color: #140d23;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease, background 0.25s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(115, 67, 209, 0.22);
  filter: brightness(1.03);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.secondary-button,
.theme-toggle {
  background: var(--secondary-bg);
  color: var(--text-main);
  border: 1px solid var(--secondary-border);
}

.secondary-button:hover,
.theme-toggle:hover {
  background: rgba(153, 69, 255, 0.1);
  box-shadow: none;
}

.feedback-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--text-soft);
}

.result-section {
  margin-top: 28px;
}

.feature-teaser-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding: 26px 28px;
}

.feature-teaser-copy h2 {
  margin-top: 8px;
}

.feature-teaser-copy p:last-child {
  margin: 12px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
  max-width: 760px;
}

.feature-teaser-badge {
  min-width: 220px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(20, 241, 149, 0.12), rgba(0, 194, 255, 0.12));
  border: 1px solid rgba(20, 241, 149, 0.18);
  text-align: left;
}

.feature-teaser-badge span {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.feature-teaser-badge strong {
  display: block;
  margin-top: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
}

.hidden {
  display: none;
}

.result-section.is-visible {
  display: block;
}

.result-card {
  padding: 28px;
  animation: slideUp 0.4s ease;
}

.result-header,
.score-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-header {
  margin-bottom: 22px;
}

.status-badge {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(20, 241, 149, 0.14);
  border: 1px solid rgba(20, 241, 149, 0.36);
  color: #9ff5ca;
}

.status-safe {
  background: rgba(20, 241, 149, 0.14);
  border-color: rgba(20, 241, 149, 0.36);
  color: #9ff5ca;
}

.status-risky {
  background: rgba(244, 183, 64, 0.14);
  border-color: rgba(244, 183, 64, 0.38);
  color: #ffd98d;
}

.status-high-risk {
  background: rgba(255, 107, 129, 0.14);
  border-color: rgba(255, 107, 129, 0.38);
  color: #ffb1c0;
}

.metrics-grid,
.details-grid,
.signal-grid {
  display: grid;
  gap: 16px;
}

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

.metric-box,
.detail-panel,
.score-panel,
.report-panel {
  border-radius: 22px;
  padding: 20px;
  background: var(--secondary-bg);
  border: 1px solid var(--secondary-border);
}

.metric-value,
.wallet-text {
  margin: 12px 0 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.wallet-text {
  font-size: 0.98rem;
  line-height: 1.7;
  word-break: break-all;
}

.score-panel {
  margin-top: 18px;
}

.report-panel {
  margin-top: 18px;
}

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

.report-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.report-headline {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.report-methodology {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 0.95rem;
}

.report-output {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border-radius: 18px;
  padding: 18px;
  background: rgba(8, 10, 20, 0.3);
  border: 1px solid var(--secondary-border);
  color: var(--text-main);
  font: inherit;
  line-height: 1.7;
}

.report-output:focus {
  outline: none;
  border-color: rgba(20, 241, 149, 0.4);
}

.review-controls {
  display: grid;
  gap: 12px;
}

.review-select,
.review-note-input {
  width: 100%;
  border-radius: 16px;
  padding: 14px 16px;
}

.review-note-input {
  min-height: 120px;
  resize: vertical;
}

.signal-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.score-status-text {
  font-size: 0.95rem;
  font-weight: 700;
}

.score-track {
  height: 14px;
  margin-top: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.score-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--danger), var(--risky), var(--accent-green));
  transition: width 0.4s ease;
}

.details-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.history-grid {
  margin-top: 18px;
}

.detail-panel h3 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.signal-value {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.signal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.signal-badge-safe {
  color: #9ff5ca;
  background: rgba(20, 241, 149, 0.14);
  border-color: rgba(20, 241, 149, 0.34);
}

.signal-badge-warning {
  color: #ffd98d;
  background: rgba(244, 183, 64, 0.14);
  border-color: rgba(244, 183, 64, 0.35);
}

.signal-badge-danger {
  color: #ffb1c0;
  background: rgba(255, 107, 129, 0.14);
  border-color: rgba(255, 107, 129, 0.35);
}

.signal-note {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.info-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.7;
}

.info-list li + li {
  margin-top: 8px;
}

.tx-link {
  color: var(--accent-blue);
  text-decoration: none;
}

.tx-link:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@media (max-width: 760px) {
  .app-shell {
    padding: 28px 16px 48px;
  }

  .hero-card,
  .result-card,
  .feature-teaser-card {
    border-radius: 22px;
  }

  .hero-card,
  .result-card,
  .feature-teaser-card,
  .metric-box,
  .detail-panel,
  .score-panel {
    padding: 20px;
  }

  .topbar,
  .input-row,
  .result-header,
  .score-panel-header,
  .report-header {
    flex-direction: column;
    align-items: stretch;
  }

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

  .feature-teaser-card {
    flex-direction: column;
    align-items: stretch;
  }

  .feature-teaser-badge {
    min-width: 0;
  }

  .hero-spotlight {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy {
    text-align: center;
  }

  button,
  .rpc-input-row input {
    width: 100%;
  }
}
