:root,
html[data-theme="dark"] {
    --nx-bg: #070b14;
    --nx-card: #101826;
    --nx-card-2: #0b1220;
    --nx-line: rgba(148, 163, 184, 0.16);
    --nx-glow: rgba(45, 212, 191, 0.18);
    --nx-hero-1: rgba(45, 212, 191, 0.16);
    --nx-hero-2: rgba(129, 140, 248, 0.14);
    --nx-kicker: #2dd4bf;
    --nx-muted: #94a3b8;
    --nx-pre: #0b1220;
    --nx-drop: rgba(45, 212, 191, 0.04);
    --nx-drop-border: rgba(45, 212, 191, 0.35);
    --nx-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    --nx-text: #e8eef7;
    color-scheme: dark;
}

html[data-theme="light"] {
    --nx-bg: #f1f5f9;
    --nx-card: #ffffff;
    --nx-card-2: #f8fafc;
    --nx-line: rgba(15, 23, 42, 0.12);
    --nx-glow: rgba(15, 118, 110, 0.12);
    --nx-hero-1: rgba(15, 118, 110, 0.12);
    --nx-hero-2: rgba(67, 56, 202, 0.08);
    --nx-kicker: #0f766e;
    --nx-muted: #64748b;
    --nx-pre: #e2e8f0;
    --nx-drop: rgba(15, 118, 110, 0.06);
    --nx-drop-border: rgba(15, 118, 110, 0.4);
    --nx-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    --nx-text: #0f172a;
    color-scheme: light;
}

html, body {
    min-height: 100dvh;
    margin: 0;
    background: var(--nx-bg);
    color: var(--nx-text);
}

.mud-layout,
.nx-shell {
    min-height: 100dvh;
    background-color: var(--nx-bg) !important;
}

.mud-main-content {
    flex: 1 1 auto;
    min-height: calc(100dvh - var(--mud-appbar-height, 64px));
    background-color: var(--nx-bg) !important;
}

.mud-drawer {
    background-color: var(--nx-card-2) !important;
}

.mud-tabs,
.mud-tabs-panels,
.mud-tab-panels {
    background-color: transparent;
}

.nx-logo {
    display: block;
    height: 32px;
    width: auto;
    max-width: 168px;
    object-fit: contain;
}

.nx-mono {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.nx-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--nx-line);
    background:
        radial-gradient(900px 280px at 10% -10%, var(--nx-hero-1), transparent 55%),
        radial-gradient(700px 240px at 100% 0%, var(--nx-hero-2), transparent 50%),
        linear-gradient(180deg, var(--nx-card) 0%, var(--nx-card-2) 100%);
}

.nx-hero::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% 40%;
    height: 180px;
    background: radial-gradient(circle, var(--nx-glow), transparent 70%);
    pointer-events: none;
}

.nx-card {
    height: 100%;
    border: 1px solid var(--nx-line) !important;
    background: linear-gradient(180deg, var(--nx-card), var(--nx-card-2)) !important;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nx-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--nx-kicker) 55%, var(--nx-line)) !important;
    box-shadow: var(--nx-shadow);
}

.nx-qr {
    display: block;
    width: min(100%, 220px);
    height: auto;
    aspect-ratio: 1;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
}

.nx-captcha {
    display: block;
    width: 100%;
    max-width: 260px;
    height: 88px;
    border-radius: 12px;
    border: 1px solid var(--nx-line);
    background: #e8eef4;
    user-select: none;
    -webkit-user-drag: none;
}

.nx-kicker {
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--nx-kicker);
}

.nx-totp {
    font-family: "IBM Plex Mono", monospace;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 600;
    letter-spacing: 0.28em;
    line-height: 1;
}

.nx-totp-side {
    font-family: "IBM Plex Mono", monospace;
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    font-weight: 500;
    letter-spacing: 0.18em;
    line-height: 1;
    opacity: 0.55;
}

.nx-drop {
    border: 1.5px dashed var(--nx-drop-border);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    background: var(--nx-drop);
    cursor: pointer;
}

.nx-drop:hover {
    border-color: var(--nx-kicker);
}

.nx-break {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.nx-ellipsis {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nx-md {
    font-size: 0.98rem;
    line-height: 1.7;
}

.nx-md pre, .nx-md code {
    font-family: "IBM Plex Mono", monospace;
}

.nx-md pre {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--nx-pre);
    overflow: auto;
}

.nx-md img {
    max-width: 100%;
    border-radius: 10px;
}

.nx-md table {
    width: 100%;
    border-collapse: collapse;
}

.nx-md th, .nx-md td {
    border: 1px solid var(--nx-line);
    padding: 8px 10px;
}

.nx-kv {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 8px 16px;
}

.nx-kv dt {
    color: var(--nx-muted);
    font-size: 0.82rem;
}

.nx-kv dd {
    margin: 0;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.86rem;
    word-break: break-word;
}

.nx-score {
    font-family: "IBM Plex Mono", monospace;
    font-size: 2.4rem;
    font-weight: 650;
}

.nx-map {
    width: 100%;
    min-height: 220px;
    border: 0;
    border-radius: 12px;
    background: var(--nx-pre);
}

@media (max-width: 600px) {
    .nx-kv {
        grid-template-columns: 1fr;
        gap: 2px 0;
    }
}
