:root {
    --bg-main: #020816;
    --bg-panel: rgba(6, 16, 40, 0.9);
    --bg-panel-soft: rgba(8, 20, 54, 0.9);
    --border-soft: rgba(112, 181, 255, 0.15);
    --border-strong: rgba(112, 181, 255, 0.5);
    --text-primary: #f5f7ff;
    --text-secondary: #a9b7d8;
    --accent-blue: #46b8ff;
    --accent-cyan: #4de5c3;
    --accent-warning: #ffc857;
    --accent-danger: #ff5b7a;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-soft: 0 24px 70px rgba(0, 0, 0, 0.65);
    --shadow-glow: 0 0 40px rgba(70, 184, 255, 0.35);
  }

  * {
    box-sizing: border-box;
  }

  body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    padding: 32px 18px 28px;
    background:
      radial-gradient(circle at 10% 0%, rgba(63, 178, 255, 0.16) 0, transparent 55%),
      radial-gradient(circle at 90% 100%, rgba(255, 91, 122, 0.16) 0, transparent 55%),
      radial-gradient(circle at 50% 20%, rgba(77, 229, 195, 0.08) 0, transparent 60%),
      var(--bg-main);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(120deg, rgba(70, 184, 255, 0.12), transparent 40%, transparent 60%, rgba(255, 91, 122, 0.12));
    mix-blend-mode: screen;
    opacity: 0.4;
  }

  .app-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
  }

  .app-header {
    margin-bottom: 22px;
    padding: 18px 18px 16px;
    border-radius: 999px;
    background: radial-gradient(circle at 0 0, rgba(77, 229, 195, 0.16), transparent 55%),
      radial-gradient(circle at 100% 100%, rgba(70, 184, 255, 0.18), transparent 52%),
      rgba(2, 12, 38, 0.92);
    border: 1px solid rgba(146, 201, 255, 0.32);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  }

  .app-header-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background:
      radial-gradient(circle at 30% 20%, #ffffff 0, #b3fffd 18%, transparent 52%),
      radial-gradient(circle at 70% 80%, #72bdff 0, transparent 60%);
    box-shadow: 0 0 24px rgba(109, 209, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
  }

  .app-header-main {
    flex: 1;
    min-width: 0;
  }

  .app-title {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0.04em;
    font-weight: 700;
    text-transform: uppercase;
  }

  .app-subtitle {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
  }

  .app-badge {
    padding: 6px 11px;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(70, 184, 255, 0.22), rgba(77, 229, 195, 0.22));
    border: 1px solid rgba(157, 221, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #02101c;
    box-shadow: 0 0 22px rgba(77, 229, 195, 0.55);
  }

  @media screen and (min-width: 720px) {
    body {
      padding: 40px 32px 32px;
    }

    .app-header {
      padding-inline: 22px;
      gap: 16px;
    }

    .app-title {
      font-size: 22px;
    }

    .app-subtitle {
      font-size: 13px;
    }
  }

  /* Generic card */

  .card {
    position: relative;
    background: radial-gradient(circle at 0 0, rgba(70, 184, 255, 0.12), transparent 55%),
      radial-gradient(circle at 100% 100%, rgba(255, 91, 122, 0.08), transparent 60%),
      var(--bg-panel);
    padding: 18px 18px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
  }

  .card::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.02);
    pointer-events: none;
  }

  .card h1,
  .card h2 {
    margin: 0 0 6px 0;
    font-size: 16px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    color: #e8f3ff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .card h1::before,
  .card h2::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #ffffff 0, #5af0c2 32%, #46b8ff 100%);
    box-shadow: 0 0 14px rgba(90, 240, 194, 0.9);
  }

  .card h1 {
    font-size: 17px;
  }

  .card-header-note {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 6px;
  }

  .card-caption {
    margin-top: 4px;
    color: #7f92b8;
    font-size: 12px;
  }

  code#contractAddr {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(6, 20, 60, 0.9);
    border: 1px solid rgba(146, 201, 255, 0.25);
    font-size: 11px;
    color: #b9d6ff;
    word-break: break-all;
  }

  /* Layout helpers */

  .row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
  }

  .col {
    flex: 1;
    min-width: 0;
  }

  /* Inputs & labels */

  label {
    display: block;
    margin-top: 10px;
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  input,
  select,
  button {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(142, 188, 255, 0.3);
    background: radial-gradient(circle at 0 0, rgba(70, 184, 255, 0.12), transparent 55%),
      rgba(7, 16, 40, 0.96);
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-size: 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.12s ease;
  }

  input::placeholder {
    color: rgba(158, 183, 224, 0.55);
  }

  input:focus-visible,
  select:focus-visible {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px rgba(70, 184, 255, 0.65), 0 0 18px rgba(70, 184, 255, 0.45);
    background: rgba(8, 24, 72, 0.96);
  }

  /* Primary actions */

  button.btn {
    cursor: pointer;
    border: none;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 12px;
    color: #020816;
    background:
      linear-gradient(120deg, #4de5c3, #46b8ff, #9b7bff);
    background-size: 220% 220%;
    box-shadow: 0 14px 32px rgba(24, 177, 255, 0.45);
    position: relative;
    overflow: hidden;
  }

  button.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.4), transparent 50%, transparent);
    opacity: 0;
    transform: translateX(-40%);
    transition: opacity 0.18s ease, transform 0.35s ease;
    pointer-events: none;
  }

  button.btn:hover::before {
    opacity: 1;
    transform: translateX(40%);
  }

  button.btn:hover {
    transform: translateY(-1px);
    background-position: 100% 0;
    box-shadow: 0 20px 40px rgba(24, 177, 255, 0.6);
  }

  button.btn:active {
    transform: translateY(0);
    box-shadow: 0 10px 26px rgba(24, 177, 255, 0.45);
  }

  button.btn:disabled {
    opacity: 0.55;
    cursor: default;
    box-shadow: none;
  }

  /* Status & result blocks */

  .status {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
  }

  .status::before {
    content: "∙ ";
    color: var(--accent-blue);
  }

  .result {
    margin-top: 14px;
    padding: 12px 12px 10px;
    border-radius: var(--radius-md);
    background: radial-gradient(circle at 0 0, rgba(77, 229, 195, 0.1), transparent 55%),
      rgba(3, 14, 38, 0.96);
    border: 1px solid rgba(132, 214, 255, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    font-size: 13px;
  }

  pre {
    background: rgba(3, 10, 34, 0.96);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(91, 143, 228, 0.35);
    overflow: auto;
    font-size: 12px;
    color: #d6e2ff;
  }

  /* Zones ribbon hint (visual context for health metric) */

  .zone-ribbon {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr 0.9fr;
    gap: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
  }

  .zone-pill {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(120deg, rgba(77, 229, 195, 0.26), transparent);
    color: #06161a;
  }

  .zone-pill span.label {
    font-weight: 600;
  }

  .zone-pill span.range {
    opacity: 0.85;
  }

  .zone-pill.warning {
    background: linear-gradient(120deg, rgba(255, 200, 87, 0.32), transparent);
    color: #221608;
  }

  .zone-pill.danger {
    background: linear-gradient(120deg, rgba(255, 91, 122, 0.36), transparent);
    color: #28010b;
  }

  /* Footer */

  footer {
    margin-top: 20px;
    color: #8395be;
    font-size: 11px;
    text-align: center;
  }

  footer span.tag {
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(132, 214, 255, 0.45);
    background: rgba(3, 14, 38, 0.92);
    margin-left: 6px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  @media screen and (min-width: 880px) {
    .card {
      padding: 20px 22px 18px;
    }

    .zone-ribbon {
      font-size: 11px;
    }
  }