:root {
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --bg: #0B0F1A;
    --surface: #111827;
    --surface-2: #1F2937;
    --border: rgba(99, 102, 241, .08);
    --border-hover: rgba(99, 102, 241, .25);
    --primary: #818CF8;
    --accent: #34D399;
    --app-color: #60A5FA;
    --lib-color: #4ADE80;
    --shared-color: #C084FC;
    --text: #E5E7EB;
    --text-muted: #9CA3AF;
    --text-dim: #6B7280;
    --red: #F87171;
    --yellow: #FACC15;
    --radius: 12px;
    --radius-sm: 8px
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6
}

.header {
    padding: .7rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 15, 26, .9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.logo {
    display: flex;
    align-items: center;
    gap: .5rem
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(129, 140, 248, .06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem
}

.logo-text {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.header-actions {
    display: flex;
    gap: .3rem
}

.main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem 3rem
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: .75rem
}

.section-title {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .5rem
}

.filter-select {
    display: block;
    margin-bottom: .4rem;
    padding: .3rem .5rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .72rem;
    outline: none
}

.code-input {
    width: 100%;
    resize: vertical;
    padding: .5rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: .75rem;
    outline: none
}

.code-input:focus {
    border-color: var(--primary)
}

.errors {
    margin-top: .4rem;
    padding: .4rem;
    background: rgba(248, 113, 113, .06);
    border: 1px solid rgba(248, 113, 113, .15);
    border-radius: 6px;
    font-size: .72rem;
    color: var(--red)
}

.stats-row {
    display: flex;
    gap: .5rem;
    margin-bottom: .5rem
}

.stat {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .4rem;
    text-align: center
}

.stat-val {
    display: block;
    font-size: 1.1rem;
    font-weight: 800
}

.stat-label {
    font-size: .55rem;
    color: var(--text-dim);
    text-transform: uppercase
}

.canvas-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg)
}

canvas {
    display: block;
    width: 100%;
    cursor: grab
}

.pipeline {
    display: flex;
    flex-direction: column;
    gap: .3rem
}

.pipe-stage {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .5rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: .72rem
}

.pipe-num {
    font-weight: 800;
    color: var(--primary);
    width: 20px
}

.pipe-tasks {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem
}

.pipe-task {
    padding: .1rem .3rem;
    border-radius: 3px;
    font-size: .65rem;
    font-family: var(--font-mono)
}

.pipe-task.app {
    background: rgba(96, 165, 250, .1);
    color: var(--app-color)
}

.pipe-task.lib {
    background: rgba(74, 222, 128, .1);
    color: var(--lib-color)
}

.pipe-task.shared {
    background: rgba(192, 132, 252, .1);
    color: var(--shared-color)
}

.circular-list {
    font-size: .75rem;
    color: var(--red)
}

.circular-item {
    padding: .2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, .03);
    font-family: var(--font-mono);
    font-size: .7rem
}

#inspector-content {
    font-size: .75rem
}

.insp-name {
    font-size: .95rem;
    font-weight: 800;
    margin-bottom: .3rem
}

.insp-deps {
    font-family: var(--font-mono);
    font-size: .7rem;
    color: var(--text-muted)
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary), #6366F1);
    color: #fff;
    padding: .45rem .75rem
}

.btn--primary:hover {
    transform: translateY(-1px)
}

.btn--ghost {
    background: transparent;
    color: var(--text-muted);
    padding: .3rem .5rem
}

.btn--ghost:hover {
    background: rgba(129, 140, 248, .06);
    color: var(--text)
}

.btn--sm {
    font-size: .72rem;
    padding: .25rem .4rem
}

.hidden {
    display: none !important
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .5rem .85rem;
    border-radius: var(--radius-sm);
    font-size: .78rem;
    font-weight: 500;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: all .4s cubic-bezier(.16, 1, .3, 1);
    z-index: 100
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
}

@media(max-width:600px) {
    .header {
        padding: .7rem 1rem
    }

    .main {
        padding: 1rem
    }

    .stats-row {
        flex-wrap: wrap
    }
}