:root {
    --bg: #060710;
    --bg1: #0a0b16;
    --bg2: #0f1120;
    --bg3: #141628;
    --border: rgba(255, 255, 255, .055);
    --border2: rgba(255, 255, 255, .1);
    --orange: #ff6200;
    --pink: #ff2d78;
    --cyan: #00e5c8;
    --red: #ff5555;
    --txt: #4a5070;
    --txt2: #8090b0;
    --txt3: #d0d8f0;
    --white: #ffffff;
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Inter', sans-serif;
    --disp: 'Syne', sans-serif;
    --nav-h: 54px;
    --tb-h: 50px;
    --sb-h: 34px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

* {
    cursor: none !important;
}

html {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--txt2);
    font-family: var(--sans);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

@media(max-width:700px) {
    body {
        overflow: auto;
        height: auto;
        min-height: 100dvh;
    }
}

/* CURSOR */
#cc {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-family: var(--mono);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1;
    color: var(--orange);
    text-shadow: 0 0 10px rgba(255, 98, 0, .85), 0 0 22px rgba(255, 98, 0, .4);
    transform: translate(-50%, -50%);
    transition: color .15s, text-shadow .15s;
    user-select: none;
    display: none;
}

#cc.on {
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(0, 229, 200, .85), 0 0 22px rgba(0, 229, 200, .4);
}

/* BG */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
    background-size: 52px 52px;
    pointer-events: none;
    z-index: 0;
}

#cv-glow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.scan {
    position: fixed;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 98, 0, .25), transparent);
    opacity: 0;
    animation: scan-a 22s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes scan-a {

    0%,
    100% {
        opacity: 0;
        top: 0;
    }

    8% {
        opacity: .45;
    }

    92% {
        opacity: .45;
    }

    99% {
        opacity: 0;
        top: 100vh;
    }
}

/* NAV */
nav {
    position: relative;
    z-index: 20;
    flex-shrink: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(6, 7, 16, .9);
    backdrop-filter: blur(24px) saturate(180%);
}

.logo {
    font-family: var(--disp);
    font-size: .9rem;
    font-weight: 900;
    letter-spacing: .2em;
    color: var(--white);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-dot {
    color: var(--cyan);
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: .6rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(0, 229, 200, .06);
    border: 1px solid rgba(0, 229, 200, .18);
    color: var(--cyan);
}

.pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 5px var(--cyan);
    animation: pdot 2s ease-in-out infinite;
}

@keyframes pdot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .25;
    }
}

.nav-back {
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 500;
    color: var(--txt);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color .2s;
}

.nav-back:hover {
    color: var(--txt3);
}

.nav-back svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* TOOLBAR */
.toolbar {
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    height: var(--tb-h);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 11, 22, .8);
    backdrop-filter: blur(12px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.toolbar::-webkit-scrollbar {
    display: none;
}

.tb-group {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.tb-sep {
    width: 1px;
    height: 20px;
    background: var(--border2);
    flex-shrink: 0;
    margin: 0 3px;
}

.tb-lbl {
    font-family: var(--mono);
    font-size: .58rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--txt);
    white-space: nowrap;
    flex-shrink: 0;
}

.tb-input {
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--txt3);
    font-family: var(--mono);
    font-size: .7rem;
    padding: 4px 9px;
    border-radius: 6px;
    outline: none;
    height: 28px;
    transition: border-color .2s, box-shadow .2s;
}

.tb-input:focus {
    border-color: rgba(255, 98, 0, .45);
    box-shadow: 0 0 0 2px rgba(255, 98, 0, .07);
}

select.tb-input option {
    background: var(--bg1);
}

#enc-key {
    width: 92px;
}

#passes {
    width: 148px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 27px;
    padding: 0 10px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: .58rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--txt);
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .18s;
}

.chip-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--txt);
    transition: all .18s;
}

.chip.on {
    color: var(--cyan);
    border-color: rgba(0, 229, 200, .3);
    background: rgba(0, 229, 200, .05);
}

.chip.on .chip-dot {
    background: var(--cyan);
    box-shadow: 0 0 5px rgba(0, 229, 200, .8);
}

.chip input {
    display: none;
}

.btn-run {
    height: 30px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    border-radius: 7px;
    background: linear-gradient(110deg, var(--orange), var(--pink));
    color: #fff;
    border: none;
    font-family: var(--sans);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    transition: opacity .15s, transform .12s, box-shadow .18s;
}

.btn-run::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
    transform: translateX(-150%);
    transition: transform .5s ease;
}

.btn-run:hover::after {
    transform: translateX(150%);
}

.btn-run:hover {
    opacity: .88;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 60, 60, .45);
}

.btn-run:disabled {
    opacity: .3;
    pointer-events: none;
}

.spinner {
    display: none;
    width: 11px;
    height: 11px;
    border: 1.5px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .55s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-run.busy .spinner {
    display: block;
}

.btn-run.busy .btn-lbl {
    display: none;
}

.btn-run svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* WORKSPACE */
.workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    position: relative;
    z-index: 2;
    min-height: 0;
}

@media(max-width:700px) {
    .workspace {
        grid-template-columns: 1fr;
        grid-template-rows: min-content min-content;
        overflow: visible;
    }
}

/* PANES */
.pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border);
    min-height: 0;
    position: relative;
}

.pane:last-child {
    border-right: none;
}

@media(max-width:700px) {
    .pane {
        border-right: none;
        border-bottom: 1px solid var(--border);
        height: 50vh;
        min-height: 280px;
    }

    .pane:last-child {
        border-bottom: none;
    }
}

.pane-hd {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 40px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, .2);
    backdrop-filter: blur(8px);
}

.pane-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.mac-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.mac-dots span {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mc1 {
    background: #ff5f57;
}

.mc2 {
    background: #febc2e;
}

.mc3 {
    background: #28c840;
}

.file-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-size: .6rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 5px;
}

.file-tag.src {
    color: var(--orange);
    background: rgba(255, 98, 0, .07);
    border: 1px solid rgba(255, 98, 0, .18);
}

.file-tag.out {
    color: var(--cyan);
    background: rgba(0, 229, 200, .07);
    border: 1px solid rgba(0, 229, 200, .18);
}

.file-tag-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.file-tag.src .file-tag-dot {
    background: var(--orange);
}

.file-tag.out .file-tag-dot {
    background: var(--cyan);
    box-shadow: 0 0 4px var(--cyan);
}

.pane-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pane-meta {
    font-family: var(--mono);
    font-size: .57rem;
    color: var(--txt);
    white-space: nowrap;
}

.btn-sm {
    height: 22px;
    padding: 0 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--border2);
    color: var(--txt);
    font-family: var(--mono);
    font-size: .57rem;
    letter-spacing: .04em;
    transition: all .18s;
    white-space: nowrap;
}

.btn-sm:hover {
    background: rgba(255, 255, 255, .065);
    border-color: rgba(255, 98, 0, .3);
    color: var(--orange);
}

.btn-sm.c:hover {
    border-color: rgba(0, 229, 200, .3);
    color: var(--cyan);
}

.pane-prog {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--orange), var(--cyan));
    transform: scaleX(0);
    transform-origin: left;
    z-index: 5;
}

.pane-prog.run {
    animation: prog 1.4s ease-in-out infinite;
}

@keyframes prog {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }

    48% {
        transform: scaleX(.8);
        transform-origin: left;
    }

    50% {
        transform: scaleX(.8);
        transform-origin: right;
    }

    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

/* EDITOR — Monaco fills this */
.editor-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}

#monaco-editor {
    width: 100%;
    height: 100%;
}

/* OUTPUT */
.out-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}

#out-monaco {
    width: 100%;
    height: 100%;
}

/* STATUS BAR */
.statusbar {
    flex-shrink: 0;
    height: var(--sb-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, .3);
    backdrop-filter: blur(8px);
    font-family: var(--mono);
    font-size: .6rem;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

@media(max-width:700px) {
    .statusbar {
        height: auto;
        padding: 8px 16px;
        flex-wrap: wrap;
    }
}

.sd-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--txt);
    transition: background .25s, box-shadow .25s;
}

.sd-led.ok {
    background: var(--cyan);
    box-shadow: 0 0 6px rgba(0, 229, 200, .8);
}

.sd-led.err {
    background: var(--red);
    box-shadow: 0 0 6px rgba(255, 85, 85, .8);
}

.sd-led.busy {
    background: var(--orange);
    animation: ledpulse .65s infinite;
}

@keyframes ledpulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .15;
    }
}

.sd-msg {
    flex: 1;
    color: var(--txt);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-stats {
    display: none;
    align-items: center;
    gap: 14px;
    color: var(--txt);
    flex-shrink: 0;
}

.sd-stats.show {
    display: flex;
}

.sd-stats b {
    color: var(--orange);
}

.sd-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: calc(var(--sb-h) + 10px);
    right: 18px;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-left: 2px solid var(--cyan);
    padding: 10px 15px;
    font-family: var(--mono);
    font-size: .66rem;
    color: var(--txt2);
    transform: translateX(calc(100% + 26px));
    transition: transform .32s cubic-bezier(.34, 1.46, .64, 1);
    z-index: 2000;
    max-width: 300px;
    border-radius: 9px;
    box-shadow: 0 12px 44px rgba(0, 0, 0, .6);
    backdrop-filter: blur(14px);
    pointer-events: none;
}

.toast.show {
    transform: translateX(0);
}

.toast.err {
    border-left-color: var(--red);
}

@media(max-width:700px) {
    .toast {
        bottom: auto;
        top: 66px;
        right: 14px;
        left: 14px;
        max-width: none;
    }
}

/* MOBILE TABS */
.mob-tabs {
    display: none;
    flex-shrink: 0;
    height: 40px;
    border-bottom: 1px solid var(--border);
    background: var(--bg1);
    position: relative;
    z-index: 5;
}

@media(max-width:700px) {
    .mob-tabs {
        display: flex;
    }
}

.mob-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    border: none;
    background: transparent;
    color: var(--txt);
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}

.mob-tab.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
}

/* KBD HINT */
.kbd-hint {
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-family: var(--mono);
    font-size: .55rem;
    letter-spacing: .06em;
    color: var(--txt);
    opacity: .35;
    pointer-events: none;
    z-index: 4;
}

.kbd-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    font-family: var(--mono);
    font-size: .55rem;
}

@media(max-width:700px) {
    .kbd-hint {
        display: none;
    }
}