
/* NEpers Circuit Showcase - isolated */
.np-circuit-promo,
.np-simulator,
.np-visual-lab,
.np-circuit-promo *,
.np-simulator *,
.np-visual-lab * {
    box-sizing: border-box;
}

.np-circuit-promo,
.np-simulator,
.np-visual-lab {
    --np-bg: #05080d;
    --np-panel: rgba(8, 13, 22, .78);
    --np-card: rgba(255,255,255,.075);
    --np-border: rgba(255,255,255,.14);
    --np-muted: rgba(255,255,255,.68);
    --np-text: #fff;
    --np-accent: #ffb64d;
    --np-blue: #2aa9ff;
    --np-success: #35ff91;
    font-family: inherit;
    color: var(--np-text);
}

.np-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--np-accent) 55%, transparent);
    background: color-mix(in srgb, var(--np-accent) 12%, transparent);
    color: var(--np-accent);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .4px;
}

.np-kicker:before {
    content: "";
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 18px currentColor;
}

/* Shared backgrounds */
.np-circuit-promo,
.np-simulator,
.np-visual-lab {
    position: relative;
    overflow: hidden;
    padding: clamp(42px, 6vw, 86px) 18px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 10% 10%, color-mix(in srgb, var(--np-blue) 22%, transparent), transparent 30%),
        radial-gradient(circle at 85% 18%, color-mix(in srgb, var(--np-accent) 20%, transparent), transparent 34%),
        linear-gradient(135deg, #05080d, #07111d 52%, #030407);
}

.np-circuit-promo:before,
.np-simulator:before,
.np-visual-lab:before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .35;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, #000 0%, transparent 75%);
}

/* Promo */
.np-promo-grid {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: .95fr 1.05fr;
    gap: clamp(22px, 4vw, 54px);
    align-items: center;
}

.np-promo-visual {
    position: relative;
    min-height: 520px;
    display: grid;
    place-items: center;
}

.np-promo-orbit {
    position: absolute;
    width: min(470px, 90%);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--np-blue) 38%, transparent);
    box-shadow: inset 0 0 55px color-mix(in srgb, var(--np-blue) 12%, transparent), 0 0 90px color-mix(in srgb, var(--np-accent) 11%, transparent);
    animation: npSpin 18s linear infinite;
}

.np-promo-orbit:before,
.np-promo-orbit:after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--np-blue);
    box-shadow: 0 0 28px var(--np-blue);
}

.np-promo-orbit:before { left: 12%; top: 22%; }
.np-promo-orbit:after { right: 12%; bottom: 22%; background: var(--np-accent); box-shadow: 0 0 28px var(--np-accent); }

.np-promo-image {
    position: relative;
    width: min(430px, 88%);
    aspect-ratio: 1.08;
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
    box-shadow: 0 36px 90px rgba(0,0,0,.45);
    transform: perspective(1000px) rotateY(-9deg) rotateX(4deg);
}

.np-promo-image img { width: 100%; height: 100%; object-fit: cover; display: block; filter: contrast(1.08) saturate(1.05); }

.np-floating-chip {
    position: absolute;
    left: 4%;
    bottom: 14%;
    padding: 12px 17px;
    border-radius: 18px;
    background: rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.14);
    color: #fff;
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
    backdrop-filter: blur(14px);
}

.np-promo-content h2,
.np-sim-head h2,
.np-lab-header h2 {
    margin: 18px 0 14px;
    font-size: clamp(30px, 4.8vw, 58px);
    line-height: 1.25;
    font-weight: 950;
    letter-spacing: -.8px;
    color: #fff;
}

.np-promo-content p,
.np-sim-head p,
.np-lab-header p {
    margin: 0;
    color: var(--np-muted);
    line-height: 2.05;
    font-size: 16px;
}

.np-promo-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0;
}

.np-promo-card {
    text-align: right;
    cursor: pointer;
    appearance: none;
    border: 1px solid var(--np-border);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.035));
    color: #fff;
    padding: 18px;
    min-height: 170px;
    box-shadow: 0 24px 58px rgba(0,0,0,.22);
    transition: transform .28s ease, border-color .28s ease, background .28s ease;
}

.np-promo-card:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--np-accent) 62%, transparent);
    background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.055));
}

.np-card-icon,
.np-component-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: var(--np-accent);
    border: 1px solid rgba(255,255,255,.13);
    background: color-mix(in srgb, var(--np-accent) 12%, transparent);
    font-weight: 900;
}

.np-card-data { display: inline-flex; color: var(--np-blue); font-size: 12px; margin-bottom: 8px; font-weight: 800; }
.np-promo-card strong { display: block; font-size: 18px; margin-bottom: 8px; }
.np-promo-card small { display: block; color: var(--np-muted); font-size: 13px; line-height: 1.75; }

.np-promo-button,
.np-run-sim,
.np-clear-board,
.np-lab-toolbar button,
.np-lab-run {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 13px 22px;
    border-radius: 16px;
    text-decoration: none;
    border: 1px solid color-mix(in srgb, var(--np-accent) 65%, transparent);
    background: linear-gradient(135deg, var(--np-accent), #8a520f);
    color: #120b02;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 18px 44px color-mix(in srgb, var(--np-accent) 22%, transparent);
}

.np-clear-board,
.np-lab-toolbar button {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    color: #fff;
    box-shadow: none;
}

/* Modal */
.np-modal { position: fixed; inset: 0; z-index: 99999; display: none; place-items: center; padding: 18px; }
.np-modal.is-open { display: grid; }
.np-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(10px); }
.np-modal-box {
    position: relative;
    width: min(560px, 100%);
    border-radius: 28px;
    padding: 30px;
    background: radial-gradient(circle at top left, color-mix(in srgb, var(--np-blue) 16%, transparent), transparent 40%), linear-gradient(135deg, #111824, #080b11);
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 35px 100px rgba(0,0,0,.55);
    z-index: 1;
    color: #fff;
}
.np-modal-box span { color: var(--np-accent); font-weight: 900; }
.np-modal-box h3 { margin: 10px 0; font-size: 28px; }
.np-modal-box p { margin: 0; color: var(--np-muted); line-height: 2; }
.np-modal-close { position: absolute; top: 14px; left: 14px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 24px; cursor: pointer; }

/* Classic Simulator */
.np-sim-head,
.np-lab-header {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    margin: 0 auto 28px;
    text-align: center;
}
.np-sim-head p,
.np-lab-header p { max-width: 820px; margin-inline: auto; }

.np-sim-layout {
    position: relative;
    z-index: 1;
    width: min(1240px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 290px 1fr 320px;
    gap: 16px;
}

.np-component-panel,
.np-design-board,
.np-output-panel,
.np-lab-sidebar,
.np-lab-main {
    border-radius: 26px;
    border: 1px solid var(--np-border);
    background: rgba(255,255,255,.065);
    backdrop-filter: blur(18px);
    box-shadow: 0 26px 74px rgba(0,0,0,.32);
}

.np-component-panel,
.np-output-panel,
.np-lab-sidebar { padding: 18px; }

.np-panel-title,
.np-board-top,
.np-board-footer,
.np-lab-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.np-panel-title,
.np-lab-panel-title { margin-bottom: 15px; }

.np-panel-title strong,
.np-board-top strong,
.np-lab-panel-title strong {
    display: block;
    color: #fff;
    font-size: 16px;
}

.np-panel-title span,
.np-board-top span,
.np-note,
.np-lab-panel-title small {
    color: var(--np-muted);
    font-size: 12px;
}

.np-component-search,
.np-lab-search,
.np-lab-toolbar select {
    width: 100%;
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.13);
    background: rgba(0,0,0,.25);
    color: #fff;
    outline: none;
    padding: 0 14px;
    margin-bottom: 14px;
}

.np-lab-toolbar select option { color: #111; }
.np-component-search::placeholder,
.np-lab-search::placeholder { color: rgba(255,255,255,.42); }

.np-component-list,
.np-lab-list {
    max-height: 555px;
    overflow: auto;
    padding-left: 3px;
    display: grid;
    gap: 9px;
}

.np-component-item,
.np-lab-component {
    cursor: grab;
    border: 1px solid rgba(255,255,255,.11);
    background: rgba(0,0,0,.22);
    color: #fff;
    border-radius: 16px;
    padding: 10px 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
    text-align: right;
}

.np-component-item:hover,
.np-lab-component:hover {
    transform: translateX(-4px);
    border-color: color-mix(in srgb, var(--np-blue) 45%, transparent);
    background: rgba(255,255,255,.08);
}

.np-component-icon { flex: 0 0 auto; font-size: 12px; }

.np-design-board { padding: 18px; }

.np-board-canvas {
    position: relative;
    min-height: 470px;
    margin: 16px 0;
    border-radius: 24px;
    overflow: hidden;
    border: 1px dashed rgba(255,255,255,.19);
    background: radial-gradient(circle at center, rgba(42,169,255,.09), transparent 34%), linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px), rgba(0,0,0,.26);
    background-size: auto, 34px 34px, 34px 34px, auto;
}

.np-empty-state {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    color: rgba(255,255,255,.55);
    gap: 10px;
    pointer-events: none;
}

.np-empty-state span {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-inline: auto;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.15);
    color: var(--np-accent);
    font-size: 34px;
}

.np-chip-node {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--np-blue) 28%, transparent);
    background: linear-gradient(145deg, rgba(42,169,255,.16), rgba(255,255,255,.05));
    color: #fff;
    box-shadow: 0 18px 34px rgba(0,0,0,.22);
    animation: npPop .25s ease both;
}

.np-chip-node b {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(0,0,0,.24);
    color: var(--np-accent);
    font-size: 12px;
}

.np-chip-node button {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
}

.np-score-ring {
    width: 150px;
    height: 150px;
    margin: 10px auto 18px;
    border-radius: 50%;
    display: grid;
    place-content: center;
    text-align: center;
    background: radial-gradient(circle, #09101b 56%, transparent 57%), conic-gradient(var(--np-accent) var(--np-score, 0%), rgba(255,255,255,.11) 0);
    border: 1px solid rgba(255,255,255,.12);
}

.np-ring-number { font-size: 30px; font-weight: 950; color: #fff; }
.np-score-ring small { color: var(--np-muted); }

.np-results { display: grid; gap: 10px; }
.np-result-placeholder { color: var(--np-muted); padding: 16px; border-radius: 16px; background: rgba(0,0,0,.2); }
.np-result-card { border: 1px solid rgba(255,255,255,.11); background: rgba(0,0,0,.22); border-radius: 18px; padding: 14px; }
.np-result-card header { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.np-result-card h4 { margin: 0 0 7px; color: #fff; font-size: 15px; }
.np-result-card p { margin: 0; color: var(--np-muted); font-size: 12px; line-height: 1.75; }
.np-result-score { flex: 0 0 auto; color: var(--np-accent); font-weight: 950; }
.np-result-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.np-result-meta span { font-size: 11px; color: rgba(255,255,255,.72); padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.08); }
.np-result-meta .is-hit { background: color-mix(in srgb, var(--np-success) 20%, transparent); color: var(--np-success); }
.np-note { margin-top: 14px; line-height: 1.8; border-top: 1px solid rgba(255,255,255,.09); padding-top: 12px; }

/* Advanced Visual Lab */
.np-lab-help {
    position: relative;
    z-index: 1;
    width: min(1240px, 100%);
    margin: -8px auto 22px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--np-blue) 28%, transparent);
    background: rgba(42,169,255,.08);
    color: var(--np-muted);
    line-height: 1.9;
}

.np-lab-help strong { color: #fff; margin-left: 8px; }

.np-lab-shell {
    position: relative;
    z-index: 1;
    width: min(1460px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px minmax(500px, 1fr) 320px;
    gap: 16px;
}

.np-lab-main { padding: 16px; }

.np-lab-toolbar {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto auto auto auto;
    gap: 9px;
    align-items: center;
    margin-bottom: 14px;
}

.np-lab-toolbar select { margin: 0; }

.np-lab-board {
    position: relative;
    min-height: 620px;
    border-radius: 26px;
    overflow: hidden;
    border: 1px dashed rgba(255,255,255,.2);
    background:
        radial-gradient(circle at 30% 30%, rgba(42,169,255,.11), transparent 28%),
        radial-gradient(circle at 75% 70%, rgba(255,182,77,.09), transparent 28%),
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
        #07101b;
    background-size: auto, auto, 32px 32px, 32px 32px, auto;
}

.np-wire-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.np-wire-layer path {
    fill: none;
    stroke: var(--np-blue);
    stroke-width: 3;
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--np-blue) 70%, transparent));
}

.np-wire-layer path.is-suggested {
    stroke: var(--np-accent);
    stroke-dasharray: 9 8;
    animation: npDash 1.2s linear infinite;
}

.np-lab-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 10px;
    text-align: center;
    color: rgba(255,255,255,.5);
    pointer-events: none;
    z-index: 0;
}

.np-lab-empty b {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin-inline: auto;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.18);
    color: var(--np-accent);
    font-size: 36px;
}

.np-lab-node {
    position: absolute;
    z-index: 2;
    width: 148px;
    min-height: 94px;
    border: 1px solid rgba(255,255,255,.16);
    background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.045));
    box-shadow: 0 22px 48px rgba(0,0,0,.32);
    border-radius: 20px;
    color: #fff;
    cursor: move;
    user-select: none;
    padding: 13px 12px;
    backdrop-filter: blur(12px);
    animation: npPop .22s ease both;
}

.np-lab-node.is-active {
    border-color: color-mix(in srgb, var(--np-accent) 70%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--np-accent) 20%, transparent), 0 24px 54px rgba(0,0,0,.36);
}

.np-lab-node-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.np-lab-node-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: var(--np-accent);
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.12);
    font-size: 12px;
    font-weight: 900;
}

.np-lab-node-title {
    line-height: 1.35;
    font-size: 12px;
}

.np-lab-node-title strong {
    display: block;
    color: #fff;
    font-size: 13px;
}

.np-lab-node-title small {
    color: var(--np-muted);
}

.np-lab-node-remove {
    position: absolute;
    top: 7px;
    left: 7px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.12);
    cursor: pointer;
}

.np-pin {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #07101b;
    border-radius: 50%;
    background: var(--np-blue);
    box-shadow: 0 0 16px color-mix(in srgb, var(--np-blue) 80%, transparent);
    cursor: crosshair;
}

.np-pin[data-pin="in"] { right: -8px; top: 42px; }
.np-pin[data-pin="out"] { left: -8px; top: 42px; }
.np-pin.is-selected { background: var(--np-accent); box-shadow: 0 0 20px var(--np-accent); }

.np-lab-status {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    border-radius: 20px;
    padding: 14px;
    background: rgba(0,0,0,.22);
    border: 1px solid rgba(255,255,255,.1);
}

.np-lab-status strong { display: block; color: #fff; }
.np-lab-status span { color: var(--np-muted); font-size: 12px; }

.np-lab-output-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.np-output-tile {
    min-height: 86px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.11);
    background: rgba(0,0,0,.22);
    color: rgba(255,255,255,.72);
    padding: 10px;
    display: grid;
    align-content: center;
    gap: 5px;
    text-align: center;
    transition: all .25s ease;
}

.np-output-tile b {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    margin-inline: auto;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    color: var(--np-muted);
    font-size: 12px;
}

.np-output-tile small {
    font-size: 11px;
    line-height: 1.4;
}

.np-output-tile.is-on {
    border-color: color-mix(in srgb, var(--np-success) 55%, transparent);
    background: color-mix(in srgb, var(--np-success) 14%, rgba(0,0,0,.25));
    color: #fff;
    box-shadow: 0 0 28px color-mix(in srgb, var(--np-success) 22%, transparent);
}

.np-output-tile.is-on b {
    color: #07120c;
    background: var(--np-success);
    box-shadow: 0 0 24px color-mix(in srgb, var(--np-success) 60%, transparent);
}

.np-lab-score { margin: 18px 0 12px; }
.np-lab-analysis {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.11);
    background: rgba(0,0,0,.22);
    padding: 14px;
    color: var(--np-muted);
    line-height: 1.85;
    font-size: 13px;
}

.np-lab-analysis strong { color: #fff; }
.np-lab-analysis .np-good { color: var(--np-success); }
.np-lab-analysis .np-warn { color: var(--np-accent); }
.np-lab-analysis ul { margin: 8px 0 0; padding: 0 20px 0 0; }

@keyframes npSpin { to { transform: rotate(360deg); } }
@keyframes npPop { from { opacity: 0; transform: scale(.92) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes npDash { to { stroke-dashoffset: -34; } }

@media (max-width: 1280px) {
    .np-lab-shell { grid-template-columns: 1fr; }
    .np-lab-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .np-lab-list { max-height: 300px; }
}

@media (max-width: 1120px) {
    .np-promo-grid,
    .np-sim-layout { grid-template-columns: 1fr; }
    .np-promo-visual { min-height: 390px; }
    .np-component-list { max-height: 290px; }
}

@media (max-width: 680px) {
    .np-circuit-promo,
    .np-simulator,
    .np-visual-lab { border-radius: 24px; }

    .np-promo-cards,
    .np-lab-output-grid { grid-template-columns: 1fr; }

    .np-board-footer,
    .np-board-top,
    .np-panel-title,
    .np-lab-panel-title,
    .np-lab-status {
        align-items: stretch;
        flex-direction: column;
    }

    .np-run-sim,
    .np-clear-board,
    .np-lab-run,
    .np-lab-toolbar button { width: 100%; }

    .np-lab-toolbar { grid-template-columns: 1fr; }
    .np-lab-board { min-height: 520px; }
}


/* v1.2.0 schematic symbols + PDF button polish */
.np-schematic-mini {
    width: 72px;
    height: 42px;
    flex: 0 0 72px;
    display: grid;
    place-items: center;
    color: var(--np-blue);
    border-radius: 13px;
    border: 1px solid rgba(255,255,255,.12);
    background:
        radial-gradient(circle at center, color-mix(in srgb, var(--np-blue) 13%, transparent), transparent 72%),
        rgba(0,0,0,.22);
    overflow: hidden;
}

.np-schematic-mini svg {
    width: 65px;
    height: 36px;
}

.np-lab-component {
    grid-template-columns: 72px 46px 1fr;
}

.np-lab-component span:last-child {
    display: grid;
    gap: 3px;
}

.np-lab-component small {
    color: var(--np-muted);
    font-size: 11px;
}

.np-lab-node {
    width: 166px;
    min-height: 126px;
}

.np-node-schematic {
    width: 100%;
    height: 54px;
    margin-bottom: 9px;
    display: grid;
    place-items: center;
    color: var(--np-blue);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(42,169,255,.12), rgba(255,182,77,.06)),
        rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.10);
    overflow: hidden;
}

.np-node-schematic svg {
    width: 120px;
    height: 54px;
}

.np-lab-toolbar button[data-role="download-pdf"] {
    background: linear-gradient(135deg, #35ff91, #149858);
    border-color: rgba(53,255,145,.58);
    color: #041108;
    box-shadow: 0 18px 44px rgba(53,255,145,.16);
}

.np-lab-toolbar {
    grid-template-columns: 1.2fr 1fr 1fr auto auto auto auto auto;
}

@media (max-width: 1280px) {
    .np-lab-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .np-lab-component {
        grid-template-columns: 1fr;
    }

    .np-schematic-mini {
        width: 100%;
        height: 54px;
    }

    .np-lab-toolbar {
        grid-template-columns: 1fr;
    }
}


/* v1.3.0 real schematic + pin-to-pin wiring fixes */
.np-wire-mode-hint {
    position: relative;
    z-index: 1;
    width: min(1460px, 100%);
    margin: -8px auto 14px;
    padding: 12px 16px;
    border-radius: 16px;
    color: rgba(255,255,255,.78);
    background: rgba(42,169,255,.10);
    border: 1px solid rgba(42,169,255,.25);
    font-size: 13px;
    line-height: 1.8;
}

.np-lab-component {
    display: grid !important;
    grid-template-columns: 84px 48px 1fr !important;
    align-items: center !important;
    min-height: 86px;
}

.np-schematic-mini {
    width: 84px !important;
    height: 56px !important;
    flex: 0 0 84px;
    display: grid !important;
    place-items: center;
    color: var(--np-blue) !important;
    border-radius: 13px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.28);
    overflow: hidden;
}

.np-schematic-mini svg {
    width: 82px !important;
    height: 50px !important;
    display: block !important;
}

.np-component-name {
    display: grid;
    gap: 3px;
}

.np-component-name small {
    color: var(--np-muted);
    font-size: 11px;
}

.np-lab-node {
    width: 184px !important;
    min-height: 146px !important;
    padding-top: 13px !important;
    overflow: visible !important;
}

.np-node-schematic {
    width: 100% !important;
    height: 64px !important;
    margin-bottom: 10px !important;
    color: var(--np-blue) !important;
    display: grid !important;
    place-items: center;
    background: rgba(0,0,0,.24);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    overflow: hidden;
}

.np-node-schematic svg {
    width: 136px !important;
    height: 62px !important;
    display: block !important;
}

.np-pin {
    position: absolute !important;
    width: 18px !important;
    height: 18px !important;
    z-index: 5 !important;
    border: 2px solid #06101b !important;
    border-radius: 999px !important;
    background: var(--np-blue) !important;
    box-shadow: 0 0 18px color-mix(in srgb, var(--np-blue) 80%, transparent) !important;
    cursor: crosshair !important;
}

.np-pin-right {
    right: -9px !important;
    left: auto !important;
}

.np-pin-left {
    left: -9px !important;
    right: auto !important;
}

.np-pin em {
    position: absolute;
    top: -3px;
    min-width: 34px;
    height: 22px;
    line-height: 22px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: 9px;
    font-style: normal;
    pointer-events: none;
    opacity: .92;
}

.np-pin-right em {
    right: 20px;
}

.np-pin-left em {
    left: 20px;
}

.np-pin.is-selected {
    background: var(--np-accent) !important;
    box-shadow: 0 0 24px var(--np-accent) !important;
}

.np-wire-layer {
    z-index: 1 !important;
}

.np-wire-layer path {
    stroke-width: 4 !important;
    opacity: .95;
}

.np-lab-toolbar {
    grid-template-columns: 1.2fr 1fr 1fr repeat(5, auto) !important;
}

.np-lab-toolbar button {
    white-space: nowrap;
}

.np-output-tile.is-off {
    opacity: .55;
    filter: grayscale(.5);
}

.np-output-tile.is-on {
    opacity: 1 !important;
    filter: none !important;
}

.np-bad {
    color: #ff6b6b;
}

.np-lab-analysis .np-bad {
    color: #ff6b6b;
}

.np-lab-analysis li {
    margin: 3px 0;
}

@media (max-width: 1280px) {
    .np-lab-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 680px) {
    .np-lab-component {
        grid-template-columns: 1fr !important;
    }

    .np-lab-toolbar {
        grid-template-columns: 1fr !important;
    }
}


/* v1.4.0 button/action reliability + connection analysis polish */
.np-visual-lab button,
.np-simulator button,
.np-lab-run,
.np-run-sim,
.np-lab-toolbar button {
    pointer-events: auto !important;
    cursor: pointer !important;
    user-select: none;
}

.np-visual-lab button:active,
.np-simulator button:active {
    transform: translateY(1px);
}

.np-shake {
    animation: npShakeFallback .26s ease-out;
}

@keyframes npShakeFallback {
    0% { transform: translateX(0); }
    33% { transform: translateX(-8px); }
    66% { transform: translateX(8px); }
    100% { transform: translateX(0); }
}

.np-lab-analysis p {
    margin: 0 0 9px;
}


/* v1.4.1 Live Output Popup */
html.np-circuit-popup-open {
    overflow: hidden;
}

.np-circuit-output-popup,
.np-circuit-output-popup * {
    box-sizing: border-box;
}

.np-circuit-output-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    direction: rtl;
    display: grid;
    place-items: center;
    padding: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

.np-circuit-output-popup.is-open {
    opacity: 1;
    pointer-events: auto;
}

.np-popup-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 15%, rgba(27, 218, 168, .18), transparent 32%),
        radial-gradient(circle at 82% 22%, rgba(244, 178, 79, .18), transparent 34%),
        rgba(2, 6, 14, .72);
    backdrop-filter: blur(12px);
}

.np-popup-card {
    position: relative;
    width: min(760px, 96vw);
    max-height: min(88vh, 820px);
    overflow: auto;
    border-radius: 28px;
    padding: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 18% 0%, rgba(27, 218, 168, .14), transparent 32%),
        radial-gradient(circle at 88% 12%, rgba(244, 178, 79, .16), transparent 34%),
        linear-gradient(145deg, rgba(12, 22, 39, .98), rgba(5, 9, 18, .98));
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 32px 100px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
    transform: translateY(14px) scale(.98);
    transition: transform .28s ease;
}

.np-circuit-output-popup.is-open .np-popup-card {
    transform: translateY(0) scale(1);
}

.np-popup-close {
    position: sticky;
    top: 0;
    float: left;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
}

.np-popup-close:hover {
    background: rgba(255,76,76,.22);
    border-color: rgba(255,76,76,.46);
}

.np-popup-head {
    padding-left: 52px;
    margin-bottom: 18px;
}

.np-popup-kicker {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0 11px;
    border-radius: 999px;
    color: #061113;
    background: linear-gradient(135deg, #1bdaa8, #f4b24f);
    font-size: 12px;
    font-weight: 950;
}

.np-popup-head h3 {
    margin: 12px 0 8px;
    color: #fff;
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 950;
}

.np-popup-head p,
.np-popup-section p,
.np-popup-section li {
    color: rgba(255,255,255,.72);
    line-height: 1.9;
}

.np-popup-scene {
    position: relative;
    min-height: 145px;
    display: grid;
    grid-template-columns: 94px 1fr 94px 1fr 94px;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.10);
    overflow: hidden;
}

.np-popup-scene:before {
    content: "";
    position: absolute;
    inset: -80px;
    background: conic-gradient(from 90deg, transparent, rgba(27,218,168,.12), transparent, rgba(244,178,79,.12), transparent);
    animation: npPopupRotate 8s linear infinite;
}

.np-scene-node,
.np-scene-wire {
    position: relative;
    z-index: 1;
}

.np-scene-node {
    width: 94px;
    height: 94px;
    border-radius: 26px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.np-popup-scene.is-active .np-scene-node {
    border-color: rgba(27,218,168,.48);
    box-shadow: 0 0 32px rgba(27,218,168,.12), inset 0 1px 0 rgba(255,255,255,.10);
}

.np-scene-node b {
    font-size: 22px;
    font-weight: 950;
}

.np-scene-node span {
    color: rgba(255,255,255,.68);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.np-popup-scene.is-active .np-output {
    background: linear-gradient(145deg, rgba(27,218,168,.28), rgba(244,178,79,.16));
    animation: npPopupNodePulse 1.4s ease-in-out infinite;
}

.np-popup-scene.is-off .np-output {
    background: rgba(255,76,76,.10);
    border-color: rgba(255,76,76,.26);
}

.np-scene-wire {
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    overflow: hidden;
}

.np-scene-wire i {
    position: absolute;
    top: 0;
    right: -35%;
    width: 35%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, #1bdaa8, #f4b24f, transparent);
    animation: npPopupElectric 1.15s linear infinite;
    animation-delay: var(--np-wire-delay, 0s);
}

.np-scene-wire i:nth-child(2) { animation-delay: .28s; }
.np-scene-wire i:nth-child(3) { animation-delay: .56s; }

.np-popup-scene.is-off .np-scene-wire i {
    opacity: .15;
    animation-play-state: paused;
}

.np-popup-live-bars {
    height: 42px;
    display: flex;
    align-items: end;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.np-popup-live-bars span {
    width: 12px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(180deg, #1bdaa8, #f4b24f);
    animation: npPopupBars 1s ease-in-out infinite;
    animation-delay: var(--np-delay);
}

.np-popup-summary {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    margin-bottom: 16px;
}

.np-popup-score,
.np-popup-state,
.np-popup-section {
    border-radius: 20px;
    padding: 14px;
    background: rgba(255,255,255,.065);
    border: 1px solid rgba(255,255,255,.10);
}

.np-popup-score span,
.np-popup-state span {
    display: block;
    color: rgba(255,255,255,.58);
    font-size: 12px;
    margin-bottom: 7px;
    font-weight: 850;
}

.np-popup-score strong,
.np-popup-state strong {
    color: #fff;
    font-size: 22px;
    font-weight: 950;
}

.np-popup-status-on {
    border-color: rgba(27,218,168,.32);
    background: rgba(27,218,168,.09);
}

.np-popup-status-warn {
    border-color: rgba(244,178,79,.30);
    background: rgba(244,178,79,.08);
}

.np-popup-section {
    margin-top: 12px;
}

.np-popup-section h4 {
    color: #fff;
    margin: 0 0 9px;
    font-size: 16px;
    font-weight: 950;
}

.np-popup-section p {
    margin: 0 0 8px;
}

.np-popup-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.np-popup-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
}

.np-popup-chip-on {
    color: #04110e;
    background: linear-gradient(135deg, #1bdaa8, #f4b24f);
}

.np-popup-chip-off {
    color: #ffd5d5;
    background: rgba(255,76,76,.16);
    border: 1px solid rgba(255,76,76,.26);
}

.np-popup-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.np-popup-section ul {
    padding: 0 18px 0 0;
    margin: 0;
}

.np-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 16px;
}

.np-popup-primary,
.np-popup-ghost {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,.14);
    cursor: pointer;
    font-weight: 950;
}

.np-popup-primary {
    color: #061113;
    background: linear-gradient(135deg, #1bdaa8, #f4b24f);
}

.np-popup-ghost {
    color: #fff;
    background: rgba(255,255,255,.08);
}

@keyframes npPopupElectric {
    from { right: -40%; opacity: .2; }
    25% { opacity: 1; }
    to { right: 105%; opacity: .2; }
}

@keyframes npPopupNodePulse {
    0%, 100% { box-shadow: 0 0 22px rgba(27,218,168,.16), inset 0 1px 0 rgba(255,255,255,.12); }
    50% { box-shadow: 0 0 42px rgba(27,218,168,.36), inset 0 1px 0 rgba(255,255,255,.16); }
}

@keyframes npPopupBars {
    0%, 100% { height: 14px; opacity: .65; }
    50% { height: 38px; opacity: 1; }
}

@keyframes npPopupRotate {
    to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
    .np-popup-scene {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .np-scene-wire {
        width: 8px;
        height: 46px;
    }

    .np-scene-wire i {
        width: 100%;
        height: 35%;
        right: 0;
        top: -35%;
        animation-name: npPopupElectricVertical;
    }

    .np-popup-summary,
    .np-popup-grid-2 {
        grid-template-columns: 1fr;
    }
}

@keyframes npPopupElectricVertical {
    from { top: -40%; opacity: .2; }
    25% { opacity: 1; }
    to { top: 105%; opacity: .2; }
}


/* v1.4.2 suggested auto-wire + node coverage feedback */
.np-lab-wires path.is-supplemental,
.np-lab-wires path[data-supplemental="1"] {
    stroke-dasharray: 9 7;
    opacity: .88;
}

.np-lab-analysis ul {
    margin: 8px 0 12px;
    padding: 0 22px 0 0;
}

.np-lab-analysis li {
    margin: 4px 0;
    line-height: 1.8;
}

.np-lab-node.is-unwired {
    outline: 2px solid rgba(255, 76, 76, .65);
    outline-offset: 5px;
}
