body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: radial-gradient(circle at top, #f0ebff 0, #f4f4f9 40%, #f4f4f9 100%);
            color: #333;
            display: flex;
            justify-content: center;
            padding: 40px 16px;
            margin: 0;
            min-height: 100vh;
            transition: background 0.2s ease, color 0.2s ease;
        }

        /* Wrapper to apply blur effect */
        .main-wrapper {
            position: relative;
            z-index: 1;
            transition: filter 0.3s ease;
        }

        .main-wrapper.blurred {
            filter: blur(8px);
            pointer-events: none;
            user-select: none;
        }

        .container {
            background: white;
            padding: 2.2rem 2.4rem;
            border-radius: 16px;
            box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
            width: 780px;
            max-width: 100%;
            box-sizing: border-box;
            position: relative;
            border: 1px solid #e5e7eb;
            transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
        }
        .header {
            margin-bottom: 1.4rem;
            border-bottom: 1px solid #f1f3f6;
            padding-bottom: 1.1rem;
        }
        .badge-top {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #5a2d82;
            background: #f3ecff;
            padding: 4px 9px;
            border-radius: 999px;
            font-weight: 600;
        }
        h1 {
            margin: 10px 0 4px;
            font-size: 1.7rem;
            color: #1e1b4b;
            display: flex;
            align-items: center;
            gap: 8px;
            word-break: break-word;
        }
        .subtitle {
            color: #6b7280;
            margin-bottom: 4px;
            font-size: 0.96rem;
        }
        .subtitle-ru {
            color: #4b5563;
            font-size: 0.9rem;
        }
        .info-banner {
            margin-top: 14px;
            padding: 10px 12px;
            background: #f9fafb;
            border-radius: 10px;
            border: 1px solid #e5e7eb;
            font-size: 0.84rem;
            color: #4b5563;
            display: flex;
            gap: 10px;
            align-items: flex-start;
        }
        .info-banner-icon {
            font-size: 1rem;
            margin-top: 1px;
        }
        .form-section {
            margin-top: 1.4rem;
        }
        .form-group {
            margin-bottom: 15px;
        }
        label {
            display: block;
            margin-bottom: 6px;
            font-weight: 600;
            font-size: 0.88rem;
            color: #374151;
        }
        input,
        select {
            width: 100%;
            padding: 9px 10px;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            box-sizing: border-box;
            font-size: 0.95rem;
            background: #fff;
            transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
        }
        input:focus,
        select:focus {
            outline: none;
            border-color: #5a2d82;
            box-shadow: 0 0 0 2px rgba(90, 45, 130, 0.12);
        }
        .row {
            display: flex;
            gap: 15px;
        }
        .col {
            flex: 1;
        }
        .btn-row {
            display: flex;
            gap: 10px;
            margin-top: 8px;
        }
        .btn {
            flex: 1;
            padding: 11px 14px;
            border-radius: 999px;
            border: none;
            cursor: pointer;
            font-size: 0.95rem;
            font-weight: 600;
            transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        .btn-primary {
            background-color: #4b1f6f;
            color: white;
            box-shadow: 0 6px 14px rgba(36, 12, 58, 0.45);
        }
        .btn-primary:hover {
            background-color: #3b1758;
            box-shadow: 0 8px 18px rgba(20, 8, 36, 0.6);
            transform: translateY(-1px);
        }
        .btn-secondary {
            background-color: #f3f4f6;
            color: #374151;
            box-shadow: 0 4px 8px rgba(148, 163, 184, 0.25);
        }
        .btn-secondary:hover:not(:disabled) {
            background-color: #e5e7eb;
            transform: translateY(-1px);
        }
        .btn:disabled {
            background-color: #e5e7eb;
            color: #9ca3af;
            cursor: not-allowed;
            box-shadow: none;
            transform: none;
        }
        .info-utc {
            font-size: 0.8rem;
            color: #6b7280;
            margin-top: 4px;
            text-align: right;
        }
        .hint-text {
            font-size: 0.78rem;
            color: #9ca3af;
            margin-top: 2px;
        }
        /* Results Table */
        #results-area {
            margin-top: 25px;
            display: none;
            border-top: 1px solid #e5e7eb;
            padding-top: 15px;
        }
        .results-header {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            gap: 12px;
        }
        .results-title {
            margin-bottom: 4px;
            font-size: 1rem;
            font-weight: 600;
            color: #111827;
        }
        .results-sub {
            font-size: 0.8rem;
            color: #6b7280;
        }
        .table-wrapper {
            width: 100%;
            overflow-x: auto;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 12px;
            min-width: 480px;
        }
        th,
        td {
            padding: 11px 12px;
            text-align: left;
            border-bottom: 1px solid #f3f4f6;
            font-size: 0.9rem;
            vertical-align: middle;
        }
        th {
            background-color: #f9fafb;
            color: #4b5563;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.75rem;
            letter-spacing: 0.06em;
        }
        .amount-col {
            text-align: right;
            font-family: 'Consolas', monospace;
            font-weight: 600;
            color: #111827;
        }
        .loader {
            text-align: center;
            margin-top: 16px;
            display: none;
            color: #6b7280;
            font-size: 0.86rem;
        }
        .badge {
            background: #eef2f5;
            padding: 4px 8px;
            border-radius: 999px;
            font-size: 0.75em;
            color: #5a6b7c;
            font-weight: 600;
            text-transform: uppercase;
            white-space: nowrap;
        }
        .sub-text {
            display: block;
            font-size: 0.75rem;
            color: #9ca3af;
            margin-top: 2px;
            font-weight: normal;
        }
        /* Liquid XPR */
        .row-xpr {
            background-color: #fcfaff;
            border-left: 3px solid #5a2d82;
        }
        .row-xpr .amount-col {
            color: #5a2d82;
            font-size: 1.02em;
        }
        /* Liquid Other */
        .row-liquid {
            border-left: 3px solid transparent;
        }
        /* Lending Highlight */
        .row-lending {
            background-color: #fff9e6;
            border-left: 3px solid #f59e0b;
        }
        .badge-lending {
            background-color: #f59e0b;
            color: white;
            margin-right: 6px;
        }
        /* Staked XPR */
        .row-staked {
            background-color: #fdfbff;
            border-left: 3px solid #9b59b6;
        }
        .row-staked .amount-col {
            color: #8e44ad;
        }
        .badge-staked {
            background-color: #9b59b6;
            color: white;
            margin-right: 6px;
        }
        .footer-credits {
            margin-top: 35px;
            padding-top: 18px;
            border-top: 1px solid #e5e7eb;
            text-align: center;
            color: #6b7280;
            font-size: 0.85rem;
        }
        .footer-logos {
            display: flex;
            justify-content: center;
            gap: 14px;
            margin-bottom: 10px;
        }
        .footer-logo {
            width: 52px;
            height: 52px;
            border-radius: 50%;
            object-fit: cover;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
        }
        .footer-text {
            font-weight: 500;
            color: #4b5563;
        }
        .vote-btn {
            display: inline-block;
            margin-top: 12px;
            padding: 10px 18px;
            background: #4b1f6f;
            color: white;
            font-weight: 600;
            border-radius: 999px;
            text-decoration: none;
            font-size: 0.92rem;
            box-shadow: 0 6px 14px rgba(36, 12, 58, 0.45);
            transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
        }
        .vote-btn:hover {
            background: #3b1758;
            transform: translateY(-1px);
            box-shadow: 0 8px 18px rgba(20, 8, 36, 0.6);
        }
        /* === THEME TOGGLE SWITCH === */
        .theme-toggle {
            position: absolute;
            top: 18px;
            right: 24px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.78rem;
            color: #6b7280;
            user-select: none;
        }
        .theme-label {
            white-space: nowrap;
        }
        .switch {
            position: relative;
            display: inline-block;
            width: 42px;
            height: 22px;
        }
        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        .slider {
            position: absolute;
            cursor: pointer;
            inset: 0;
            background-color: #d1d5db;
            transition: 0.2s;
            border-radius: 999px;
        }
        .slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            transition: 0.2s;
            border-radius: 50%;
        }
        .switch input:checked+.slider {
            background-color: #5a2d82;
        }
        .switch input:checked+.slider:before {
            transform: translateX(20px);
        }

        /* === MODAL STYLES === */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: none; /* Hidden by default */
            justify-content: center;
            align-items: center;
            z-index: 9999;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .modal-overlay.active {
            display: flex;
            opacity: 1;
        }
        .modal-content {
            background: white;
            padding: 2rem;
            border-radius: 16px;
            width: 500px;
            max-width: 90%;
            box-shadow: 0 25px 50px rgba(0,0,0,0.25);
            text-align: center;
            max-height: 85vh;
            display: flex;
            flex-direction: column;
        }
        .modal-title {
            font-size: 1.5rem;
            color: #4b1f6f;
            margin-bottom: 0.5rem;
        }
        .modal-body {
            font-size: 0.95rem;
            color: #4b5563;
            margin-bottom: 1.5rem;
        }
        .producer-list {
            flex: 1;
            overflow-y: auto;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            margin-bottom: 1.5rem;
            text-align: left;
            padding: 0;
            list-style: none;
            max-height: 300px;
        }
        .producer-item {
            padding: 10px 14px;
            border-bottom: 1px solid #f3f4f6;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .producer-item:last-child {
            border-bottom: none;
        }
        .producer-item.highlight {
            background-color: #f3ecff;
        }
        .producer-item input[type="checkbox"] {
            width: 18px;
            height: 18px;
        }
        .modal-actions {
            display: flex;
            gap: 10px;
            justify-content: center;
        }

        /* === DARK THEME OVERRIDES === */
        body.dark-theme {
            background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
            color: #e5e7eb;
        }
        body.dark-theme .container, 
        body.dark-theme .modal-content {
            background: #020617;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
            border-color: #1f2937;
        }
        body.dark-theme .header {
            border-bottom-color: #111827;
        }
        body.dark-theme .badge-top {
            background: #111827;
            color: #c4b5fd;
        }
        body.dark-theme h1, body.dark-theme .modal-title {
            color: #e5e7eb;
        }
        body.dark-theme .subtitle {
            color: #9ca3af;
        }
        body.dark-theme .subtitle-ru, body.dark-theme .modal-body {
            color: #d1d5db;
        }
        body.dark-theme .info-banner {
            background: #020617;
            border-color: #374151;
            color: #9ca3af;
        }
        body.dark-theme label {
            color: #e5e7eb;
        }
        body.dark-theme input,
        body.dark-theme select {
            background: #020617;
            border-color: #4b5563;
            color: #e5e7eb;
        }
        body.dark-theme input::placeholder {
            color: #6b7280;
        }
        body.dark-theme .info-utc {
            color: #9ca3af;
        }
        body.dark-theme .hint-text {
            color: #6b7280;
        }
        body.dark-theme #results-area {
            border-top-color: #1f2933;
        }
        body.dark-theme th,
        body.dark-theme td,
        body.dark-theme .producer-item {
            border-bottom-color: #111827;
        }
        body.dark-theme th {
            background-color: #020617;
            color: #9ca3af;
        }
        body.dark-theme .results-title {
            color: #e5e7eb;
        }
        body.dark-theme .results-sub {
            color: #9ca3af;
        }
        body.dark-theme .amount-col {
            color: #e5e7eb;
        }
        body.dark-theme .row-xpr {
            background-color: #0b1120;
            border-left-color: #7c3aed;
        }
        body.dark-theme .row-staked {
            background-color: #111827;
            border-left-color: #a855f7;
        }
        body.dark-theme .row-lending {
            background-color: #1f2933;
            border-left-color: #f59e0b;
        }
        body.dark-theme .badge {
            background: #111827;
            color: #e5e7eb;
        }
        body.dark-theme .badge-lending {
            background-color: #f59e0b;
            color: #111827;
        }
        body.dark-theme .badge-staked {
            background-color: #9b59b6;
            color: #f9fafb;
        }
        body.dark-theme .btn-secondary {
            background-color: #0b1120;
            color: #e5e7eb;
            box-shadow: 0 4px 8px rgba(15, 23, 42, 0.7);
        }
        body.dark-theme .btn-secondary:hover:not(:disabled) {
            background-color: #020617;
        }
        body.dark-theme .loader {
            color: #9ca3af;
        }
        body.dark-theme .footer-credits {
            border-top-color: #1f2933;
            color: #9ca3af;
        }
        body.dark-theme .footer-text {
            color: #e5e7eb;
        }
        body.dark-theme .footer-logo {
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75);
        }
        body.dark-theme .theme-toggle {
            color: #9ca3af;
        }
        body.dark-theme .producer-list {
            border-color: #374151;
        }
        body.dark-theme .producer-item.highlight {
            background-color: #1e1b4b;
        }

        /* === MOBILE / SMALL SCREENS === */
        @media (max-width: 640px) {
            body {
                padding: 20px 8px;
            }
            .container {
                padding: 1.6rem 1.2rem 1.8rem 1.2rem;
            }
            .row {
                flex-direction: column;
            }
            .btn-row {
                flex-direction: column;
            }
            .results-header {
                flex-direction: column;
                align-items: flex-start;
            }
            .theme-toggle {
                position: static;
                margin-bottom: 0.5rem;
                justify-content: flex-end;
            }
            .header {
                margin-top: 0.4rem;
            }
            h1 {
                font-size: 1.4rem;
            }
            table {
                min-width: 420px;
            }
        }
        @media (max-width: 400px) {
            h1 {
                font-size: 1.25rem;
            }
            .badge-top {
                font-size: 0.68rem;
            }
            .theme-toggle {
                font-size: 0.72rem;
            }
            table {
                min-width: 380px;
            }
        }

        .bp-panel{
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:14px;
  background: rgba(0,0,0,.18);
}

.bp-toolbar{
  display:flex;
  gap:12px;
  align-items:flex-end;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.bp-title__main{ font-size:18px; font-weight:700; }
.bp-title__sub{ font-size:12px; opacity:.8; margin-top:2px; }

.bp-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.bp-search{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  color: inherit;
  min-width: 220px;
  outline:none;
}

.bp-btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: inherit;
  cursor:pointer;
}
.bp-btn:hover{ background: rgba(255,255,255,.12); }
.bp-btn--ghost{ background: transparent; }

.bp-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:10px;
}

.bp-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  transition: transform .05s ease, background .12s ease;
}
.bp-card:hover{ background: rgba(255,255,255,.06); transform: translateY(-1px); }

.bp-left{
  display:flex;
  gap:10px;
  align-items:center;
  min-width:0;
}

.bp-check{
  width:18px; height:18px;
}

.bp-name{
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 150px;
}

.bp-badges{
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
}

.bp-badge{
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  opacity:.9;
}

.bp-badge--target{
  border-color: rgba(255, 105, 180, .55);
  background: rgba(255, 105, 180, .12);
}

.bp-rank{
  font-size:12px;
  opacity:.7;
  padding:6px 8px;
  border-radius:10px;
  border:1px dashed rgba(255,255,255,.14);
}

.bp-status{
  margin-top:10px;
  font-size:12px;
  opacity:.85;
}
.bp-status--error{ color:#ff6b6b; opacity:1; }
/* =========================
   VOTE MODAL — PREMIUM UI
   ========================= */

/* overlay */
.modal-overlay{
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  z-index: 9999;

  /* not gray: deep purple / blue glass backdrop */
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(139, 92, 246, .22), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(59, 130, 246, .16), transparent 55%),
    radial-gradient(800px 600px at 50% 90%, rgba(236, 72, 153, .12), transparent 55%),
    rgba(2, 6, 23, .60);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-overlay.active{
  display: grid;
}

/* lock page scroll when modal open */
body.modal-open{
  overflow: hidden;
}

/* modal card */
.modal-content{
  width: min(980px, 100%);
  max-height: min(86vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06)),
    radial-gradient(1200px 800px at 30% 0%, rgba(139,92,246,.18), transparent 55%),
    radial-gradient(1200px 800px at 70% 0%, rgba(59,130,246,.14), transparent 55%),
    rgba(15, 23, 42, .86);

  box-shadow:
    0 30px 80px rgba(0,0,0,.55),
    0 2px 0 rgba(255,255,255,.05) inset;
}

/* header */
.modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;

  border-bottom: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
}

.modal-title{
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: .2px;
  color: rgba(255,255,255,.92);
}

.modal-close{
  appearance: none;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;

  color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.08);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset;
  transition: transform .12s ease, background .12s ease;
}
.modal-close:hover{
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}
.modal-close:active{
  transform: translateY(0);
}

/* body copy */
.modal-body{
  padding: 14px 20px 10px;
  color: rgba(226, 232, 240, .92);
  line-height: 1.45;
}
.modal-body b{
  color: rgba(255,255,255,.98);
}

/* panel container */
.bp-panel{
  padding: 12px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* toolbar */
.bp-toolbar{
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;

  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}

.bp-title__main{
  font-weight: 700;
  color: rgba(255,255,255,.92);
}
.bp-title__sub{
  font-size: .86rem;
  color: rgba(203, 213, 225, .85);
  margin-top: 2px;
}

.bp-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* search */
.bp-search{
  width: min(280px, 68vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(2,6,23,.25);
  color: rgba(255,255,255,.92);
  outline: none;
}
.bp-search::placeholder{
  color: rgba(203,213,225,.65);
}
.bp-search:focus{
  border-color: rgba(139,92,246,.65);
  box-shadow: 0 0 0 4px rgba(139,92,246,.20);
}

/* buttons inside toolbar */
.bp-btn{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.90);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.bp-btn:hover{
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}
.bp-btn:active{
  transform: translateY(0);
}
.bp-btn--ghost{
  background: transparent;
}

/* IMPORTANT: scroll area — grid becomes the scroll container */
.bp-grid{
  /* fixed-ish height so scroll is predictable */
  height: min(44vh, 520px);
  overflow: auto;
  padding: 10px;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(2, 6, 23, .22);

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* better scrollbars */
.bp-grid::-webkit-scrollbar{ width: 10px; height: 10px; }
.bp-grid::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(139,92,246,.45), rgba(59,130,246,.35));
  border-radius: 999px;
  border: 2px solid rgba(2,6,23,.35);
}
.bp-grid::-webkit-scrollbar-track{
  background: rgba(255,255,255,.04);
  border-radius: 999px;
}

/* cards */
.bp-card{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  color: rgba(255,255,255,.88);
  cursor: pointer;
  user-select: none;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.bp-card:hover{
  transform: translateY(-1px);
  border-color: rgba(139,92,246,.40);
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05));
}

.bp-card--featured{
  border-color: rgba(236, 72, 153, .45);
  box-shadow: 0 0 0 4px rgba(236,72,153,.10);
}

/* left row */
.bp-left{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bp-check{
  width: 18px;
  height: 18px;
  accent-color: #8b5cf6;
  cursor: pointer;
}

.bp-meta{ min-width: 0; }
.bp-name{
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255,255,255,.95);
}

/* badges */
.bp-badges{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.bp-badge{
  font-size: .72rem;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(226,232,240,.88);
}
.bp-badge--target{
  border-color: rgba(236,72,153,.35);
  background: rgba(236,72,153,.16);
  color: rgba(255,255,255,.92);
}

.bp-rank{
  font-variant-numeric: tabular-nums;
  color: rgba(203,213,225,.85);
  font-weight: 600;
}

/* status */
.bp-status{
  min-height: 1.2em;
  padding: 0 2px;
  color: rgba(203,213,225,.85);
}
.bp-status--error{
  color: rgba(252, 165, 165, .95);
}

/* modal actions pinned to bottom */
.modal-actions{
  margin-top: auto;
  padding: 14px 20px 18px;

  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;

  border-top: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.06));
}

/* buttons (re-skin your existing .btn) */
.btn{
  border-radius: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.btn:disabled{
  opacity: .6;
  cursor: not-allowed;
}

.btn-primary{
  background: linear-gradient(90deg, rgba(139,92,246,.95), rgba(59,130,246,.92));
  color: #fff;
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 10px 24px rgba(59,130,246,.18);
}
.btn-primary:hover{ transform: translateY(-1px); filter: brightness(1.05); }
.btn-primary:active{ transform: translateY(0); }

.btn-secondary{
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.90);
}
.btn-secondary:hover{ transform: translateY(-1px); background: rgba(255,255,255,.12); }
.btn-secondary:active{ transform: translateY(0); }

/* small status under buttons */
#wharf-status{
  padding: 0 20px 18px;
  color: rgba(203,213,225,.85) !important;
}

/* responsive */
@media (max-width: 720px){
  .bp-grid{ grid-template-columns: 1fr; height: min(50vh, 520px); }
  .modal-actions{ justify-content: stretch; }
  .modal-actions .btn{ width: 100%; }
}
/* =========================
   MOBILE POLISH (DROP-IN)
   Add this at the very end
   ========================= */

/* iOS safe-area + no weird zoom on inputs */
:root{
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* Prevent iOS zoom on focus: keep inputs >=16px */
@media (max-width: 640px){
  input, select, textarea { font-size: 16px; }
}

/* Better mobile layout + tap targets */
@media (max-width: 640px){
  body{
    padding: calc(16px + var(--safe-top)) 10px calc(16px + var(--safe-bottom)) 10px;
  }

  .container{
    width: 100%;
    border-radius: 14px;
    padding: 1.2rem 1rem 1.2rem 1rem;
  }

  .info-banner{
    gap: 8px;
    padding: 10px 10px;
  }

  /* Make theme toggle not mess header spacing */
  .theme-toggle{
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
  }

  /* Inputs/buttons more “thumb friendly” */
  input, select{
    padding: 12px 12px;
    border-radius: 12px;
  }
  .btn{
    padding: 12px 14px;
    min-height: 44px; /* Apple HIG tap target */
    border-radius: 14px;
  }
  .btn-row{
    gap: 12px;
  }

  /* Avoid long header overflow */
  h1{
    font-size: 1.35rem;
    line-height: 1.15;
  }
}

/* =========================
   TABLE -> CARDS on mobile
   ========================= */
@media (max-width: 640px){
  .table-wrapper{
    overflow: visible; /* we will not rely on horizontal scroll */
  }

  table{
    min-width: 0 !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px; /* space between "cards" */
  }

  thead{
    display: none; /* hide header */
  }

  tbody, tr, td{
    display: block;
    width: 100%;
  }

  tr{
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
  }

  body.dark-theme tr{
    background: #020617;
    border-color: #1f2937;
    box-shadow: 0 10px 22px rgba(0,0,0,.45);
  }

  td{
    border-bottom: 1px solid #f3f4f6;
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  body.dark-theme td{
    border-bottom-color: #111827;
  }

  td:last-child{
    border-bottom: none;
  }

  /* Label each cell using data-label attribute in HTML */
  td::before{
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 700;
  }
  body.dark-theme td::before{
    color: #9ca3af;
  }

  .amount-col{
    text-align: left; /* better for card view */
    font-family: 'Consolas', monospace;
    font-weight: 700;
  }

  /* Keep your special row styles visible */
  .row-xpr, .row-staked, .row-lending{
    border-left-width: 4px;
    border-left-style: solid;
  }
}

/* IMPORTANT: for the card-table to work, add data-label="" to each TD.
   Example:
   <td data-label="Asset">XPR</td>
   <td data-label="Type">Liquid</td>
   <td data-label="Amount" class="amount-col">123</td>
*/

/* =========================
   MODAL: full-screen on mobile
   ========================= */
@media (max-width: 720px){
  .modal-overlay{
    padding: 12px;
  }

  .modal-content{
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 16px;
  }

  .modal-head{
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(10px);
  }

  /* Make the grid scroll nicely inside the modal */
  .bp-grid{
    height: auto;
    max-height: 52vh;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .producer-list{
    max-height: 52vh;
    -webkit-overflow-scrolling: touch;
  }

  .modal-actions{
    position: sticky;
    bottom: 0;
    padding-bottom: calc(16px + var(--safe-bottom));
  }
}

/* =========================
   EXTRA: reduce motion if user prefers
   ========================= */
@media (prefers-reduced-motion: reduce){
  *{
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
