        /* ══════════════════════════════════════════
           CSS VARIABLES — Functional Brutalism
           Light: warm parchment · Dark: deep void
        ══════════════════════════════════════════ */
        :root {
            --bg:          #e8e4dd;
            --bg-2:        #dedad2;
            --ink:         #1a1a1a;
            --ink-2:       #6b6560;
            --accent:      #c23b22;
            --line:        rgba(26,26,26,0.82);
            --line-faint:  rgba(26,26,26,0.11);
        }
        [data-theme="dark"] {
            --bg:          #111110;
            --bg-2:        #1d1d1b;
            --ink:         #e8e4dd;
            --ink-2:       #7a7671;
            --accent:      #e05a3a;
            --line:        rgba(232,228,221,0.78);
            --line-faint:  rgba(232,228,221,0.09);
        }
        @media (prefers-color-scheme: dark) {
            :root:not([data-theme="light"]) {
                --bg:          #111110;
                --bg-2:        #1d1d1b;
                --ink:         #e8e4dd;
                --ink-2:       #7a7671;
                --accent:      #e05a3a;
                --line:        rgba(232,228,221,0.78);
                --line-faint:  rgba(232,228,221,0.09);
            }
        }

        /* ══ RESET ══ */
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        html, body {
            height: 100%;
            overflow: hidden;
            touch-action: manipulation;
            overscroll-behavior: none;
            -webkit-overflow-scrolling: none;
            background-color: var(--bg);
        }
        body {
            font-family: 'IBM Plex Mono', 'SF Mono', monospace;
            display: flex;
            flex-direction: column;
            background-color: var(--bg);
            color: var(--ink);
            transition: background-color 0.2s, color 0.2s;
            padding-top: env(safe-area-inset-top);
            /* bottom safe area NOT on body — let #btn-area extend to screen edge
               and handle it internally. body padding-bottom + height:100% +
               box-sizing:border-box is unreliable in iOS PWA mode. */
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }

        /* ══ SPLASH ══ */
        #splash-screen {
            position: fixed;
            inset: 0;
            background-color: var(--bg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 18px;
            z-index: 9999;
            transition: opacity 0.3s ease;
        }
        #splash-screen.hidden {
            opacity: 0;
            pointer-events: none;
        }
        #splash-screen img {
            width: 52px;
            height: 52px;
            border: 1.5px solid var(--line);
        }
        .splash-title {
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 20px;
            font-weight: 800;
            letter-spacing: -0.03em;
            color: var(--ink);
        }
        .splash-loading {
            width: 44px;
            height: 2px;
            background: var(--line-faint);
            position: relative;
            overflow: hidden;
        }
        .splash-loading::after {
            content: '';
            position: absolute;
            left: -100%;
            top: 0;
            width: 100%;
            height: 100%;
            background: var(--accent);
            animation: scan 1s ease-in-out infinite;
        }
        @keyframes scan { to { left: 100%; } }

        /* ══ TOAST ══ */
        #message-box {
            position: fixed;
            top: calc(env(safe-area-inset-top) + 62px);
            left: 50%;
            transform: translateX(-50%);
            background: var(--bg-2);
            color: var(--ink);
            border: 1.5px solid var(--line-faint);
            padding: 9px 16px;
            font-family: 'IBM Plex Mono', monospace;
            font-size: 12px;
            letter-spacing: 0.01em;
            border-left: 3px solid var(--accent);
            z-index: 9100;
            display: none;
            max-width: min(360px, 90vw);
            text-align: center;
            white-space: pre-line;
        }
        #message-box.success { border-left-color: #2d7a4a; }

        /* ══ GREETING TOAST ══ */
        #greeting-toast {
            width: 100%;
            text-align: center;
            font-family: 'IBM Plex Mono', monospace;
            font-size: 13px;
            color: var(--ink-2);
            letter-spacing: 0.02em;
            max-height: 0;
            overflow: hidden;
            opacity: 0;
            pointer-events: none;
            transition: max-height 0.4s ease, opacity 0.4s ease, margin-bottom 0.4s ease;
            margin-bottom: 0;
        }
        #greeting-toast.show {
            max-height: 32px;
            opacity: 1;
            margin-bottom: 8px;
        }

        /*
         * _showOverlay() sets el.style.height = window.innerHeight + 'px', which on
         * iOS Safari/PWA can be smaller than the full screen (excludes home-indicator).
         * _showOverlay() no longer sets inline height — CSS top:0/bottom:0 handles size.
         */
        /* (no overrides needed) */

        /* ══ INPUT DIALOG ══ */
        #input-dialog {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(26,26,26,0.65);
            z-index: 9500;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.2s, visibility 0.2s;
            -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
        }
        .dialog-content {
            background: var(--bg);
            border: 1.5px solid var(--line);
            border-bottom: none;
            padding: 26px 22px calc(32px + env(safe-area-inset-bottom));
            width: 100%;
            max-width: 520px;
            display: flex;
            flex-direction: column;
            gap: 13px;
        }
        #dialog-message {
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 16px;
            font-weight: 700;
            letter-spacing: -0.01em;
            color: var(--ink);
        }
        #dialog-input {
            width: 100%;
            padding: 11px 13px;
            background: var(--bg-2);
            border: 1.5px solid var(--line-faint);
            color: var(--ink);
            font-family: 'IBM Plex Mono', monospace;
            font-size: 14px;
            outline: none;
            transition: border-color 0.15s;
            border-radius: 0;
            -webkit-appearance: none;
            appearance: none;
        }
        #dialog-input:focus { border-color: var(--accent); }
        #dialog-input::placeholder { color: var(--ink-2); }
        #btn-area-msgbox {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }
        #dialog-cancel, #dialog-confirm {
            padding: 12px;
            border: 1.5px solid var(--line);
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.12s, color 0.12s;
            border-radius: 0;
        }
        #dialog-cancel { background: transparent; color: var(--ink); }
        #dialog-cancel:hover { background: var(--bg-2); }
        #dialog-confirm { background: var(--ink); color: var(--bg); border-color: transparent; }
        #dialog-confirm:active { opacity: 0.85; }

        /* ══ HEADER ══ */
        #header {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            padding: 13px 18px;
            border-bottom: 1px solid var(--line-faint);
            position: relative;
        }
        /* Left accent bar — brand anchor */
        #header::before {
            content: '';
            position: absolute;
            left: 0; top: 0; bottom: 0;
            width: 4px;
            background: var(--accent);
        }
        #header-title {
            flex: 1;
            text-align: center;
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 16px;
            font-weight: 800;
            letter-spacing: -0.03em;
            color: var(--ink);
        }
        .header-btn {
            width: 34px;
            height: 34px;
            background: transparent;
            border: 1px solid var(--line-faint);
            color: var(--ink);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: border-color 0.15s, background 0.15s;
            -webkit-tap-highlight-color: transparent;
        }
        .header-btn:hover { border-color: var(--line); background: var(--bg-2); }
        .button-icon {
            width: 17px;
            height: 17px;
            stroke: var(--ink);
        }
        .button-icon.hidden { display: none; }
        .button-icon.visible { display: block; }

        /* ══ MAIN CONTENT ══ */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            /* padding-bottom accounts for fixed #btn-area height plus safe area. */
            padding: 24px 24px calc(178px + env(safe-area-inset-bottom));
            gap: 18px;
            min-height: 0;
        }
        #qrcode-container {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 10px;
            border: 2px solid var(--line);
            background: var(--bg);
            box-shadow: 5px 5px 0 var(--line-faint);
            transition: opacity 0.2s;
        }
        #qrcode-container.loading { opacity: 0.4; }
        #qrcode {
            position: relative;
            line-height: 0;
            background: #fff;
        }
        #qrcode img,
        #qrcode svg {
            position: relative;
            z-index: 1;
            display: block;
            width: min(248px, 62vw);
            height: min(248px, 62vw);
            image-rendering: pixelated;
        }
        #qrcode .hdr-primer-video {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            background: #fff;
            pointer-events: none;
            z-index: 0;
        }
        #tips {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 11px;
            color: var(--ink-2);
            text-align: center;
            letter-spacing: 0.04em;
        }

        #server-status {
            display: none;
            max-width: min(340px, 82vw);
            margin-top: -8px;
            padding: 0 2px;
            color: var(--ink-2);
            font-family: 'IBM Plex Mono', monospace;
            font-size: 10px;
            line-height: 1.55;
            text-align: center;
            letter-spacing: 0.02em;
        }

        #server-status.show {
            display: block;
        }

        .server-status-title {
            color: var(--accent);
            font-weight: 600;
        }

        .server-status-detail {
            margin-top: 2px;
            opacity: 0.78;
        }

        /* ══ BUTTON AREA ══
         * position:fixed; bottom:0 is the ONLY reliable way to reach the true
         * screen bottom in iOS PWA. flex-child bottom-edge calculation is unreliable
         * across iOS versions. fixed+bottom:0 is anchored to the ICB (full screen
         * including safe areas when viewport-fit=cover).
         */
        #btn-area {
            position: fixed;
            /* bottom:0 in iOS PWA anchors to the safe-area boundary, not the physical
               screen edge — push down by the inset so the background truly fills to
               the screen bottom. padding-bottom then lifts content above home indicator. */
            bottom: calc(-1 * env(safe-area-inset-bottom));
            left: 0;
            right: 0;
            padding: 11px calc(18px + env(safe-area-inset-right)) calc(11px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
            background: var(--bg);
            display: flex;
            flex-direction: column;
            gap: 10px;
            border-top: 1px solid var(--line-faint);
            z-index: 50;
        }
        .version-footer-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }
        .version-text {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 11px;
            color: var(--ink-2);
            cursor: pointer;
            letter-spacing: 0.04em;
            transition: color 0.12s;
        }
        .version-text:hover { color: var(--accent); }
        .version-text-sep { font-size: 11px; color: var(--line-faint); }

        #refreshQRCodeBtn {
            width: 100%;
            padding: 15px 18px;
            background: var(--ink);
            color: var(--bg);
            border: none;
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 15px;
            font-weight: 800;
            letter-spacing: 0.02em;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: opacity 0.12s, transform 0.1s;
            -webkit-tap-highlight-color: transparent;
            border-radius: 0;
        }
        #refreshQRCodeBtn:active { transform: translateY(1px); opacity: 0.88; }
        #refreshQRCodeBtn:disabled { opacity: 0.32; cursor: not-allowed; transform: none; }
        #refreshQRCodeBtn .button-icon { stroke: var(--bg); }

        .preference-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            padding: 3px 0;
            -webkit-tap-highlight-color: transparent;
        }
        .preference-toggle > span:first-child {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 11px;
            color: var(--ink-2);
            letter-spacing: 0.04em;
        }
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 42px;
            height: 22px;
        }
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .toggle-slider {
            position: absolute;
            inset: 0;
            background: var(--bg-2);
            border: 1px solid var(--line-faint);
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s;
        }
        .toggle-slider::before {
            content: '';
            position: absolute;
            width: 16px;
            height: 16px;
            left: 2px;
            top: 2px;
            background: var(--ink-2);
            transition: transform 0.2s, background 0.2s;
        }
        .toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
        .toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }

        /* ══ QR ECL SELECTOR ══ */
        #qr-ecl-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 3px 0;
        }
        #qr-ecl-row > span {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 11px;
            color: var(--ink-2);
            letter-spacing: 0.04em;
        }
        .ecl-group { display: flex; gap: 4px; }
        .ecl-btn {
            padding: 2px 10px;
            border: 1px solid var(--line-faint);
            background: transparent;
            color: var(--ink-2);
            cursor: pointer;
            font-size: 12px;
            font-family: 'IBM Plex Mono', monospace;
            border-radius: 2px;
            -webkit-tap-highlight-color: transparent;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }
        .ecl-btn.active {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
        }

        /* ══ RATE LIMIT MODAL ══ */
        #rate-limit-modal {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(26,26,26,0.7);
            z-index: 9200;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.2s, visibility 0.2s;
            -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
        }
        [data-theme="dark"] #rate-limit-modal,
        @media (prefers-color-scheme: dark) { #rate-limit-modal } {
            background: rgba(0,0,0,0.75);
        }
        .rate-limit-content {
            background: var(--bg);
            border: 2px solid var(--line);
            padding: 24px 22px;
            max-width: 340px;
            width: 100%;
            box-shadow: 6px 6px 0 var(--line-faint);
        }
        .rate-limit-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }
        .rate-limit-icon { font-size: 18px; }
        .rate-limit-title {
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 16px;
            font-weight: 800;
            letter-spacing: -0.02em;
        }
        .rate-limit-body {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 12px;
            color: var(--ink-2);
            line-height: 1.7;
            margin-bottom: 18px;
        }
        .rate-limit-footer { display: flex; justify-content: flex-end; }
        #close-rate-limit {
            padding: 10px 20px;
            background: var(--ink);
            color: var(--bg);
            border: none;
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            border-radius: 0;
        }
        #close-rate-limit:disabled { opacity: 0.32; cursor: not-allowed; }

        /* ══ IOS INSTALL PROMPT ══ */
        #iosPrompt {
            position: fixed;
            bottom: calc(env(safe-area-inset-bottom) + 16px);
            left: 16px;
            right: 16px;
            background: var(--bg-2);
            border: 1.5px solid var(--line);
            border-left: 4px solid var(--accent);
            padding: 14px 16px;
            z-index: 8000;
            display: none;
        }
        #iosPrompt p {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 12px;
            color: var(--ink);
            line-height: 1.75;
            margin-bottom: 10px;
        }
        .inline-icon {
            width: 13px;
            height: 13px;
            vertical-align: middle;
            stroke: var(--ink);
        }
        #closePrompt {
            padding: 7px 14px;
            background: var(--ink);
            color: var(--bg);
            border: none;
            font-family: 'IBM Plex Mono', monospace;
            font-size: 11px;
            cursor: pointer;
            border-radius: 0;
        }

        /* ══ NOTIFICATION MODAL ══ */
        #notif-modal {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(26,26,26,0.7);
            z-index: 9300;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.2s, visibility 0.2s;
            -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
        }
        .notif-modal-content {
            background: var(--bg);
            border: 2px solid var(--line);
            padding: 24px 22px;
            max-width: 360px;
            width: 100%;
            box-shadow: 6px 6px 0 var(--line-faint);
        }
        .notif-modal-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 14px;
        }
        .notif-modal-badge {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 9px;
            font-weight: 500;
            background: var(--accent);
            color: #fff;
            padding: 3px 7px;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            flex-shrink: 0;
        }
        .notif-modal-title {
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 15px;
            font-weight: 700;
            letter-spacing: -0.01em;
        }
        .notif-modal-body {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 12px;
            color: var(--ink-2);
            line-height: 1.75;
            margin-bottom: 18px;
            white-space: pre-wrap;
        }
        .notif-modal-footer { display: flex; justify-content: flex-end; }
        #close-notif-modal {
            padding: 10px 20px;
            background: var(--ink);
            color: var(--bg);
            border: none;
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            border-radius: 0;
        }

        /* ══ VERSION MODAL ══ */
        #version-modal {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(26,26,26,0.7);
            z-index: 9300;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.2s, visibility 0.2s;
            -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
        }
        .version-modal-content {
            background: var(--bg);
            border: 2px solid var(--line);
            padding: 24px 22px;
            max-width: 380px;
            width: 100%;
            max-height: 78vh;
            overflow-y: auto;
            box-shadow: 6px 6px 0 var(--line-faint);
        }
        .version-modal-title {
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 18px;
            font-weight: 800;
            letter-spacing: -0.03em;
            margin-bottom: 16px;
        }
        .version-item { margin-bottom: 16px; }
        .version-item-header {
            display: flex;
            align-items: baseline;
            gap: 10px;
            margin-bottom: 8px;
        }
        .version-item-version {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 13px;
            font-weight: 500;
            color: var(--accent);
        }
        .version-item-date {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 11px;
            color: var(--ink-2);
        }
        .version-item-changes {
            list-style: none;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        .version-item-changes li {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 12px;
            color: var(--ink-2);
            line-height: 1.65;
            padding-left: 14px;
            position: relative;
        }
        .version-item-changes li::before {
            content: '—';
            position: absolute;
            left: 0;
            color: var(--accent);
        }
        #close-version-modal {
            margin-top: 16px;
            width: 100%;
            padding: 11px;
            background: transparent;
            border: 1.5px solid var(--line);
            color: var(--ink);
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.12s;
            border-radius: 0;
        }
        #close-version-modal:hover { background: var(--bg-2); }

        /* ══ AGREEMENT MODAL ══ */
        #agreement-modal {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: var(--bg);
            z-index: 10002;
            display: flex;
            flex-direction: column;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.25s ease;
        }
        #agreement-modal.show {
            opacity: 1;
            pointer-events: auto;
        }
        .agreement-modal-content {
            display: flex;
            flex-direction: column;
            height: 100%;
            overflow: hidden;
        }
        .agreement-header {
            padding: calc(18px + env(safe-area-inset-top)) 22px 14px;
            flex-shrink: 0;
            border-bottom: 1px solid var(--line-faint);
            position: relative;
        }
        .agreement-header::before {
            content: '';
            position: absolute;
            left: 0; top: 0; bottom: 0;
            width: 4px;
            background: var(--accent);
        }
        .agreement-title {
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 17px;
            font-weight: 800;
            letter-spacing: -0.02em;
        }
        .agreement-date {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 11px;
            color: var(--ink-2);
            margin-top: 3px;
        }
        .agreement-body {
            flex: 1;
            overflow-y: auto;
            padding: 18px 22px;
            -webkit-overflow-scrolling: touch;
        }
        .agreement-section { margin-bottom: 20px; }
        .agreement-section-title {
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 13px;
            font-weight: 700;
            letter-spacing: -0.01em;
            margin-bottom: 7px;
        }
        .agreement-section-content {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 12px;
            color: var(--ink-2);
            line-height: 1.8;
        }
        .agreement-section-content p { margin-bottom: 8px; }
        .agreement-section-content ul { padding-left: 14px; }
        .agreement-section-content li { margin-bottom: 5px; }
        .agreement-section-content strong { color: var(--ink); font-weight: 500; }
        .agreement-section-content .warning { color: var(--accent); }
        .agreement-section-content a { color: var(--accent); text-decoration: none; }
        .agreement-footer {
            padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
            border-top: 1px solid var(--line-faint);
            flex-shrink: 0;
        }
        .agreement-checkbox {
            margin-bottom: 10px;
            font-family: 'IBM Plex Mono', monospace;
            font-size: 12px;
        }
        .agreement-checkbox label {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
        }
        .agreement-checkbox input[type="checkbox"] {
            width: 15px;
            height: 15px;
            accent-color: var(--accent);
            flex-shrink: 0;
        }
        .agreement-buttons {
            display: grid;
            grid-template-columns: 1fr 1.5fr;
            gap: 10px;
        }
        #agreement-view-footer .agreement-buttons {
            grid-template-columns: 1fr;
        }
        #agreement-decline {
            padding: 13px;
            background: transparent;
            border: 1.5px solid var(--line);
            color: var(--ink);
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            border-radius: 0;
        }
        #agreement-accept {
            padding: 13px;
            background: var(--ink);
            color: var(--bg);
            border: none;
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: opacity 0.15s;
            border-radius: 0;
        }
        #agreement-accept:disabled { opacity: 0.32; cursor: not-allowed; }
        #agreement-close-view {
            width: 100%;
            padding: 13px;
            background: var(--ink);
            color: var(--bg);
            border: none;
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            border-radius: 0;
        }

        /* ══ DECLINED OVERLAY ══ */
        #declined-overlay {
            position: fixed;
            inset: 0;
            background: var(--bg);
            z-index: 10001;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 48px 32px;
            gap: 14px;
            text-align: center;
        }
        .declined-icon {
            width: 48px;
            height: 48px;
            stroke: var(--ink-2);
        }
        .declined-title {
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 22px;
            font-weight: 800;
            letter-spacing: -0.03em;
        }
        .declined-text {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 12px;
            color: var(--ink-2);
            line-height: 1.8;
            max-width: 280px;
        }
        #reopen-agreement {
            margin-top: 8px;
            padding: 13px 28px;
            background: var(--ink);
            color: var(--bg);
            border: none;
            font-family: 'Bricolage Grotesque', sans-serif;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            border-radius: 0;
        }

        /* ══ ENTRY ANIMATIONS ══ */
        @keyframes fadeUp {
            from { opacity: 0; transform: translateY(7px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        #header       { animation: fadeUp 0.35s ease both; }
        .main-content { animation: fadeUp 0.35s ease 0.06s both; }
        #btn-area     { animation: fadeUp 0.35s ease 0.12s both; }
