        :root {
            --red: #ff1a1a;
            --red-glow: rgba(255, 20, 20, 0.45);
            --bg: #050505;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        html, body {
            min-height: 100%;
            background: var(--bg);
            color: #fff;
            font-family: 'Rajdhani', sans-serif;
            overscroll-behavior: none;
        }

        body {
            min-height: 100dvh;
            padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
            display: flex;
            flex-direction: column;
            align-items: center;
            overflow-x: hidden;
            position: relative;
        }

        .hidden { display: none !important; }
        [hidden] { display: none !important; }

        .space {
            position: fixed;
            inset: 0;
            z-index: 0;
            background:
                radial-gradient(ellipse 70% 50% at 50% 35%, rgba(120, 0, 0, 0.28), transparent 62%),
                radial-gradient(circle at 50% 100%, rgba(255, 0, 0, 0.08), transparent 45%),
                linear-gradient(180deg, #000 0%, #0a0000 55%, #050505 100%);
        }

        .grid {
            position: fixed;
            inset: 0;
            z-index: 1;
            background-image:
                linear-gradient(rgba(255, 30, 30, 0.06) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 30, 30, 0.06) 1px, transparent 1px);
            background-size: 56px 56px;
            mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
            pointer-events: none;
        }

        .scan {
            position: fixed;
            inset: 0;
            z-index: 2;
            pointer-events: none;
            background: repeating-linear-gradient(
                to bottom,
                transparent 0,
                transparent 2px,
                rgba(0, 0, 0, 0.12) 3px
            );
            opacity: 0.35;
        }

        .stage {
            position: relative;
            z-index: 3;
            flex: 1;
            width: 100%;
            max-width: 420px;
            padding: 36px 22px 24px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 22px;
        }

        .title-block { text-align: center; }

        .title-block h1 {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .brand {
            font-family: 'Orbitron', sans-serif;
            font-weight: 900;
            font-size: clamp(1.5rem, 6vw, 2.2rem);
            letter-spacing: 0.08em;
            text-transform: uppercase;
            line-height: 1.1;
            background: linear-gradient(180deg, #fff 0%, #cfcfcf 38%, #8a8a8a 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            filter: drop-shadow(0 2px 0 #1a1a1a) drop-shadow(0 8px 18px rgba(255, 0, 0, 0.25));
        }

        .status-row {
            display: inline-flex;
            align-items: center;
            gap: 10px;
        }

        .led {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: var(--red);
            box-shadow: 0 0 8px var(--red), 0 0 18px var(--red-glow);
            animation: pulse 1.6s ease-in-out infinite;
        }

        .status {
            font-family: 'Orbitron', sans-serif;
            font-weight: 700;
            font-size: 0.72rem;
            letter-spacing: 0.32em;
            text-transform: uppercase;
            color: var(--red);
            text-shadow: 0 0 16px var(--red-glow);
        }

        #networkLabel,
        #statusText {
            font-family: 'Orbitron', sans-serif;
            font-size: 0.62rem;
            letter-spacing: 0.22em;
            text-transform: uppercase;
            color: rgba(255, 255, 255, 0.42);
        }

        .icon-bezel {
            position: relative;
            width: min(58vw, 188px);
            aspect-ratio: 1;
            padding: 10px;
            border-radius: 36px;
            background: linear-gradient(160deg, #5a5a5a 0%, #1c1c1c 22%, #0a0a0a 50%, #2a2a2a 78%, #111 100%);
            box-shadow:
                inset 0 2px 2px rgba(255, 255, 255, 0.35),
                inset 0 -6px 10px rgba(0, 0, 0, 0.75),
                0 2px 0 #777,
                0 6px 0 #1a1a1a,
                0 12px 0 #050505,
                0 18px 32px rgba(0, 0, 0, 0.75),
                0 0 50px rgba(255, 0, 0, 0.22);
            transform: perspective(900px) rotateX(6deg);
            cursor: pointer;
            border: 0;
        }

        .icon-bezel::before {
            content: "";
            position: absolute;
            inset: 5px;
            border-radius: 30px;
            border: 1px solid rgba(255, 40, 40, 0.45);
            box-shadow: 0 0 18px rgba(255, 0, 0, 0.25), inset 0 0 18px rgba(255, 0, 0, 0.12);
            pointer-events: none;
        }

        .icon-bezel img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 26px;
            display: block;
            pointer-events: none;
        }

        .icon-bezel:hover { filter: brightness(1.08); }
        .icon-bezel:active { transform: perspective(900px) rotateX(6deg) scale(0.97); }

        .loading-ui {
            position: absolute;
            inset: 10px;
            z-index: 5;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.55);
            border-radius: 26px;
        }

        .spinner {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            border: 3px solid rgba(255, 255, 255, 0.12);
            border-top-color: var(--red);
            animation: spin 0.9s linear infinite;
        }

        .panel {
            width: 100%;
            padding: 18px 16px 16px;
            border-radius: 18px;
            background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.12),
                inset 0 -3px 0 rgba(0, 0, 0, 0.65),
                0 0 0 1px rgba(255, 30, 30, 0.28),
                0 10px 24px rgba(0, 0, 0, 0.45);
        }

        .field {
            width: 100%;
            margin: 0 0 12px;
            padding: 13px 14px;
            border: 0;
            border-radius: 12px;
            outline: none;
            text-align: center;
            font-family: 'Orbitron', sans-serif;
            font-size: 0.72rem;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: #fff;
            background: linear-gradient(180deg, #141414, #0a0a0a);
            box-shadow:
                inset 0 2px 6px rgba(0, 0, 0, 0.65),
                0 0 0 1px rgba(255, 255, 255, 0.06);
        }

        .field::placeholder { color: rgba(255, 255, 255, 0.28); }
        .field:focus {
            box-shadow:
                inset 0 2px 6px rgba(0, 0, 0, 0.65),
                0 0 0 1px rgba(255, 30, 30, 0.7),
                0 0 18px rgba(255, 0, 0, 0.2);
        }

        .btn {
            width: 100%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 13px 18px 15px;
            font-family: 'Orbitron', sans-serif;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            text-decoration: none;
            border: 0;
            cursor: pointer;
            border-radius: 14px;
            transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
        }

        .btn-ghost {
            margin-top: 10px;
            color: #fff;
            background: transparent;
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
        }

        .return-box {
            width: min(92vw, 360px);
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .return-box .fine { margin-top: 4px; }

        .btn-primary {
            color: #fff;
            background: linear-gradient(180deg, #ff4a4a 0%, #e01010 38%, #9a0000 100%);
            box-shadow:
                inset 0 2px 0 rgba(255, 255, 255, 0.38),
                inset 0 -3px 0 rgba(80, 0, 0, 0.55),
                0 3px 0 #5a0000,
                0 8px 0 #220000,
                0 14px 28px rgba(255, 0, 0, 0.28);
        }

        .wallet-line, .saved-wallet p {
            margin: 8px 0 0;
            font-size: 0.95rem;
            letter-spacing: 0.04em;
            color: rgba(255, 255, 255, 0.82);
        }

        .saved-wallet {
            width: min(92vw, 360px);
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .fine {
            margin: 0 0 10px;
            font-size: 0.95rem;
            line-height: 1.4;
            letter-spacing: 0;
            text-transform: none;
            color: rgba(255, 255, 255, 0.62);
            text-align: center;
        }
        .mono { font-family: ui-monospace, monospace; font-size: 0.85em; }
        .deeplinks { text-align: left; }
        .deeplinks summary {
            cursor: pointer;
            font-family: 'Orbitron', sans-serif;
            font-size: 0.62rem;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: rgba(255, 255, 255, 0.7);
        }
        .link-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
        .link-row a {
            color: #fff;
            text-decoration: none;
            font-size: 0.78rem;
            letter-spacing: 0.04em;
            text-transform: none;
            padding: 8px 10px;
            border-radius: 999px;
            box-shadow: inset 0 0 0 1px rgba(255, 40, 40, 0.45);
        }

        .btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
        .btn:active {
            transform: translateY(4px);
            box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45), 0 1px 0 #220000;
        }

        .divider {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            color: rgba(255, 255, 255, 0.28);
            font-family: 'Orbitron', sans-serif;
            font-size: 0.58rem;
            letter-spacing: 0.28em;
            text-transform: uppercase;
        }

        .divider::before, .divider::after {
            content: "";
            flex: 1;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255, 30, 30, 0.4), transparent);
        }

        .error-box {
            width: 100%;
            padding: 12px;
            border-radius: 12px;
            background: rgba(80, 0, 0, 0.28);
            box-shadow: inset 0 0 0 1px rgba(255, 40, 40, 0.45);
        }

        .error-box p:first-child {
            font-family: 'Orbitron', sans-serif;
            font-size: 0.68rem;
            letter-spacing: 0.14em;
            color: var(--red);
            margin-bottom: 4px;
        }

        .error-box p:last-of-type {
            font-size: 0.85rem;
            color: rgba(255, 255, 255, 0.65);
        }

        #loginRetry { margin-top: 12px; }

        .debug-line {
            display: block;
            width: 100%;
            margin-top: 8px;
            padding: 0;
            border: 0;
            background: transparent;
            text-align: left;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            font-size: 0.62rem;
            line-height: 1.35;
            letter-spacing: 0;
            text-transform: none;
            color: rgba(255, 255, 255, 0.45);
            word-break: break-all;
            cursor: pointer;
        }

        footer {
            position: relative;
            z-index: 3;
            width: 100%;
            padding: 18px 16px 24px;
            text-align: center;
            font-family: 'Orbitron', sans-serif;
            font-size: 0.62rem;
            letter-spacing: 0.28em;
            text-transform: uppercase;
            color: rgba(255, 255, 255, 0.38);
        }

        footer span {
            color: var(--red);
            text-shadow: 0 0 10px var(--red-glow);
        }

        footer .build {
            display: block;
            margin-top: 8px;
            font-size: 0.5rem;
            letter-spacing: 0.08em;
            text-transform: none;
            color: rgba(255, 255, 255, 0.28);
        }

        #copyLog {
            position: fixed;
            right: 8px;
            bottom: calc(38vh + 16px);
            z-index: 10002;
            width: auto;
            padding: 8px 12px;
        }

        .muzz-debug {
            position: fixed;
            left: 8px;
            right: 8px;
            bottom: 8px;
            z-index: 10001;
            max-height: 38vh;
            overflow: auto;
            margin: 0;
            padding: 8px 10px;
            border-radius: 10px;
            background: rgba(0, 0, 0, 0.9);
            color: #c8f7c8;
            font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            letter-spacing: 0;
            text-transform: none;
            text-align: left;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .fallback {
            margin: 2px 0 0;
            padding: 0;
            border: 0;
            background: none;
            color: rgba(255, 255, 255, 0.55);
            font: inherit;
            font-size: 0.82rem;
            letter-spacing: 0;
            text-transform: none;
            text-decoration: underline;
            cursor: pointer;
        }

        .link-row.plain { justify-content: center; }
        .link-row.plain a {
            box-shadow: none;
            padding: 2px 6px;
            color: rgba(255, 255, 255, 0.62);
            text-decoration: underline;
            background: none;
        }
        .wallet-pick {
            color: #fff;
            font: inherit;
            font-size: 0.95rem;
            padding: 10px 14px;
            border-radius: 999px;
            border: 0;
            background: #161616;
            cursor: pointer;
            box-shadow: inset 0 0 0 1px rgba(255, 40, 40, 0.55);
        }

        .sign-overlay {
            position: fixed;
            inset: 0;
            z-index: 40;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(0, 0, 0, 0.72);
            backdrop-filter: blur(10px);
        }

        .sign-card {
            width: min(92vw, 360px);
            padding: 28px 22px 24px;
            border-radius: 22px;
            text-align: center;
            background: linear-gradient(180deg, #1a1a1a, #0c0c0c);
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.12),
                0 0 0 1px rgba(255,30,30,0.35),
                0 24px 50px rgba(0,0,0,0.55);
        }

        .sign-card .spinner {
            margin: 0 auto 16px;
            width: 42px;
            height: 42px;
            border-radius: 50%;
            border: 3px solid rgba(255,255,255,0.12);
            border-top-color: var(--red);
            animation: spin 0.9s linear infinite;
        }

        .sign-card h2 {
            font-family: 'Orbitron', sans-serif;
            font-size: 0.82rem;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            margin-bottom: 8px;
        }

        .sign-card p {
            font-size: 0.95rem;
            color: rgba(255,255,255,0.62);
            line-height: 1.45;
        }

        .sign-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 16px;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.45; transform: scale(0.82); }
        }

        @keyframes spin { to { transform: rotate(360deg); } }

        @media (max-width: 480px) {
            .stage { gap: 18px; padding-top: 28px; }
            .icon-bezel { width: min(52vw, 168px); }
        }

        @media (prefers-reduced-motion: reduce) {
            .led, .spinner { animation: none; }
            .btn { transition: none; }
        }

        /* 1.0.32 login */
        .section { width: 100%; display: flex; flex-direction: column; gap: 10px; }
        .section-title {
            font-family: 'Orbitron', sans-serif; font-size: 0.6rem; letter-spacing: 0.24em;
            text-transform: uppercase; color: rgba(255,255,255,0.5); text-align: center;
        }
        .wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
        .wallet-btn {
            display: flex; align-items: center; justify-content: center; gap: 8px;
            min-height: 46px; padding: 10px 12px; border: 0; border-radius: 14px;
            color: #fff; font: inherit; font-size: 0.98rem; font-weight: 600; cursor: pointer;
            background: linear-gradient(180deg, #1c1c1c, #0f0f0f);
            box-shadow: inset 0 0 0 1px rgba(255,40,40,0.5), 0 6px 14px rgba(0,0,0,0.4);
            text-decoration: none;
        }
        .wallet-btn img { width: 22px; height: 22px; border-radius: 6px; }
        .wallet-btn.primary { grid-column: 1 / -1; background: linear-gradient(180deg, #ff4a4a 0%, #e01010 38%, #9a0000 100%); }
        .wallet-btn[disabled] { opacity: 0.5; cursor: default; }
        .pair-code {
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            font-size: 1.6rem; letter-spacing: 0.3em; color: #fff; text-align: center; margin: 6px 0;
        }
        .qr { display: flex; justify-content: center; padding: 12px; background: #fff; border-radius: 14px; width: 220px; margin: 0 auto; }
        .qr svg { width: 196px; height: 196px; }
        .origin-badge {
            display: inline-flex; gap: 6px; align-items: center; justify-content: center;
            font-family: ui-monospace, monospace; font-size: 0.82rem; color: #9fe39f;
            padding: 6px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(120,255,120,0.35);
        }
        .steps { text-align: left; margin: 6px 0 0 18px; color: rgba(255,255,255,0.7); font-size: 0.92rem; line-height: 1.5; }
        .field.code-input { font-size: 1.3rem; letter-spacing: 0.4em; }

        /* 1.0.33 login: one "Connect wallet" button, everything else inside the flow sheet */
        .logo-bezel { cursor: default; }
        .logo-bezel:hover { filter: none; }
        .logo-bezel:active { transform: perspective(900px) rotateX(6deg); }
        .connect-btn { width: min(92vw, 320px); }
        .connect-btn[disabled] { opacity: 0.6; cursor: default; transform: none; }
        .flow { z-index: 35; }
        .flow-card { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 32px); overflow-y: auto; }
        .flow-card h2 {
            font-family: 'Orbitron', sans-serif; font-size: 0.82rem; letter-spacing: 0.16em;
            text-transform: uppercase; margin: 0;
        }
        .flow-card .error-box { text-align: center; }
        .flow-card .btn-ghost { margin-top: 0; }
        .flow-card .wallet-grid .wallet-btn:only-child { grid-column: 1 / -1; }


.paste-wrap { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.paste-wrap[hidden] { display: none; }
.paste-input { width: 100%; box-sizing: border-box; padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: inherit; font: inherit; font-size: 14px; }
