body{margin:0;background:#f3f4f6;color:#111827;font-family:Arial,sans-serif}
.top{background:#111827;color:#fff;padding:14px 22px;display:flex;justify-content:space-between;align-items:center}
.top span{margin-left:10px;color:#cbd5e1;font-size:13px}
.top a{color:#fff;text-decoration:none;margin-left:16px;font-weight:bold}
.wrap{max-width:1180px;margin:24px auto;background:#fff;border:1px solid #e5e7eb;padding:22px;box-shadow:0 10px 28px rgba(15,23,42,.08)}
h1{margin-top:0}
.card{border:1px solid #e5e7eb;background:#f9fafb;border-radius:10px;padding:16px;margin:14px 0}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}
input,textarea,select{width:100%;box-sizing:border-box;padding:10px;border:1px solid #cbd5e1;border-radius:6px;margin:6px 0 14px}
button,.btn{display:inline-block;background:#f16624;color:#fff;border:0;border-radius:7px;padding:11px 16px;text-decoration:none;font-weight:bold;cursor:pointer}
.btn.secondary{background:#0f4c81}
.alert{background:#fff7ed;border-left:5px solid #f16624;padding:12px;margin:14px 0}
.block{border-radius:8px;margin:14px 0;overflow:hidden;border:1px solid #d1d5db}
.block h3{margin:0;padding:10px 14px;background:#e5e7eb;font-size:14px}
.block .body{padding:14px;white-space:pre-wrap;line-height:1.5}
.user h3{background:#dbeafe}
.assistant h3{background:#f3f4f6}
.command h3{background:#111827;color:#fff}
.command .body{background:#0f172a;color:#e5e7eb;font-family:monospace}
.output h3{background:#dcfce7}
.error h3{background:#fee2e2}
.small{font-size:12px;color:#64748b}
table{width:100%;border-collapse:collapse}
td,th{border-bottom:1px solid #e5e7eb;padding:9px;text-align:left}

/* ===== Login premium Nexus Memory ===== */
body:has(.login-screen){
    min-height:100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(59,130,246,.18), transparent 28%),
        radial-gradient(circle at 80% 10%, rgba(249,115,22,.16), transparent 30%),
        linear-gradient(135deg,#f8fafc 0%,#eef2ff 45%,#fff7ed 100%);
}

body:has(.login-screen) .top{
    display:none;
}

body:has(.login-screen) .wrap{
    max-width:none;
    margin:0;
    padding:0;
    border:0;
    box-shadow:none;
    background:transparent;
    min-height:100vh;
}

.login-screen{
    min-height:100vh;
    display:grid;
    grid-template-columns:1.05fr .95fr;
    align-items:center;
    overflow:hidden;
}

.login-visual{
    position:relative;
    min-height:100vh;
    padding:70px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    color:#fff;
    background:
        linear-gradient(135deg,rgba(15,23,42,.94),rgba(30,64,175,.82)),
        radial-gradient(circle at 30% 25%,rgba(249,115,22,.8),transparent 32%),
        radial-gradient(circle at 75% 70%,rgba(59,130,246,.85),transparent 35%);
    isolation:isolate;
}

.login-visual:before{
    content:"";
    position:absolute;
    inset:0;
    background:
        linear-gradient(120deg,rgba(255,255,255,.12) 0 1px,transparent 1px 80px),
        linear-gradient(30deg,rgba(255,255,255,.08) 0 1px,transparent 1px 90px);
    opacity:.28;
    z-index:-1;
}

.login-logo-badge{
    width:82px;
    height:82px;
    border-radius:24px;
    display:grid;
    place-items:center;
    background:rgba(255,255,255,.14);
    border:1px solid rgba(255,255,255,.24);
    box-shadow:0 22px 70px rgba(0,0,0,.22);
    backdrop-filter:blur(14px);
    margin-bottom:34px;
}

.login-logo-badge span{
    font-size:42px;
    font-weight:900;
    letter-spacing:-2px;
}

.login-visual-content{
    max-width:560px;
    position:relative;
    z-index:2;
}

.login-kicker{
    margin:0 0 10px;
    color:#f97316;
    font-size:12px;
    font-weight:900;
    letter-spacing:.18em;
    text-transform:uppercase;
}

.login-visual .login-kicker{
    color:#fed7aa;
}

.login-visual h1{
    margin:0 0 18px;
    font-size:58px;
    line-height:.96;
    letter-spacing:-.06em;
}

.login-visual p{
    margin:0;
    max-width:500px;
    font-size:18px;
    line-height:1.65;
    color:rgba(255,255,255,.82);
}

.login-orbit{
    position:absolute;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.18);
    box-shadow:inset 0 0 40px rgba(255,255,255,.08);
}

.login-orbit-one{
    width:360px;
    height:360px;
    right:-120px;
    top:80px;
}

.login-orbit-two{
    width:220px;
    height:220px;
    left:55px;
    bottom:80px;
}

.login-orbit-three{
    width:120px;
    height:120px;
    right:100px;
    bottom:120px;
    background:rgba(249,115,22,.16);
}

.login-panel{
    padding:48px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.login-card{
    width:100%;
    max-width:430px;
    background:rgba(255,255,255,.92);
    border:1px solid rgba(226,232,240,.95);
    border-radius:28px;
    padding:34px;
    box-shadow:0 30px 90px rgba(15,23,42,.15);
    backdrop-filter:blur(18px);
}

.login-card-header h2{
    margin:0 0 8px;
    color:#111827;
    font-size:30px;
    letter-spacing:-.04em;
}

.login-card-header p{
    margin:0 0 24px;
    color:#64748b;
    line-height:1.55;
}

.login-form label{
    display:block;
    margin:14px 0 7px;
    color:#334155;
    font-size:13px;
    font-weight:800;
}

.login-form input{
    margin:0;
    padding:14px 15px;
    border-radius:13px;
    border:1px solid #cbd5e1;
    background:#f8fafc;
    font-size:15px;
    transition:.18s ease;
}

.login-form input:focus{
    outline:0;
    border-color:#f97316;
    background:#fff;
    box-shadow:0 0 0 4px rgba(249,115,22,.13);
}

.login-form button{
    width:100%;
    margin-top:22px;
    padding:14px 18px;
    border-radius:14px;
    background:linear-gradient(135deg,#f97316,#ea580c);
    box-shadow:0 14px 32px rgba(234,88,12,.28);
    font-size:15px;
}

.login-footnote{
    margin:22px 0 0;
    text-align:center;
    color:#94a3b8;
    font-size:12px;
}

body:has(.login-screen) .alert{
    border:0;
    border-radius:14px;
    background:#fff7ed;
    color:#9a3412;
    box-shadow:inset 0 0 0 1px #fed7aa;
}

@media(max-width:900px){
    .login-screen{
        grid-template-columns:1fr;
    }

    .login-visual{
        min-height:auto;
        padding:42px 26px;
    }

    .login-visual h1{
        font-size:40px;
    }

    .login-panel{
        padding:26px;
    }

    .login-card{
        padding:26px;
        border-radius:22px;
    }
}
