:root {
    --bg: #0b0f14;
    --card: #0f141b;
    --ink: #e7f0ff;
    --muted: #99a7bd;
    --line: #1c2430;
    --accent: #64d2ff;
    --accent2: #9b66ff;
    --ok: #28d198;
    --err: #ff6b6b;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, Segoe UI,
        Roboto, "Helvetica Neue", Arial;
    background: radial-gradient(1200px 600px at 10% 110%,
            rgba(0, 255, 170, 0.18),
            transparent 60%),
        radial-gradient(1200px 600px at 100% -10%,
            rgba(130, 0, 255, 0.16),
            transparent 60%),
        linear-gradient(180deg, #0b0f14 0%, #0a121a 100%);
    min-height: 100%;
}

.wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.card {
    width: min(980px, 100%);
    background: color-mix(in oklab, var(--card) 92%, black);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
}

header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Logo slot (square at the left) */
.logo-slot {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    background: conic-gradient(from 160deg,
            var(--accent),
            var(--accent2),
            var(--accent));
    box-shadow: 0 0 24px rgba(121, 106, 255, 0.35),
        inset 0 0 12px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-slot img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

h1 {
    font-size: 18px;
    margin: 0;
}

.hint {
    color: var(--muted);
    margin: 0;
    font-size: 13px;
}

.grid {
    display: grid;
    gap: 12px;
}

.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .two {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 6px 2px;
}

input {
    width: 100%;
    background: #0a0f15;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 11px 12px;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

input:focus {
    border-color: color-mix(in oklab,
            var(--accent) 70%,
            var(--accent2) 30%);
    box-shadow: 0 0 0 3px rgba(100, 210, 255, 0.15);
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 12px 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(90deg,
            color-mix(in oklab, var(--accent) 70%, #3ad),
            var(--accent2));
    box-shadow: 0 8px 24px rgba(110, 110, 255, 0.28);
    transition: transform 0.06s ease, filter 0.18s ease;
}

.btn:hover {
    filter: brightness(1.08);
}

.btn:active {
    transform: translateY(1px);
}

.btn.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}

.section {
    border-top: 1px dashed var(--line);
    margin: 14px 0;
    padding-top: 14px;
}

.status {
    font-size: 13px;
}

.status.ok {
    color: var(--ok);
}

.status.err {
    color: var(--err);
}

.footer {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.switch {
    position: relative;
    width: 48px;
    height: 28px;
    background: #1a2330;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid var(--line);
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e6f0ff;
    transition: 0.18s;
}

.switch.on {
    background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.switch.on::after {
    transform: translateX(20px);
    background: white;
}

.tag-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

/* Loading toast (bottom-left spinner) */
.loading-toast {
    position: fixed;
    left: 16px;
    bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: rgba(17, 24, 39, 0.92);
    color: #e5e7eb;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
}

.loading-toast[hidden] {
    display: none;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #9ca3af;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}