/* WEB PANEL PROXY public CSS */
:root {
            --bg: #eef1f4;
            --surface: #ffffff;
            --ink: #16212b;
            --muted: #5d6b79;
            --line: #d5dce3;
            --ok: #178a5c;
            --ok-soft: #dff3ea;
        }
        @media (prefers-color-scheme: dark) {
            :root:not([data-theme="light"]) {
                --bg: #0f161d;
                --surface: #17202a;
                --ink: #e8eef3;
                --muted: #8d9bab;
                --line: #2a3643;
                --ok: #3ecf8e;
                --ok-soft: #173a2d;
            }
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }

        html, body { height: 100%; }

        body {
            font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background: var(--bg);
            color: var(--ink);
            display: grid;
            place-items: center;
            padding: 24px;
            padding-top: max(24px, env(safe-area-inset-top, 0px));
            padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
            -webkit-font-smoothing: antialiased;
        }

        .card {
            width: 100%;
            max-width: 420px;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: 24px;
            padding: 36px 32px 28px;
            display: flex;
            flex-direction: column;
            gap: 18px;
        }

        .head {
            display: flex;
            align-items: center;
            gap: 18px;
        }

        .logo {
            width: 52px;
            height: 52px;
            flex: none;
            color: var(--ink);
        }

        h1 {
            font-size: 1.5rem;
            font-weight: 600;
            letter-spacing: -0.02em;
            line-height: 1.2;
        }

        .host {
            margin-top: 4px;
            font-size: 0.875rem;
            color: var(--muted);
            overflow-wrap: anywhere;
        }

        .status {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 16px;
            border-radius: 14px;
            background: var(--ok-soft);
            color: var(--ok);
            font-weight: 500;
            font-size: 0.9375rem;
        }

        .dot {
            position: relative;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: currentColor;
            flex: none;
        }
        .dot::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background: currentColor;
            animation: ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
        }
        @keyframes ping {
            0% { transform: scale(1); opacity: 0.6; }
            80%, 100% { transform: scale(3); opacity: 0; }
        }

        dl {
            display: grid;
            grid-template-columns: 1fr auto;
            row-gap: 14px;
            font-size: 0.875rem;
            border-top: 1px solid var(--line);
            padding-top: 20px;
        }
        dt { color: var(--muted); }
        dd { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

        [hidden] { display: none !important; }

        button { font-family: inherit; color: inherit; cursor: pointer; }
        button:focus-visible, a:focus-visible, input:focus-visible {
            outline: 2px solid var(--ok);
            outline-offset: 2px;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 14px 18px;
            border-radius: 14px;
            border: 1px solid var(--line);
            background: transparent;
            font-size: 0.9375rem;
            font-weight: 500;
            text-decoration: none;
            transition: background-color 0.15s, border-color 0.15s;
        }
        .btn:hover { border-color: var(--muted); }
        .btn-primary {
            background: var(--ink);
            color: var(--surface);
            border-color: var(--ink);
        }
        .btn-primary:hover { background: var(--ink); opacity: 0.88; border-color: var(--ink); }

        dialog {
            width: calc(100% - 32px);
            max-width: 400px;
            margin: auto;
            padding: 20px 20px 22px;
            border: 1px solid var(--line);
            border-radius: 24px;
            background: var(--surface);
            color: var(--ink);
        }
        dialog::backdrop { background: rgba(10, 16, 22, 0.55); }

        .dlg-head {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 16px;
        }
        .dlg-head h2 {
            flex: 1;
            font-size: 1.0625rem;
            font-weight: 600;
            letter-spacing: -0.01em;
        }
        .icon {
            width: 36px;
            height: 36px;
            display: grid;
            place-items: center;
            border: none;
            border-radius: 10px;
            background: transparent;
        }
        .icon:hover { background: var(--bg); }
        .icon[hidden] { display: none; }
        .icon svg { width: 20px; height: 20px; }

        .choose { display: flex; flex-direction: column; gap: 10px; }
        .opt {
            display: flex;
            align-items: center;
            gap: 12px;
            width: 100%;
            padding: 14px 16px;
            text-align: left;
            border: 1px solid var(--line);
            border-radius: 14px;
            background: transparent;
            transition: border-color 0.15s, background-color 0.15s;
        }
        .opt:hover { border-color: var(--ok); background: var(--bg); }
        .opt-text { flex: 1; min-width: 0; }
        .opt-title { display: block; font-size: 0.9375rem; font-weight: 500; }
        .opt-hint { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--muted); }
        .opt svg { width: 18px; height: 18px; color: var(--muted); flex: none; }

        .qr-step { display: flex; flex-direction: column; align-items: center; gap: 16px; }
        .qr {
            width: 224px;
            height: 224px;
            padding: 12px;
            border-radius: 16px;
            background: #fff;
            display: grid;
            place-items: center;
        }
        .qr svg { width: 100%; height: 100%; display: block; }
        .qr-note { font-size: 0.8125rem; color: var(--muted); text-align: center; }
        .qr-error { color: #8a5a00; font-size: 0.8125rem; text-align: center; }

        .link-field {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--line);
            border-radius: 12px;
            background: var(--bg);
            color: var(--muted);
            font-size: 0.8125rem;
            text-overflow: ellipsis;
        }
        .actions { display: flex; gap: 10px; width: 100%; }
        .actions .btn { flex: 1; }

        @media (max-width: 400px) {
            .card { padding: 28px 22px 22px; }
            h1 { font-size: 1.25rem; }
            .logo { width: 44px; height: 44px; }
        }

        @media (prefers-reduced-motion: reduce) {
            .dot::after { animation: none; }
        }