/* =============================================
   NDRA Plan Designer — Styles
   Ported from prototype with additions for app layout
   ============================================= */

:root {
    --bg: #0d1017;
    --bg-panel: #131720;
    --bg-node: #1a1f2e;
    --bg-node-hover: #1f2538;
    --bg-input: #161b28;
    --border: #252d3f;
    --border-hover: #354060;
    --border-active: #4a7cff;
    --text: #dde1ea;
    --text-sec: #7a829a;
    --text-dim: #4a5168;
    --accent: #4a7cff;
    --accent-dim: rgba(74, 124, 255, .12);
    --accent-glow: rgba(74, 124, 255, .25);
    --green: #3dd68c;
    --green-dim: rgba(61, 214, 140, .12);
    --orange: #f0a030;
    --orange-dim: rgba(240, 160, 48, .12);
    --red: #f05050;
    --red-dim: rgba(240, 80, 80, .12);
    --purple: #9b7aff;
    --purple-dim: rgba(155, 122, 255, .12);
    --cyan: #30c8e0;
    --cyan-dim: rgba(48, 200, 224, .12);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    user-select: none;
}

/* ===== APP LAYOUT (for plan list page) ===== */
body.app-layout {
    overflow: auto;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.app-sidebar-brand {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.brand-icon { font-size: 18px; }
.brand-text { font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: .5px; }

.app-nav {
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sec);
    text-decoration: none;
    transition: all .15s;
}

.app-nav-item:hover { background: var(--bg-node); color: var(--text); }
.app-nav-item.active { background: var(--accent-dim); color: var(--accent); }

.app-sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--border);
}

.app-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.app-user-name { font-size: 13px; font-weight: 600; }
.app-user-role { font-size: 11px; color: var(--text-dim); }

.app-main {
    margin-left: 220px;
    min-height: 100vh;
    padding: 32px;
}

/* ===== PLAN LIST PAGE ===== */
.plans-page { max-width: 900px; }

.plans-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.plans-header h1 { font-size: 24px; font-weight: 700; }

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.plan-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: all .15s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,.3); }

.plan-card-header { display: flex; align-items: center; justify-content: space-between; }
.plan-card-header h3 { font-size: 15px; font-weight: 600; }
.plan-card-count { font-size: 11px; font-family: 'JetBrains Mono', monospace; color: var(--text-dim); background: var(--bg-node); padding: 2px 8px; border-radius: 4px; }
.plan-card-desc { font-size: 12px; color: var(--text-sec); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.plan-card-date { font-size: 11px; color: var(--text-dim); }
.plan-card-delete { background: none; border: none; cursor: pointer; font-size: 14px; padding: 4px; opacity: 0; transition: opacity .15s; }
.plan-card:hover .plan-card-delete { opacity: 1; }

.plans-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; }
.plans-empty-icon { font-size: 48px; margin-bottom: 16px; }
.plans-empty h3 { font-size: 18px; margin-bottom: 8px; }
.plans-empty p { font-size: 13px; color: var(--text-sec); margin-bottom: 20px; }

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    width: 380px;
    max-width: 90vw;
}

.login-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
}

.login-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.login-error { background: var(--red-dim); color: var(--red); padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-dim); margin-bottom: 6px; }

.login-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    background: var(--accent);
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
}

.login-btn:hover { background: #5a8aff; }

/* ===== DESIGNER — HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    z-index: 200;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.header-back {
    color: var(--text-sec);
    text-decoration: none;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all .15s;
}

.header-back:hover { background: var(--bg-node); color: var(--text); }
.header-brand { font-weight: 700; font-size: 14px; color: var(--accent); letter-spacing: .5px; }
.header-sep { width: 1px; height: 24px; background: var(--border); }

.header-plan-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: none;
    border: none;
    outline: none;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 200px;
    font-family: inherit;
}

.header-plan-name:hover { background: var(--bg-node); }
.header-plan-name:focus { background: var(--bg-input); outline: 1px solid var(--border-active); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.hdr-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    background: var(--bg-node);
    color: var(--text-sec);
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
}

.hdr-btn:hover { background: var(--bg-node-hover); color: var(--text); border-color: var(--border-hover); }
.hdr-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.hdr-btn.primary:hover { background: #5a8aff; }

/* ===== DESIGNER — SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 150;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-section { padding: 16px; border-bottom: 1px solid var(--border); }
.sidebar-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 10px; }

.plan-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }

.plan-item {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-sec);
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.plan-item:hover { background: var(--bg-node); color: var(--text); }
.plan-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.plan-item-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.plan-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-item-count { font-size: 11px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }

.new-plan-btn {
    width: 100%;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    background: none;
    border: 1px dashed var(--border);
    color: var(--text-dim);
    border-radius: 6px;
    cursor: pointer;
    margin-top: 8px;
    transition: all .15s;
    text-decoration: none;
    text-align: center;
    display: block;
}

.new-plan-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.legend { display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-sec); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ===== DESIGNER — CANVAS ===== */
.canvas-wrap {
    position: fixed;
    top: 52px;
    left: 260px;
    right: 0;
    bottom: 0;
    overflow: hidden;
    cursor: grab;
    background: var(--bg);
}

.canvas-wrap:active { cursor: grabbing; }

.canvas-bg {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: .4;
    pointer-events: none;
}

svg.connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

svg.connections path { pointer-events: stroke; cursor: pointer; }
svg.connections path:hover { stroke: var(--red) !important; stroke-width: 3 !important; }
.nodes-layer { position: absolute; top: 0; left: 0; z-index: 2; }

/* ===== DESIGNER — TEXT SUMMARY VIEW ===== */
.summary-view {
    position: fixed;
    top: 52px;
    left: 260px;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background: var(--bg);
    padding: 32px;
    z-index: 2;
}

.summary-view.chat-open { right: 400px; }
.summary-content { max-width: 800px; margin: 0 auto; }

.summary-phase { margin-bottom: 32px; }

.summary-phase-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.summary-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: border-color .15s, box-shadow .15s;
}

.summary-card:hover { border-color: var(--border-hover); }
.summary-card.ai-highlight { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-dim); }

.summary-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.summary-card-num {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
    min-width: 20px;
}

.summary-card-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: none;
    border: none;
    border-bottom: 1px solid transparent;
    outline: none;
    font-family: inherit;
    padding: 2px 0;
}

.summary-card-title:hover { border-bottom-color: var(--border); }
.summary-card-title:focus { border-bottom-color: var(--accent); }

.summary-card-desc,
.summary-card-notes {
    width: 100%;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-sec);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    min-height: 36px;
    resize: vertical;
    outline: none;
    line-height: 1.5;
}

.summary-card-desc:focus,
.summary-card-notes:focus { border-color: var(--border-active); }

.summary-card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.summary-card-meta select,
.summary-card-meta input {
    padding: 4px 8px;
    font-size: 12px;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-sec);
    border-radius: 4px;
    outline: none;
}

.summary-card-meta select:focus,
.summary-card-meta input:focus { border-color: var(--border-active); }
.summary-card-meta select option { background: var(--bg-panel); }

.summary-card-connections {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.summary-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.summary-empty p { font-size: 13px; line-height: 1.6; }

/* ===== DESIGNER — NODE ===== */
.node {
    position: absolute;
    width: 220px;
    background: var(--bg-node);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: move;
    transition: box-shadow .15s, border-color .15s;
    animation: fadeIn .2s ease-out;
}

.node:hover { border-color: var(--border-hover); box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.node.selected { border-color: var(--border-active); box-shadow: 0 0 0 2px var(--accent-glow), 0 4px 20px rgba(0,0,0,.3); }
.node.dragging { opacity: .85; z-index: 100; box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.node.ai-highlight { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim); animation: aiPulse 1.5s ease-out; }

@keyframes aiPulse {
    0% { box-shadow: 0 0 0 6px var(--green-dim); }
    100% { box-shadow: 0 0 0 3px var(--green-dim); }
}

.node-header { padding: 10px 12px 0; display: flex; align-items: center; gap: 8px; }

.node-type-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.node-type-badge.auto { background: var(--green-dim); color: var(--green); }
.node-type-badge.manual { background: var(--orange-dim); color: var(--orange); }
.node-type-badge.decision { background: var(--purple-dim); color: var(--purple); }
.node-type-badge.api { background: var(--cyan-dim); color: var(--cyan); }
.node-type-badge.milestone { background: var(--accent-dim); color: var(--accent); }

.node-stage-num { font-size: 10px; font-family: 'JetBrains Mono', monospace; color: var(--text-dim); margin-left: auto; }

.node-body { padding: 6px 12px 10px; }

.node-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    width: 100%;
    background: none;
    border: none;
    outline: none;
    font-family: inherit;
    padding: 2px 0;
    border-bottom: 1px solid transparent;
    cursor: text;
}

.node-title:hover { border-bottom-color: var(--border); }
.node-title:focus { border-bottom-color: var(--accent); color: #fff; }

.node-desc {
    font-size: 11px;
    color: var(--text-sec);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.node-anchor {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg-node);
    z-index: 10;
    cursor: crosshair;
    transition: all .15s;
}

.node-anchor:hover, .node-anchor.active { background: var(--accent); transform: scale(1.3); }
.node-anchor.top { top: -6px; left: 50%; transform: translateX(-50%); }
.node-anchor.bottom { bottom: -6px; left: 50%; transform: translateX(-50%); }
.node-anchor.left { left: -6px; top: 50%; transform: translateY(-50%); }
.node-anchor.right { right: -6px; top: 50%; transform: translateY(-50%); }
.node-anchor.top:hover { transform: translateX(-50%) scale(1.3); }
.node-anchor.bottom:hover { transform: translateX(-50%) scale(1.3); }
.node-anchor.left:hover { transform: translateY(-50%) scale(1.3); }
.node-anchor.right:hover { transform: translateY(-50%) scale(1.3); }

/* ===== DESIGNER — DETAIL PANEL ===== */
.detail-panel {
    position: fixed;
    top: 52px;
    right: -360px;
    bottom: 0;
    width: 360px;
    z-index: 150;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    transition: right .25s;
    overflow-y: auto;
    padding: 20px;
}

.detail-panel.open { right: 0; }
.detail-close { position: absolute; top: 12px; right: 12px; background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 18px; padding: 4px; }
.detail-close:hover { color: var(--text); }
.detail-section { margin-bottom: 20px; }
.detail-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-dim); margin-bottom: 6px; }

.detail-input, .detail-textarea, .detail-select {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    outline: none;
    transition: border-color .15s;
}

.detail-input:focus, .detail-textarea:focus, .detail-select:focus { border-color: var(--border-active); }
.detail-textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.detail-select option { background: var(--bg-panel); }
.detail-row { display: flex; gap: 8px; }
.detail-row > * { flex: 1; }

.detail-delete {
    width: 100%;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    background: var(--red-dim);
    border: 1px solid transparent;
    color: var(--red);
    border-radius: 6px;
    cursor: pointer;
    margin-top: 12px;
    transition: all .15s;
}

.detail-delete:hover { border-color: var(--red); background: rgba(240, 80, 80, .2); }

/* ===== DESIGNER — AI CHAT PANEL ===== */
.chat-panel {
    position: fixed;
    top: 52px;
    right: -400px;
    bottom: 0;
    width: 400px;
    z-index: 160;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: right .3s cubic-bezier(.4, 0, .2, 1);
}

.chat-panel.open { right: 0; }
.chat-header { padding: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.chat-header-icon { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--green-dim), var(--accent-dim)); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.chat-header-text h4 { font-size: 14px; font-weight: 700; color: var(--text); }
.chat-header-text p { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.chat-close { margin-left: auto; background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 18px; padding: 4px; }
.chat-close:hover { color: var(--text); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.chat-msg { max-width: 88%; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; animation: fadeIn .2s ease-out; }
.chat-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: var(--bg-node); color: var(--text); border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.chat-msg .changes-applied { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 11px; color: var(--green); font-family: 'JetBrains Mono', monospace; line-height: 1.6; }
.chat-msg.system { align-self: center; background: none; color: var(--text-dim); font-size: 11px; font-style: italic; padding: 4px; max-width: 100%; text-align: center; }

.ai-thinking { display: inline-flex; gap: 4px; padding: 4px 0; }
.ai-thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); animation: dotBounce 1.2s infinite; }
.ai-thinking span:nth-child(2) { animation-delay: .2s; }
.ai-thinking span:nth-child(3) { animation-delay: .4s; }

@keyframes dotBounce {
    0%, 80%, 100% { opacity: .3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}

.chat-input-area { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-end; }

.chat-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    outline: none;
    resize: none;
    max-height: 120px;
    min-height: 40px;
    line-height: 1.4;
    transition: border-color .15s;
}

.chat-input:focus { border-color: var(--border-active); }
.chat-input::placeholder { color: var(--text-dim); }

.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}

.chat-send:hover { background: #5a8aff; }
.chat-send:disabled { background: var(--border); cursor: not-allowed; }
.chat-send svg { width: 18px; height: 18px; }

/* ===== DESIGNER — TOOLBAR ===== */
.toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 180;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    display: flex;
    gap: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

.tb-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    background: none;
    border: 1px solid transparent;
    color: var(--text-sec);
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tb-btn:hover { background: var(--bg-node); color: var(--text); }
.tb-btn.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.tb-btn.ai-btn { color: var(--green); }
.tb-btn.ai-btn:hover { background: var(--green-dim); }
.tb-btn.ai-btn.active { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.tb-sep { width: 1px; background: var(--border); margin: 4px 2px; }
.tb-btn svg { width: 14px; height: 14px; }

/* ===== DESIGNER — ZOOM ===== */
.zoom-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 180;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: right .3s;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-sec);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all .15s;
}

.zoom-btn:hover { background: var(--bg-node); color: var(--text); border-color: var(--border-hover); }
.zoom-label { font-size: 10px; font-family: 'JetBrains Mono', monospace; color: var(--text-dim); text-align: center; padding: 2px 0; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ===== FILE UPLOAD ===== */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.file-upload-area:hover { border-color: var(--accent); background: rgba(59,130,246,0.05); }
.file-upload-area.dragover { border-color: var(--accent); background: rgba(59,130,246,0.1); }

/* ===== MISC ===== */
.conn-label {
    position: absolute;
    z-index: 3;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 3px;
    pointer-events: none;
    white-space: nowrap;
}

.toast {
    position: fixed;
    top: 64px;
    right: 20px;
    z-index: 250;
    padding: 10px 16px;
    background: var(--bg-node);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    box-shadow: 0 4px 24px rgba(0,0,0,.3);
    transform: translateX(120%);
    transition: transform .3s;
}

.toast.show { transform: translateX(0); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
