/* =========================================
   MixFile Edge Console — style.css
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #080b12;
    --surface: #0e1220;
    --surface2: #141827;
    --surface3: #1c2136;
    --border: rgba(99,120,255,0.15);
    --border-bright: rgba(99,120,255,0.35);
    --accent: #6378ff;
    --accent2: #38d9a9;
    --accent3: #f472b6;
    --accent-glow: rgba(99,120,255,0.25);
    --green: #38d9a9;
    --red: #f87171;
    --yellow: #fbbf24;
    --text: #e8edf8;
    --text-muted: #5a6480;
    --text-dim: #8893aa;
    --radius: 14px;
    --radius-sm: 9px;
    --mono: 'DM Mono', 'Fira Code', Consolas, monospace;
    --sans: 'Sora', system-ui, sans-serif;
}
html, body { height: 100%; }
body {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    min-height: 100vh;
    background: var(--bg);
    font-family: var(--sans);
    color: var(--text);
    padding: 24px 16px;
    background-image:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(99,120,255,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 80% 80%, rgba(56,217,169,0.06) 0%, transparent 60%);
}
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(99,120,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,120,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none; z-index: 0;
}
.wrapper {
    position: relative; z-index: 1;
    width: 100%; max-width: 680px;
    display: flex; flex-direction: column; gap: 14px;
    animation: fadeUp 0.5s ease both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
.header { text-align: center; padding-bottom: 4px; animation: fadeUp 0.5s 0.05s ease both; }
.logo-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; box-shadow: 0 0 20px var(--accent-glow);
}
.header h1 {
    font-size: 20px; font-weight: 700;
    background: linear-gradient(120deg, #fff 30%, var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -0.4px;
}
.header p { font-size: 12px; color: var(--text-muted); letter-spacing: 0.3px; }

/* Node trigger button */
.node-trigger-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim); font-size: 12px; font-family: var(--sans);
    cursor: pointer; transition: all 0.18s; margin: 10px auto 0;
}
.node-trigger-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.node-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent2); box-shadow: 0 0 6px var(--accent2);
    animation: pulse-dot 2s ease infinite; flex-shrink: 0;
}
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
.current-node-label {
    font-family: var(--mono); font-size: 10px;
    max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Card ── */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    transition: border-color 0.3s; animation: fadeUp 0.5s 0.1s ease both;
}
.card:hover { border-color: var(--border-bright); }

/* ── Input row ── */
.input-row { display: flex; gap: 8px; align-items: stretch; }
.code-input-wrap { flex: 1; position: relative; }
.code-prefix {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-family: var(--mono); font-size: 12px; color: var(--accent);
    opacity: 0.7; pointer-events: none; user-select: none;
}
#code {
    width: 100%; padding: 11px 12px 11px 48px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px; font-family: var(--mono);
    color: var(--text); outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#code::placeholder { color: var(--text-muted); font-family: var(--sans); font-size: 13px; }
#code:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: var(--surface3); }

.btn {
    padding: 11px 18px; border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; font-family: var(--sans);
    cursor: pointer; transition: all 0.18s; white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #7a8fff; box-shadow: 0 0 16px var(--accent-glow); }
.btn-clear { background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); padding: 11px 10px; font-size: 13px; }
.btn-clear:hover { border-color: var(--red); color: var(--red); }
.btn-stream { background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim); padding: 11px 13px; flex-shrink: 0; }
.btn-stream:hover { border-color: var(--accent); color: var(--accent); }

/* ── Threads control ── */
.threads-row {
    display: flex; align-items: center; gap: 10px;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.threads-label { font-size: 11px; color: var(--text-muted); font-weight: 500; white-space: nowrap; letter-spacing: 0.3px; text-transform: uppercase; }
.threads-track { flex: 1; display: flex; gap: 6px; }
.thread-btn {
    flex: 1; padding: 5px 0; border: 1px solid var(--border);
    border-radius: 6px; background: var(--surface2);
    font-family: var(--mono); font-size: 12px; color: var(--text-muted);
    cursor: pointer; transition: all 0.15s; text-align: center;
}
.thread-btn:hover { border-color: var(--accent); color: var(--accent); }
.thread-btn.active { border-color: var(--accent); background: rgba(99,120,255,0.15); color: var(--accent); font-weight: 600; box-shadow: 0 0 8px rgba(99,120,255,0.15); }
.threads-badge { font-size: 11px; font-family: var(--mono); color: var(--accent2); background: rgba(56,217,169,0.1); border: 1px solid rgba(56,217,169,0.2); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }

/* ── Status bar ── */
.status-bar {
    display: none; margin-top: 12px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 500;
    border: 1px solid var(--border); background: var(--surface2);
    animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
.status-bar.error   { border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.06); }
.status-bar.info    { border-color: rgba(99,120,255,0.4);  background: rgba(99,120,255,0.06); }
.status-bar.success { border-color: rgba(56,217,169,0.4);  background: rgba(56,217,169,0.06); }
.status-bar.warn    { border-color: rgba(251,191,36,0.4);  background: rgba(251,191,36,0.06); }
.status-msg { color: var(--text); }
.status-bar pre.status-json {
    margin: 8px 0 0; padding: 8px 10px;
    background: rgba(0,0,0,0.3); border-radius: 6px; border: 1px solid var(--border);
    font-size: 11px; overflow-x: auto; color: var(--text-dim);
    white-space: pre-wrap; word-break: break-all; max-height: 150px; font-family: var(--mono);
}
.progress-wrap { margin-top: 10px; }
.progress-track { height: 4px; background: var(--surface3); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; transition: width 0.3s ease; width: 0%; box-shadow: 0 0 8px var(--accent-glow); }
.progress-label { font-size: 11px; color: var(--text-muted); margin-top: 5px; font-family: var(--mono); }
.speed-badge { display: inline-block; margin-left: 8px; font-family: var(--mono); font-size: 11px; color: var(--accent2); background: rgba(56,217,169,0.1); border: 1px solid rgba(56,217,169,0.2); padding: 1px 7px; border-radius: 99px; }
.eta-label { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-family: var(--mono); }

/* ── Info Panel ── */
.info-panel { display: none; animation: fadeUp 0.3s ease; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; display: flex; align-items: center; gap: 6px; }
.file-icon-badge { font-size: 22px; line-height: 1; }
.copy-link-btn { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); font-size: 11px; color: var(--text-muted); cursor: pointer; transition: all 0.15s; font-family: var(--sans); }
.copy-link-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.copy-link-btn.copied { border-color: var(--accent2); color: var(--accent2); background: rgba(56,217,169,0.08); }
.info-grid { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 12px; }
.info-label { color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.info-value { color: var(--text); word-break: break-all; font-weight: 500; font-family: var(--mono); font-size: 12px; }
.info-value.highlight { color: var(--accent2); }

/* ── Action zone ── */
.action-zone { display: none; gap: 10px; }
.btn-download { background: linear-gradient(135deg, var(--accent2), #20c997); color: #081a13; flex: 1; }
.btn-download:hover { box-shadow: 0 0 18px rgba(56,217,169,0.25); }
.btn-preview { background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim); flex: 1; }
.btn-preview:hover { border-color: var(--accent3); color: var(--accent3); }
.btn-download:disabled, .btn-preview:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Chunk map ── */
.chunk-map-wrap { padding: 12px 0 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.chunk-map-label { font-size: 10px; color: var(--text-muted); letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 8px; }
.chunk-map { display: flex; flex-wrap: wrap; gap: 3px; }
.chunk-cell { width: 10px; height: 10px; border-radius: 2px; background: var(--surface3); border: 1px solid var(--border); transition: background 0.2s; }
.chunk-cell.filled { background: var(--accent); border-color: var(--accent); }
.chunk-cell.last   { background: var(--accent2); border-color: var(--accent2); }

/* ── History Panel ── */
.history-panel { animation: fadeUp 0.5s 0.15s ease both; }
.history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.history-header-left { display: flex; align-items: center; gap: 8px; }
.hist-collapse-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 12px; padding: 1px 4px; border-radius: 4px; transition: all 0.15s; line-height: 1; }
.hist-collapse-btn:hover { color: var(--text); background: var(--surface3); }
.hist-count-badge { font-size: 10px; font-family: var(--mono); background: var(--surface3); color: var(--text-muted); padding: 1px 6px; border-radius: 99px; border: 1px solid var(--border); }
.history-header-right { display: flex; align-items: center; gap: 6px; }
.clear-hist-btn { font-size: 11px; color: var(--text-muted); background: none; border: none; cursor: pointer; font-family: var(--sans); padding: 2px 6px; border-radius: 4px; transition: color 0.15s; }
.clear-hist-btn:hover { color: var(--red); }
.hist-filter-wrap { margin-bottom: 8px; position: relative; }
.hist-filter-wrap input { width: 100%; padding: 6px 10px 6px 28px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 11px; font-family: var(--sans); outline: none; transition: border-color 0.15s; }
.hist-filter-wrap input:focus { border-color: var(--accent); }
.hist-filter-wrap input::placeholder { color: var(--text-muted); }
.hist-filter-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 11px; pointer-events: none; }
.history-body { overflow: hidden; transition: max-height 0.3s ease, opacity 0.3s ease; }
.history-body.collapsed { max-height: 0 !important; opacity: 0; }
.history-list { display: flex; flex-direction: column; gap: 5px; max-height: 300px; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: var(--border-bright) transparent; }
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 99px; }
.history-empty { text-align: center; padding: 20px 0; font-size: 12px; color: var(--text-muted); }
.history-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2); cursor: pointer; transition: all 0.15s; position: relative; }
.history-item:hover { border-color: var(--accent); background: var(--surface3); }
.history-item:hover .hist-item-actions { opacity: 1; }
.history-icon { font-size: 15px; flex-shrink: 0; }
.history-info { flex: 1; min-width: 0; }
.history-name { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { font-size: 10px; color: var(--text-muted); font-family: var(--mono); margin-top: 1px; }
.history-code { font-size: 10px; font-family: var(--mono); color: var(--text-muted); max-width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.hist-item-actions { display: flex; gap: 3px; flex-shrink: 0; opacity: 0; transition: opacity 0.15s; }
.hist-action-btn { background: var(--surface3); border: 1px solid var(--border); color: var(--text-muted); font-size: 10px; cursor: pointer; padding: 2px 5px; border-radius: 4px; line-height: 1.4; transition: all 0.15s; font-family: var(--sans); }
.hist-action-btn:hover { color: var(--text); border-color: var(--border-bright); }
.hist-action-btn.del:hover { color: var(--red); border-color: rgba(248,113,113,0.4); }
.hist-action-btn.copy:hover { color: var(--accent2); border-color: rgba(56,217,169,0.4); }
.hist-pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.hist-page-btn { display: flex; align-items: center; gap: 4px; background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; cursor: pointer; padding: 4px 10px; border-radius: 6px; transition: all 0.15s; font-family: var(--sans); }
.hist-page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.hist-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.hist-page-info { font-size: 11px; font-family: var(--mono); color: var(--text-muted); }

/* ── Preview Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(6px); z-index: 1000; justify-content: center; align-items: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border-bright); border-radius: var(--radius); width: 100%; max-width: 880px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(99,120,255,0.1); animation: modalIn 0.22s cubic-bezier(.22,.68,0,1.2); }
@keyframes modalIn { from { opacity:0; transform:scale(0.94) translateY(12px); } to { opacity:1; transform:none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title { font-size: 14px; font-weight: 600; }
.modal-close { background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all 0.15s; line-height: 1; }
.modal-close:hover { color: var(--text); border-color: var(--border-bright); }
.modal-body { flex: 1; overflow: auto; padding: 20px; display: flex; align-items: center; justify-content: center; }
.modal-body video { width: 100%; border-radius: 8px; background: #000; max-height: calc(92vh - 100px); }
.modal-body img { max-width: 100%; max-height: calc(92vh - 100px); border-radius: 8px; object-fit: contain; }
.modal-body textarea { width: 100%; height: calc(92vh - 140px); min-height: 200px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--mono); font-size: 13px; background: var(--surface2); color: var(--text); resize: vertical; outline: none; }
.modal-loading { color: var(--text-muted); font-size: 13px; }

/* ═══════════════════════════════════════
   NODE MANAGER MODAL
═══════════════════════════════════════ */
.node-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); z-index: 2000; justify-content: center; align-items: center; padding: 16px; }
.node-modal-overlay.open { display: flex; }
.node-modal { background: var(--surface); border: 1px solid var(--border-bright); border-radius: var(--radius); width: 100%; max-width: 580px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 32px 80px rgba(0,0,0,0.8), 0 0 0 1px rgba(99,120,255,0.15); animation: modalIn 0.22s cubic-bezier(.22,.68,0,1.2); overflow: hidden; }
.node-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.node-modal-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.node-modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.node-modal-body::-webkit-scrollbar { width: 4px; }
.node-modal-body::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 99px; }

/* Add node row */
.node-add-row { display: flex; gap: 8px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface2); border: 1px solid var(--border); }
.node-add-inputs { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.node-add-inputs input { width: 100%; padding: 8px 12px; background: var(--surface3); border: 1px solid var(--border); border-radius: 7px; font-size: 12px; font-family: var(--mono); color: var(--text); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.node-add-inputs input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.node-add-inputs input::placeholder { color: var(--text-muted); font-family: var(--sans); }
.node-add-btn { padding: 0 14px; border: none; border-radius: 7px; background: var(--accent); color: #fff; font-size: 18px; cursor: pointer; transition: all 0.18s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; align-self: stretch; }
.node-add-btn:hover { background: #7a8fff; box-shadow: 0 0 12px var(--accent-glow); }
.node-add-btn:active { transform: scale(0.95); }
.node-add-error { font-size: 11px; color: var(--red); display: none; margin-top: -6px; padding: 0 2px; }

/* Import / Export toolbar */
.node-io-bar {
    display: flex; gap: 6px; flex-wrap: wrap;
    padding: 10px 12px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.node-io-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 11px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--surface3);
    color: var(--text-dim); font-size: 11px; font-family: var(--sans);
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.node-io-btn:hover { border-color: var(--border-bright); color: var(--text); }
.node-io-btn.export:hover { border-color: rgba(56,217,169,0.4); color: var(--accent2); }
.node-io-btn.import-file:hover { border-color: rgba(99,120,255,0.4); color: var(--accent); }
.node-io-btn.import-url:hover { border-color: rgba(244,114,182,0.4); color: var(--accent3); }
.node-io-sep { flex: 1; }

/* Remote URL import row (hidden by default) */
.node-remote-row {
    display: none; gap: 8px; align-items: center;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--surface2); border: 1px solid rgba(244,114,182,0.25);
    animation: slideDown 0.2s ease;
}
.node-remote-row.open { display: flex; }
.node-remote-row input {
    flex: 1; padding: 7px 11px;
    background: var(--surface3); border: 1px solid var(--border);
    border-radius: 7px; font-size: 12px; font-family: var(--mono);
    color: var(--text); outline: none; transition: border-color 0.2s;
}
.node-remote-row input:focus { border-color: var(--accent3); box-shadow: 0 0 0 2px rgba(244,114,182,0.15); }
.node-remote-row input::placeholder { color: var(--text-muted); font-family: var(--sans); }
.node-remote-fetch-btn {
    padding: 7px 13px; border-radius: 7px; border: none;
    background: var(--accent3); color: #fff; font-size: 12px; font-weight: 600;
    font-family: var(--sans); cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.node-remote-fetch-btn:hover { opacity: 0.85; box-shadow: 0 0 10px rgba(244,114,182,0.3); }
.node-remote-fetch-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.node-remote-cancel { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 0 4px; transition: color 0.15s; }
.node-remote-cancel:hover { color: var(--red); }

/* Section label */
.node-section-label { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.test-all-btn { display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); color: var(--text-dim); font-size: 11px; font-family: var(--sans); cursor: pointer; transition: all 0.15s; }
.test-all-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.test-all-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Node list */
.node-list { display: flex; flex-direction: column; gap: 8px; }
.node-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2); transition: all 0.18s; cursor: pointer; }
.node-item:hover { border-color: var(--border-bright); background: var(--surface3); }
.node-item.selected { border-color: var(--accent2); background: rgba(56,217,169,0.06); box-shadow: 0 0 0 1px rgba(56,217,169,0.15); }
.node-radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-bright); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.node-item.selected .node-radio { border-color: var(--accent2); background: var(--accent2); box-shadow: 0 0 6px rgba(56,217,169,0.4); }
.node-radio-inner { width: 6px; height: 6px; border-radius: 50%; background: #081a13; opacity: 0; transition: opacity 0.15s; }
.node-item.selected .node-radio-inner { opacity: 1; }
.node-info { flex: 1; min-width: 0; }
.node-url-text { font-size: 12px; font-family: var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-name-text { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.node-tag { font-size: 9px; padding: 1px 6px; border-radius: 99px; line-height: 1.4; }
.node-tag.default { background: rgba(99,120,255,0.15); color: var(--accent); border: 1px solid rgba(99,120,255,0.25); }
.node-tag.active  { background: rgba(56,217,169,0.15); color: var(--accent2); border: 1px solid rgba(56,217,169,0.3); }
.node-ping-badge { font-size: 11px; font-family: var(--mono); padding: 3px 9px; border-radius: 99px; flex-shrink: 0; white-space: nowrap; transition: all 0.2s; }
.node-ping-badge.idle    { background: var(--surface3); color: var(--text-muted); border: 1px solid var(--border); }
.node-ping-badge.testing { background: rgba(99,120,255,0.12); color: var(--accent); border: 1px solid rgba(99,120,255,0.25); }
.node-ping-badge.fast    { background: rgba(56,217,169,0.12); color: var(--accent2); border: 1px solid rgba(56,217,169,0.25); }
.node-ping-badge.mid     { background: rgba(251,191,36,0.12); color: var(--yellow); border: 1px solid rgba(251,191,36,0.25); }
.node-ping-badge.slow    { background: rgba(248,113,113,0.12); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.node-ping-badge.timeout { background: rgba(248,113,113,0.08); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }
.node-actions { display: flex; gap: 5px; flex-shrink: 0; }
.node-action-btn { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface3); color: var(--text-muted); font-size: 11px; cursor: pointer; transition: all 0.15s; line-height: 1.4; font-family: var(--sans); }
.node-action-btn:hover { border-color: var(--border-bright); color: var(--text); }
.node-action-btn.test:hover { border-color: rgba(99,120,255,0.5); color: var(--accent); }
.node-action-btn.del:hover { border-color: rgba(248,113,113,0.4); color: var(--red); }

/* Progress bar */
.node-progress-wrap { padding: 4px 0 8px; }
.node-progress-track { height: 3px; background: var(--surface3); border-radius: 99px; overflow: hidden; }
.node-progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; transition: width 0.4s ease; width: 0%; }
.node-progress-label { font-size: 10px; color: var(--text-muted); margin-top: 4px; font-family: var(--mono); }

/* ── Misc ── */
.theme-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; cursor: pointer; font-size: 15px; transition: all 0.15s; line-height: 1; margin-left: 4px; }
.theme-btn:hover { border-color: var(--border-bright); transform: scale(1.1); }
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--surface3); border: 1px solid var(--border-bright); color: var(--text); font-size: 12px; font-weight: 500; padding: 8px 18px; border-radius: 99px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); animation: toastIn 0.25s ease; pointer-events: none; }
.toast.success { border-color: rgba(56,217,169,0.5); color: var(--accent2); }
.toast.error   { border-color: rgba(248,113,113,0.5); color: var(--red); }
@keyframes toastIn  { from { opacity:0; transform:translateY(8px) scale(0.95); } to { opacity:1; transform:none; } }
@keyframes toastOut { to   { opacity:0; transform:translateY(4px) scale(0.95); } }
.drop-overlay { display: none; position: fixed; inset: 0; z-index: 8000; background: rgba(8,11,18,0.85); backdrop-filter: blur(4px); justify-content: center; align-items: center; flex-direction: column; gap: 12px; }
.drop-overlay.active { display: flex; }
.drop-ring { width: 120px; height: 120px; border-radius: 50%; border: 3px dashed var(--accent); display: flex; align-items: center; justify-content: center; font-size: 40px; animation: pulse 1.2s ease infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-glow); } 50% { box-shadow: 0 0 0 16px transparent; } }
.drop-label { font-size: 14px; color: var(--text-muted); }
.footer { text-align: center; font-size: 11px; color: var(--text-muted); padding-top: 4px; animation: fadeUp 0.5s 0.2s ease both; }

/* ── Light theme ── */
body.light {
    --bg: #f0f2f8; --surface: #ffffff; --surface2: #f5f6fa; --surface3: #eceef5;
    --border: rgba(99,120,255,0.18); --border-bright: rgba(99,120,255,0.4);
    --text: #1a1f36; --text-muted: #8893aa; --text-dim: #6b7494;
    background-image:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(99,120,255,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 80% 80%, rgba(56,217,169,0.05) 0%, transparent 60%);
}
body.light::before {
    background-image:
        linear-gradient(rgba(99,120,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,120,255,0.05) 1px, transparent 1px);
}
