:root {
    color-scheme: dark;

    --bg-0:   #0a0a0b;
    --bg-1:   #111113;
    --bg-2:   #17181b;
    --bg-3:   #1c1d20;
    --bg-4:   #232428;

    --border:        rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.10);
    --border-soft:   rgba(255, 255, 255, 0.04);

    --text:       #e5e7eb;
    --text-dim:   #9ca3af;
    --text-muted: #6b7280;

    --purple-100: #ede9fe;
    --purple-200: #ddd6fe;
    --purple-300: #c4b5fd;
    --purple-400: #a78bfa;
    --purple-500: #8b5cf6;
    --purple-600: #7c3aed;
    --purple-700: #6d28d9;

    --accent:        var(--purple-400);
    --accent-hover:  var(--purple-300);
    --accent-soft:   rgba(167, 139, 250, 0.10);
    --accent-line:   rgba(167, 139, 250, 0.25);

    --danger:        #f87171;
    --danger-soft:   rgba(248, 113, 113, 0.10);
    --warning:       #fbbf24;
    --success:       #10b981;

    --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 50px -25px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 0 1px rgba(167, 139, 250, 0.15);

    --radius:   12px;
    --radius-s: 8px;
    --radius-xs: 6px;

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --topbar-h: 48px;
    --statusbar-h: 24px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg-0);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-feature-settings: "cv11", "ss01", "ss03";
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: var(--purple-400); text-decoration: none; }
a:hover { color: var(--purple-200); }

button { font: inherit; color: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 6px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: var(--radius-s);
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: -0.005em;
    transition: background .15s var(--ease), border-color .15s var(--ease),
                transform .12s var(--ease), box-shadow .15s var(--ease), color .15s var(--ease);
}
.btn:hover { background: var(--bg-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.btn-primary {
    background: var(--purple-500);
    border-color: rgba(255,255,255,0.10);
    color: white;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.15) inset,
        0 1px 2px rgba(0,0,0,0.3);
}
.btn-primary:hover { background: var(--purple-400); border-color: rgba(255,255,255,0.15); color: white; }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--border-strong); color: var(--text); }

.btn-danger-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: rgba(248,113,113,0.30); color: #fca5a5; }

.btn-block { width: 100%; justify-content: center; padding: 10px; font-size: 13.5px; }

.btn-icon {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.btn-icon:hover { background: var(--bg-2); color: var(--text); border-color: var(--border); }
.btn-icon:active { background: var(--bg-3); }

input[type="text"], input[type="password"], input[type="number"], input[type="email"], textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input::placeholder { color: var(--text-muted); }
input:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, textarea:focus {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

label { font-size: 13px; color: var(--text-dim); }

.dim { color: var(--text-muted); }

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg-0);
}
.login-bg { display: none; }

.login-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-2);
    animation: fadeIn .4s var(--ease) both;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.login-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}
.login-header .icon-wrap {
    width: 48px; height: 48px;
    margin: 0 auto 16px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    color: var(--text-dim);
}
.login-header h1 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--text);
}
.login-header p {
    margin: 0;
    color: var(--text-dim);
    font-size: 13.5px;
    line-height: 1.55;
}
.login-form {
    padding: 20px 28px;
    display: grid; gap: 14px;
}
.login-form .row { display: grid; grid-template-columns: 3fr 1fr; gap: 12px; }
.login-form .row.checks { grid-template-columns: 1fr 1fr; }
.login-form .field { display: grid; gap: 6px; }
.login-form .pwd-wrap { position: relative; }
.login-form .pwd-toggle {
    position: absolute; right: 4px; top: 50%;
    transform: translateY(-50%);
    width: 28px; height: 28px;
    background: transparent; border: 0; color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
}
.login-form .pwd-toggle:hover { background: var(--bg-3); color: var(--text); }
.login-form .check {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--text-dim); font-size: 13px;
    user-select: none;
    cursor: pointer;
}
.login-form .check input { accent-color: var(--purple-500); }
.login-footer {
    padding: 12px 28px 16px;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.015);
    text-align: center;
    font-size: 11.5px;
    letter-spacing: 0.01em;
    color: var(--text-muted);
}

.hint {
    margin: -4px 0 2px;
    font-size: 12px;
    color: var(--text-muted);
}
.hint code {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-dim);
}

.spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    display: inline-block;
    margin-left: 8px;
    vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg) } }
button[disabled] { opacity: .8; cursor: wait; }

.alert {
    margin: 16px 28px 0;
    padding: 10px 12px;
    border-radius: var(--radius-s);
    font-size: 12.5px;
    line-height: 1.5;
}
.alert-error {
    background: var(--danger-soft);
    border: 1px solid rgba(248, 113, 113, 0.20);
    color: #fca5a5;
}

.ide-body {
    display: grid;
    grid-template-rows: var(--topbar-h) 1fr;
    height: 100vh; overflow: hidden;
}

.topbar {
    height: var(--topbar-h);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    padding: 0 14px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    gap: 14px;
}
.topbar-left  { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-center { display: flex; align-items: center; gap: 6px; justify-self: stretch; }
.topbar-right { display: flex; align-items: center; gap: 4px; justify-self: end; }

.brand {
    display: inline-flex; align-items: center; gap: 9px;
    font-weight: 600; font-size: 13.5px;
    letter-spacing: -0.005em;
    color: var(--text);
}

.conn-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 9px;
    border: 1px solid var(--border);
    background: var(--bg-2);
    border-radius: 6px;
    font-size: 11.5px;
    font-family: var(--font-mono);
    color: var(--text-dim);
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.conn-pill:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg-3); }
.conn-pill .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}
.conn-user { color: var(--text); }
.conn-at   { color: var(--text-muted); margin: 0 -2px; }
.conn-eye  { display: none; }
.conn-pill.is-masked .conn-host {
    filter: blur(4px);
    user-select: none;
    transition: filter .25s var(--ease);
}
.conn-pill:not(.is-masked) .conn-host {
    filter: none;
    color: var(--text);
}
.conn-pill.is-masked:hover .conn-host { filter: blur(3px); }

.path-input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 6px 12px;
    background: var(--bg-2);
    border-color: var(--border);
}

.workspace {
    display: grid;
    grid-template-columns: 280px 4px 1fr;
    overflow: hidden;
    min-height: 0;
}
.workspace.sidebar-collapsed {
    grid-template-columns: 0 0 1fr;
}
.workspace.sidebar-collapsed .sidebar,
.workspace.sidebar-collapsed .resizer { display: none; }

.sidebar {
    display: grid;
    grid-template-rows: 36px 1fr 22px;
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    min-width: 200px;
}
.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 10px 0 14px;
    border-bottom: 1px solid var(--border);
}
.sidebar-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}
.sidebar-actions { display: flex; gap: 2px; }
.sidebar-footer {
    padding: 0 10px;
    border-top: 1px solid var(--border-soft);
    display: flex; align-items: center;
    font-size: 11px; color: var(--text-muted);
}
.tree-wrap {
    overflow: auto;
    padding: 6px 4px 12px;
}

.tree, .tree ul {
    list-style: none;
    margin: 0; padding: 0;
}
.tree ul { padding-left: 14px; }
.tree-node {
    user-select: none;
}
.tree-row {
    display: flex; align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 6px;
    border-radius: 5px;
    cursor: pointer;
    color: var(--text-dim);
    white-space: nowrap;
    transition: background .12s var(--ease), color .12s var(--ease);
    position: relative;
}
.tree-row:hover { background: var(--bg-2); color: var(--text); }
.tree-row.selected {
    background: var(--bg-3);
    color: var(--text);
}
.tree-row .twisty {
    width: 14px; display: inline-flex; justify-content: center;
    color: var(--text-muted);
    font-size: 9px;
    transition: transform .12s ease;
}
.tree-row .twisty.empty { visibility: hidden; }
.tree-node.open > .tree-row .twisty { transform: rotate(90deg); color: var(--text-dim); }
.tree-row .icon {
    width: 16px; display: inline-flex; justify-content: center;
    font-size: 12px;
}
.tree-row .name {
    overflow: hidden; text-overflow: ellipsis;
    font-size: 13px;
}
.tree-row .meta {
    margin-left: auto;
    font-size: 11px; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.tree-row.dir   .icon { color: var(--text); }
.tree-row.file  .icon { color: var(--text-muted); }
.tree-row.link  .icon { color: var(--warning); }
.tree-row.loading { color: var(--text-muted); font-style: italic; pointer-events: none; }

.resizer {
    background: var(--border);
    cursor: col-resize;
    transition: background .15s var(--ease);
    position: relative;
}
.resizer::before {
    content: ""; position: absolute; inset: 0 -2px;
}
.resizer:hover, .resizer.dragging { background: var(--border-strong); }

.main-area {
    display: grid;
    grid-template-rows: 36px 1fr var(--statusbar-h);
    min-width: 0;
    background: var(--bg-0);
}

.tabs {
    display: flex; align-items: center;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: thin;
    height: 36px;
    padding: 0;
}
.tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0 12px;
    height: 100%;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--border);
    cursor: pointer;
    font-size: 12.5px;
    color: var(--text-dim);
    white-space: nowrap;
    position: relative;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.tab:hover { color: var(--text); background: var(--bg-2); }
.tab.active {
    background: var(--bg-0);
    color: var(--text);
}
.tab.active::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
    background: var(--purple-400);
}
.tab.dirty .name::after {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--text-dim);
    vertical-align: middle;
}
.tab.saving .name::after {
    content: "";
    display: inline-block;
    width: 10px; height: 10px;
    margin-left: 6px;
    border-radius: 50%;
    border: 1.5px solid var(--text-dim);
    border-top-color: transparent;
    animation: spin .8s linear infinite;
    vertical-align: -1px;
    background: transparent;
}
.tab .close {
    width: 16px; height: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 12px; line-height: 1;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.tab .close:hover { background: var(--bg-3); color: var(--text); }

.editor-host {
    position: relative;
    background: var(--bg-0);
}
.monaco-host { position: absolute; inset: 0; }
.fallback-editor {
    background: var(--bg-0);
    color: var(--text);
    border: 0;
    outline: none;
    resize: none;
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.55;
    width: 100%; height: 100%;
    tab-size: 4;
    white-space: pre;
}
.fallback-editor:focus { box-shadow: inset 0 0 0 1px var(--border-strong); }
.welcome {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    background: var(--bg-0);
    padding: 24px;
}
.welcome-card {
    max-width: 460px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-1);
    box-shadow: var(--shadow-2);
    overflow: hidden;
}
.welcome-card-header {
    padding: 28px 28px 22px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}
.welcome-card .icon-wrap {
    width: 44px; height: 44px;
    margin: 0 auto 14px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    color: var(--text-dim);
    font-size: 18px;
}
.welcome-card h2 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--text);
}
.welcome-card p {
    margin: 0;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.55;
}
.kbd-list {
    padding: 8px 0;
    list-style: none;
    margin: 0;
    color: var(--text-dim);
    font-size: 13px;
}
.kbd-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 28px;
    gap: 14px;
}
.kbd-list li + li { border-top: 1px solid var(--border); }
.kbd-list li .desc { color: var(--text-muted); flex: 1; }
.kbd-list li .keys { color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    color: var(--text-dim);
    min-width: 18px;
    line-height: 1.3;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.3);
}

.statusbar {
    display: flex; align-items: center;
    gap: 14px;
    padding: 0 14px;
    height: var(--statusbar-h);
    background: var(--bg-1);
    color: var(--text-dim);
    font-size: 11px;
    font-family: var(--font-mono);
    border-top: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
}
#status-left { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#status-right { white-space: nowrap; color: var(--text-muted); }

.status-progress {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--text);
    font-size: 11px;
}
.status-progress .sp-label { color: var(--text-dim); }
.status-progress .sp-bar {
    width: 120px; height: 4px;
    background: var(--bg-3);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.status-progress .sp-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 0%;
    background: var(--purple-400);
    transition: width .18s var(--ease);
}
.status-progress.indeterminate .sp-fill {
    width: 40% !important;
    animation: slideBar 1.1s var(--ease) infinite;
}
@keyframes slideBar {
    0%   { left: -40%; }
    100% { left: 100%; }
}
.status-progress .sp-pct { color: var(--text-dim); min-width: 30px; text-align: right; }

.ctx-menu {
    position: fixed;
    z-index: 2000;
    min-width: 200px;
    padding: 4px;
    margin: 0; list-style: none;
    background: var(--bg-1);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: var(--shadow-2);
}
.ctx-menu li {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-dim);
}
.ctx-menu li:hover { background: var(--bg-3); color: var(--text); }
.ctx-menu li.danger { color: #fca5a5; }
.ctx-menu li.danger:hover { background: var(--danger-soft); color: #fca5a5; }
.ctx-menu .sep {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
    padding: 0;
    cursor: default;
    pointer-events: none;
}
.ctx-menu .icon { width: 16px; text-align: center; opacity: .8; }
.ctx-menu .shortcut { margin-left: auto; color: var(--text-muted); font-size: 11px; font-family: var(--font-mono); }

.modal-root {
    position: fixed; inset: 0; z-index: 3000;
    display: grid; place-items: center;
}
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.modal {
    position: relative;
    width: min(460px, 92vw);
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-2);
    overflow: hidden;
    animation: fadeIn .2s var(--ease) both;
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.modal-body { padding: 18px; display: grid; gap: 12px; }
.modal-body p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.modal-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.015);
}

.palette-root {
    position: fixed; inset: 0; z-index: 3500;
    display: flex; justify-content: center;
    padding-top: 80px;
}
.palette-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.palette {
    position: relative;
    width: min(620px, 92vw);
    max-height: 60vh;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-2);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: paletteIn .18s var(--ease);
}
@keyframes paletteIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
.palette-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.palette-icon {
    color: var(--text-muted);
    font-size: 14px;
    width: 16px; text-align: center;
}
#palette-input {
    flex: 1;
    background: transparent;
    border: 0;
    color: var(--text);
    padding: 4px 0;
    font-size: 14px;
    outline: none;
}
.palette-hint { font-size: 11px; white-space: nowrap; }
.palette-list {
    list-style: none;
    margin: 0; padding: 6px 4px;
    overflow-y: auto;
    flex: 1;
}
.palette-empty {
    padding: 22px;
    text-align: center;
    font-size: 13px;
}
.palette-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.3;
    color: var(--text-dim);
}
.palette-item:hover { background: var(--bg-2); color: var(--text); }
.palette-item.active {
    background: var(--bg-3);
    color: var(--text);
}
.palette-item .pi-icon { width: 18px; text-align: center; opacity: 0.8; }
.palette-item .pi-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .pi-sub  { color: var(--text-muted); font-size: 11px; font-family: var(--font-mono); }
.palette-item .pi-kbd  { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.palette-item .match { color: var(--text); font-weight: 600; }
.palette-item.active .match { color: var(--purple-300); }

.shortcuts-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
    font-size: 13px;
    max-height: 60vh;
    overflow-y: auto;
}
.shortcuts-grid h4 {
    grid-column: 1 / -1;
    margin: 14px 0 4px;
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}
.shortcuts-grid h4:first-child { margin-top: 0; }
.shortcuts-grid .keys {
    display: flex; gap: 4px; align-items: center;
    color: var(--text);
}
.shortcuts-grid .keys kbd { font-size: 10px; }
.shortcuts-grid .desc { color: var(--text-dim); }

.toasts {
    position: fixed;
    right: 16px; bottom: 36px;
    z-index: 4000;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 260px; max-width: 380px;
    padding: 11px 14px;
    background: var(--bg-1);
    border: 1px solid var(--border-strong);
    border-left: 2px solid var(--text-muted);
    border-radius: 8px;
    box-shadow: var(--shadow-1);
    font-size: 12.5px;
    color: var(--text);
    animation: slideIn .22s var(--ease);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warn    { border-left-color: var(--warning); }
.toast .toast-head { display: flex; align-items: center; gap: 8px; }
.toast .toast-icon { font-size: 14px; color: var(--text-dim); }
.toast .toast-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.toast .toast-pct  { color: var(--text-dim); font-family: var(--font-mono); font-size: 11px; }
.toast .toast-bar  {
    margin-top: 8px; height: 3px; border-radius: 999px;
    background: var(--bg-3); overflow: hidden;
}
.toast .toast-fill {
    height: 100%; width: 0%;
    background: var(--purple-400);
    transition: width .15s var(--ease);
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0 } to { transform: none; opacity: 1 } }

.ide-body.dropping .sidebar { box-shadow: inset 0 0 0 1px var(--accent-line); }

@media (max-width: 720px) {
    .workspace { grid-template-columns: 1fr; }
    .resizer { display: none; }
    .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
}
