:root {
    --bg: #07090e;
    --bg-gradient: radial-gradient(circle at 50% 0%, #151926 0%, #07090e 100%);
    --card: rgba(16, 21, 31, 0.88);
    --card-hover: rgba(22, 28, 42, 0.95);
    --card2: #0d1118;
    --border: #202736;
    --border-focus: #7957ff;
    --text: #f0f3f8;
    --muted: #8491a5;
    --purple: #7957ff;
    --purple-glow: rgba(121, 87, 255, 0.35);
    --green: #35d47d;
    --green-glow: rgba(53, 212, 125, 0.4);
    --red: #ff5565;
    --red-glow: rgba(255, 85, 101, 0.45);
    --amber: #ffb84d;
    --amber-glow: rgba(255, 184, 77, 0.35);
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-gradient);
    background-color: var(--bg);
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.app {
    width: min(1120px, calc(100% - 20px));
    margin: auto;
    padding: 8px 0 20px;
}

/* ============================================================
   TOP HEADER
   ============================================================ */
header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.brand-group h1 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin: 0;
}

.accent-text {
    background: linear-gradient(135deg, #a99cff 0%, #35d47d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wallet-top-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

.connect-main-btn {
    height: 27px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 750;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.connected-wallet-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(13, 17, 24, 0.95);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 2px 3px;
    gap: 3px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.pill-address-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    color: #f1f5f9;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    height: 23px;
    padding: 0 7px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pill-address-btn:hover {
    background: rgba(121, 87, 255, 0.16);
    border-color: rgba(121, 87, 255, 0.4);
    color: #fff;
}

.pill-address-btn .dot {
    width: 5px;
    height: 5px;
}

.pill-disconnect-btn {
    background: rgba(255, 85, 101, 0.12);
    border: 1px solid rgba(255, 85, 101, 0.28);
    color: #ff98a2;
    font-size: 10px;
    font-weight: 700;
    height: 23px;
    padding: 0 7px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pill-disconnect-btn:hover {
    background: rgba(255, 85, 101, 0.25);
    color: #fff;
    border-color: rgba(255, 85, 101, 0.55);
}

.hidden {
    display: none !important;
}

/* ============================================================
   RADAR & REALTIME MONITORING HUD
   ============================================================ */
.hud-panel {
    background: #10141e;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px 12px;
    margin-bottom: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.hud-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    transition: background 0.3s ease;
}

.hud-panel.standby::before {
    background: linear-gradient(90deg, #333d4d, #4d5b70, #333d4d);
}

.hud-panel.active-mode {
    border-color: rgba(53, 212, 125, 0.5);
    box-shadow: 0 0 20px var(--green-glow), 0 6px 20px rgba(0, 0, 0, 0.45);
    background: radial-gradient(circle at 10% 20%, rgba(53, 212, 125, 0.07) 0%, #10141e 50%);
}

.hud-panel.active-mode::before {
    background: linear-gradient(90deg, #35d47d, #7957ff, #35d47d);
    background-size: 200% 100%;
    animation: borderSlide 3s linear infinite;
}

.hud-panel.error-mode {
    border-color: var(--red);
    box-shadow: 0 0 25px var(--red-glow), 0 6px 20px rgba(0, 0, 0, 0.5);
    background: radial-gradient(circle at 10% 20%, rgba(255, 85, 101, 0.1) 0%, #10141e 50%);
    animation: alertPulse 1.8s ease-in-out infinite;
}

.hud-panel.error-mode::before {
    background: var(--red);
}

@keyframes borderSlide {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

@keyframes alertPulse {

    0%,
    100% {
        box-shadow: 0 0 16px var(--red-glow), 0 6px 20px rgba(0, 0, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 28px var(--red-glow), 0 10px 28px rgba(0, 0, 0, 0.65);
    }
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.radar-group {
    display: flex;
    align-items: center;
    gap: 9px;
}

.radar-ping {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
}

.ping-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    transition: all 0.3s ease;
    z-index: 2;
}

.ping-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid transparent;
}

.hud-panel.active-mode .ping-dot {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.hud-panel.active-mode .ping-circle {
    border-color: var(--green);
    animation: pingAnimation 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.hud-panel.error-mode .ping-dot {
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
}

.hud-panel.error-mode .ping-circle {
    border-color: var(--red);
    animation: pingAnimation 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pingAnimation {
    0% {
        transform: scale(0.6);
        opacity: 0.9;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.hud-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.hud-title-row h2 {
    font-size: 12.5px;
    font-weight: 750;
    letter-spacing: -0.2px;
    margin: 0;
}

.status-pill {
    font-size: 9.5px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 5px;
}

.standby-pill {
    background: rgba(132, 145, 165, 0.15);
    color: var(--muted);
    border: 1px solid var(--border);
}

.active-pill {
    background: rgba(53, 212, 125, 0.15);
    color: var(--green);
    border: 1px solid rgba(53, 212, 125, 0.4);
}

.error-pill {
    background: rgba(255, 85, 101, 0.2);
    color: var(--red);
    border: 1px solid var(--red);
}

.hud-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap !important;
    flex-shrink: 0;
}

/* TOGGLE BUTTONS (COMPACT & STRICTLY SAME LINE) */
.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.01em;
    cursor: pointer;
    border: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.toggle-btn.start-mode {
    background: linear-gradient(135deg, #35d47d 0%, #1dbd63 100%);
    color: #07160d;
    box-shadow: 0 3px 10px rgba(53, 212, 125, 0.25);
}

.toggle-btn.start-mode:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(53, 212, 125, 0.4);
}

.toggle-btn.stop-mode {
    background: rgba(255, 85, 101, 0.15);
    color: #ffabb1;
    border: 1px solid rgba(255, 85, 101, 0.4);
}

.toggle-btn.stop-mode:hover {
    background: rgba(255, 85, 101, 0.25);
    transform: translateY(-1px);
}

.bnb-toggle-btn.off-mode {
    background: rgba(240, 185, 11, 0.12);
    color: #f0b90b;
    border: 1px solid rgba(240, 185, 11, 0.35);
}

.bnb-toggle-btn.off-mode:hover {
    background: rgba(240, 185, 11, 0.22);
    border-color: rgba(240, 185, 11, 0.6);
    transform: translateY(-1px);
}

.bnb-toggle-btn.on-mode {
    background: linear-gradient(135deg, #f0b90b 0%, #d49e07 100%);
    color: #161001;
    font-weight: 800;
    border: 1px solid #ffe278;
    box-shadow: 0 3px 12px rgba(240, 185, 11, 0.35);
    animation: pulse-glow-bnb 2.5s infinite;
}

.bnb-toggle-btn.on-mode:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(240, 185, 11, 0.5);
}

@keyframes pulse-glow-bnb {
    0% {
        box-shadow: 0 0 0 0 rgba(240, 185, 11, 0.55);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(240, 185, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(240, 185, 11, 0);
    }
}

/* TELEMETRY ROW */
.telemetry-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.telemetry-item {
    background: var(--card2);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 6px;
}

.tel-label {
    display: block;
    font-size: 8px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tel-val {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--muted);
    font-weight: 600;
    line-height: 1.2;
}

.tel-val.online {
    color: #e2fbe9;
}

.tel-val.err {
    color: var(--red);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot.on {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.dot.connecting {
    background: var(--amber);
    animation: pingAnimation 1s infinite;
}

.dot.err {
    background: var(--red);
    box-shadow: 0 0 6px var(--red);
}

.dot.off {
    background: #475266;
}

/* GAS WARNING ALERT */
.gas-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 85, 101, 0.12);
    border: 1px solid rgba(255, 85, 101, 0.35);
    border-radius: 6px;
    padding: 5px 10px;
    margin-top: 6px;
    color: #ffd2d6;
    font-size: 10.5px;
    line-height: 1.35;
}

.gas-alert.hidden {
    display: none;
}

.alert-icon {
    font-size: 14px;
}

/* ============================================================
   DASHBOARD 2-COLUMN COMPACT GRID
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 8px;
    align-items: start;
}

.dash-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============================================================
   SECTIONS & CARDS (COMPACT ARCHITECTURE)
   ============================================================ */
.card,
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.card {
    padding: 9px 12px;
    border-radius: 8px;
}

.head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.head h2 {
    margin: 0;
    font-size: 12.5px;
    font-weight: 750;
    letter-spacing: -0.2px;
}

.head small {
    color: #a99cff;
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: 8px;
    display: block;
    margin-bottom: 1px;
}

.pill-tag {
    background: rgba(121, 87, 255, 0.2);
    color: #c8c1ff;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 750;
}

/* RESCUE / CLAIM HERO CARD */
.rescue-card {
    border-color: rgba(121, 87, 255, 0.35);
    background: radial-gradient(circle at 90% 10%, rgba(121, 87, 255, 0.08) 0%, var(--card) 60%);
}

label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #9ba7b9;
    font-size: 10px;
    font-weight: 650;
    margin-top: 0;
}

/* INPUTS & ACTIONS (FIXED COMPACT) */
input {
    width: 100%;
    height: 31px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #090c12;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    outline: none;
    transition: all 0.15s ease;
}

input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 2px rgba(121, 87, 255, 0.2);
}

/* INPUT VALIDATION STATE CLASSES */
input.input-error {
    border-color: #ff5565 !important;
    background: rgba(255, 85, 101, 0.06) !important;
    box-shadow: 0 0 0 2px rgba(255, 85, 101, 0.25) !important;
}

input.input-valid {
    border-color: #35d47d !important;
    background: rgba(53, 212, 125, 0.05) !important;
    box-shadow: 0 0 0 2px rgba(53, 212, 125, 0.2) !important;
}

input.input-warn {
    border-color: #ffb84d !important;
    background: rgba(255, 184, 77, 0.05) !important;
    box-shadow: 0 0 0 2px rgba(255, 184, 77, 0.2) !important;
}



/* CONTEXTUAL FIELD VALIDATIONS (EXACTLY UNDER INPUTS) */
.field-validation {
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
    min-height: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.25;
}

.field-validation.error {
    color: #ff6b7a;
}

.field-validation.warn {
    color: var(--amber);
}

.field-validation.valid {
    color: #35d47d;
}

/* BUTTONS */
button {
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    font-weight: 700;
    font-family: var(--font-main);
    transition: all 0.15s ease;
    user-select: none;
}

.primary {
    background: linear-gradient(135deg, #7957ff 0%, #5d3be9 100%);
    box-shadow: 0 3px 10px rgba(121, 87, 255, 0.25);
}

.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(121, 87, 255, 0.4);
}

.claim-action-btn {
    background: linear-gradient(135deg, #35d47d 0%, #1fa95c 100%);
    color: #071a10;
    height: 33px;
    min-height: 33px;
    font-size: 11.5px;
    font-weight: 750;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(53, 212, 125, 0.25);
    margin-top: 6px;
}

.claim-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(53, 212, 125, 0.4);
}

.secondary {
    background: #202634;
    border: 1px solid #313b4e;
    font-size: 10.5px;
}

.secondary:hover {
    background: #283042;
}

.fetch-btn {
    height: 27px;
    padding: 0 9px;
    font-size: 10.5px;
    border-radius: 5px;
}

.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 10px;
}

.ghost:hover {
    border-color: #4a5770;
    color: var(--text);
}

.sm-btn {
    height: 22px;
    padding: 0 7px;
    font-size: 10px;
    border-radius: 5px;
}

.full {
    width: 100%;
}

/* ============================================================
   STATS TILES (COMPACT PRICE / METRIC TILES)
   ============================================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin: 0;
}

.stat-card {
    padding: 6px 9px;
    border-radius: 7px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card b {
    display: block;
    margin-top: 1px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.2px;
    font-family: var(--font-mono);
}

.stat-card.highlight b {
    color: var(--green);
    text-shadow: 0 0 8px var(--green-glow);
}

/* ============================================================
   NOTICE & ERROR BANNER
   ============================================================ */
.notice {
    margin: 0;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    animation: noticeSlideIn 0.2s ease-out;
}

@keyframes noticeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }

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

.notice-text {
    flex: 1;
    word-break: break-word;
}

.notice-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 11px;
    cursor: pointer;
    padding: 0 3px;
    line-height: 1;
    opacity: 0.7;
}

.notice-close:hover {
    opacity: 1;
}

.notice.success {
    background: rgba(53, 212, 125, 0.12);
    border-color: rgba(53, 212, 125, 0.45);
    color: #86efac;
}

.notice.error {
    background: rgba(255, 85, 101, 0.15);
    border-color: rgba(255, 85, 101, 0.5);
    color: #fecdd3;
}

.notice.info {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.45);
    color: #bae6fd;
}

/* ============================================================
   SAFE WALLET DESTINATION BANNER
   ============================================================ */
.safe-wallet-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(121, 87, 255, 0.08);
    border: 1px solid rgba(121, 87, 255, 0.25);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    flex-wrap: wrap;
}

.safe-badge {
    background: rgba(121, 87, 255, 0.2);
    color: #c8c1ff;
    font-size: 8px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.03em;
}

.safe-wallet-banner code {
    color: #f1eeff;
    font-family: var(--font-mono);
    font-size: 10.5px;
}

.safe-wallet-banner a {
    color: #a99cff;
    margin-left: auto;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
}

.safe-wallet-banner a:hover {
    text-decoration: underline;
}

/* ============================================================
   REWARD BREAKDOWN TABLE
   ============================================================ */
.user-id-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.user-id-input-group {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.user-id-input-group input {
    flex: 1;
}

.user-id-input-group .fetch-btn {
    height: 31px;
    padding: 0 11px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}

.section-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 6px 0;
}

.reward-table {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 3px;
}

.reward-table::-webkit-scrollbar {
    width: 3px;
}

.reward-table::-webkit-scrollbar-thumb {
    background: #252e40;
    border-radius: 3px;
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 2.5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 10.5px;
}

.row span {
    color: var(--muted);
}

.row b {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
}

/* ============================================================
   TERMINAL FEED & ACTIVITY (COMPACT HEIGHTS)
   ============================================================ */
.terminal-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.term-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.terminal-body {
    background: #07090e;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 8px;
    height: 75px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 9.5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.terminal-body::-webkit-scrollbar {
    width: 3px;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #252e40;
    border-radius: 3px;
}

.term-line {
    line-height: 1.35;
    word-break: break-all;
}

.term-line.info {
    color: #8e9bb0;
}

.term-line.success {
    color: #35d47d;
    font-weight: 600;
}

.term-line.warn {
    color: var(--amber);
}

.term-line.error {
    color: var(--red);
    font-weight: 600;
}

.activity #logs {
    max-height: 80px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 7px;
    border: 1px solid var(--border);
    background: var(--card2);
    border-radius: 6px;
    margin-top: 4px;
    font-size: 10px;
}

.activity-item .meta {
    color: var(--muted);
    font-size: 9px;
    margin-top: 1px;
    font-family: var(--font-mono);
}

.activity-item a {
    color: #a99cff;
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
}

.activity-item a:hover {
    text-decoration: underline;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 12px;
    font-size: 10.5px;
}

footer {
    color: #5d6778;
    font-size: 10.5px;
    text-align: center;
    margin-top: 14px;
}

footer a {
    color: #7b889e;
}

/* ============================================================
   RESPONSIVE DESIGN (PRESERVING COMPACT SIZES ON ALL DEVICES)
   ============================================================ */
@media (max-width: 820px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .telemetry-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .hud-top {
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
    }

    .hud-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        /* BOTH BUTTONS ALWAYS ON THE EXACT SAME LINE */
        gap: 6px;
        width: 100%;
    }

    .toggle-btn {
        width: 100%;
        justify-content: center;
        padding: 3px 6px;
        font-size: 10.5px;
        white-space: nowrap !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 480px) {
    .app {
        width: calc(100% - 14px);
        padding: 6px 0 16px;
    }

    .brand-group h1 {
        font-size: 15px;
    }

    .hud-top {
        gap: 6px;
    }

    .hud-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 5px;
        width: 100%;
    }

    .toggle-btn {
        width: 100%;
        justify-content: center;
        padding: 3px 4px;
        font-size: 9.5px;
        height: 27px;
        white-space: nowrap !important;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .stat-card {
        padding: 5px 8px;
    }

    .safe-wallet-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .safe-wallet-banner a {
        margin-left: 0;
    }
}