/* ── Canvas panel ──────────────────────────────────────────── */

#canvas-panel {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #ffffff;
}

#canvas-svg {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Device group hover / selected outlines ────────────────── */

.device-group {
    transition: filter 0.1s;
}

.device-group:hover > rect:first-child,
.device-group:hover > polygon:first-child {
    filter: brightness(0.96);
}

.device-group.selected > rect:first-child,
.device-group.selected > polygon:first-child {
    filter: brightness(0.92);
}

/* ── Port squares ──────────────────────────────────────────── */

.port-sq {
    transition: fill 0.08s;
}

/* ── Connection lines ──────────────────────────────────────── */

.connection-group path {
    transition: stroke-width 0.1s;
}

/* ── Port tooltip ──────────────────────────────────────────── */

#port-tooltip {
    position: fixed;
    z-index: 600;
    background: #222;
    color: #fff;
    font-size: 11px;
    font-family: system-ui, sans-serif;
    padding: 4px 9px;
    border-radius: 3px;
    pointer-events: none;
    display: none;
    white-space: nowrap;
    max-width: 260px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* ── Rubber-band selection rect ────────────────────────────── */

#rubber-band {
    position: absolute;
    border: 1.5px dashed #1565c0;
    background: rgba(21, 101, 192, 0.07);
    pointer-events: none;
    display: none;
    border-radius: 1px;
}

/* ── Auto-save recovery banner ─────────────────────────────── */

#recovery-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #5d4037;
    font-family: system-ui, sans-serif;
}

#recovery-banner button {
    font-size: 11px;
    padding: 3px 10px;
}

#recovery-banner #recovery-restore {
    background: #111;
    color: #fff;
    border-color: #111;
}
#recovery-banner #recovery-restore:hover { background: #333; }
