/* view-lens.css — Lani topology lens for compact sidebar view controls. */

.sidebar-header-actions { display: flex; align-items: center; gap: 2px; }

.lp-view-lens-button {
    position: relative;
    width: 30px;
    height: 30px;
    padding: 0;
}

.lp-view-lens-button svg { overflow: visible; }
.lp-view-lens-hex,
.lp-view-lens-link {
    stroke: currentColor;
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.lp-view-lens-node { fill: var(--sidebar-bg); stroke: currentColor; stroke-width: 1.25; }
.lp-view-lens-button.active { color: var(--accent); }
.lp-view-lens-button.active .lp-view-lens-node-a { fill: var(--accent); stroke: var(--accent); }
.lp-view-lens-button.active .lp-view-lens-node-b { fill: var(--accent-magenta); stroke: var(--accent-magenta); }

.lp-view-lens-badge {
    position: absolute;
    top: -2px;
    right: -3px;
    display: none;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    border: 2px solid var(--sidebar-bg);
    border-radius: 8px;
    background: var(--accent);
    color: #081217;
    font-size: 9px;
    font-weight: 750;
    line-height: 10px;
    place-items: center;
}
.lp-view-lens-button.active .lp-view-lens-badge { display: grid; }

.lp-view-lens-panel {
    position: fixed;
    z-index: 1500;
    width: min(300px, calc(100vw - 16px));
    max-height: min(520px, calc(100vh - 16px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.48), 0 2px 8px rgba(0, 0, 0, 0.28);
    animation: lp-view-lens-in 120ms ease-out;
}
.lp-view-lens-panel[hidden] { display: none; }

@keyframes lp-view-lens-in {
    from { opacity: 0; transform: translateY(-3px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lp-view-lens-heading {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    min-height: 46px;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 650;
}

.lp-view-lens-mark {
    width: 7px;
    height: 7px;
    margin-left: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 7px 7px 0 -1px var(--accent-magenta);
}

.lp-view-lens-back,
.lp-view-lens-reset {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    cursor: pointer;
}
.lp-view-lens-back { display: grid; width: 28px; height: 28px; place-items: center; }
.lp-view-lens-reset { padding: 5px 7px; font-size: 11px; font-weight: 500; }
.lp-view-lens-back:hover,
.lp-view-lens-reset:hover { background: var(--bg-hover); color: var(--text-primary); }

.lp-view-lens-list {
    max-height: min(460px, calc(100vh - 70px));
    overflow-y: auto;
    padding: 6px;
}
.lp-view-lens-row,
.lp-view-lens-option {
    display: flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.lp-view-lens-row:hover,
.lp-view-lens-option:hover,
.lp-view-lens-row:focus-visible,
.lp-view-lens-option:focus-visible { background: var(--bg-hover); outline: none; }
.lp-view-lens-row-label { flex: 1; min-width: 0; }
.lp-view-lens-summary {
    max-width: 118px;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lp-view-lens-chevron { display: inline-grid; color: var(--text-muted); place-items: center; }

.lp-view-lens-switch {
    display: flex;
    width: 30px;
    height: 18px;
    align-items: center;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-panel);
    transition: background 120ms ease, border-color 120ms ease;
}
.lp-view-lens-switch span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: transform 120ms ease, background 120ms ease;
}
.lp-view-lens-switch.checked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--bg-panel)); }
.lp-view-lens-switch.checked span { transform: translateX(12px); background: var(--accent); }

.lp-view-lens-option { padding-left: calc(9px + var(--lens-depth, 0) * 14px); }
.lp-view-lens-check {
    display: inline-grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: transparent;
    place-items: center;
}
[role="menuitemradio"] .lp-view-lens-check { border-radius: 50%; }
.lp-view-lens-check.checked { border-color: var(--accent); background: var(--accent); color: #081217; }
[role="menuitemradio"] .lp-view-lens-check.checked { background: transparent; box-shadow: inset 0 0 0 4px var(--accent); }
[role="menuitemradio"] .lp-view-lens-check.checked svg { display: none; }
.lp-view-lens-swatch { width: 7px; height: 7px; border-radius: 50%; background: var(--lens-swatch, var(--text-muted)); }
.lp-view-lens-separator { height: 1px; margin: 5px 7px; background: var(--border); }

.chat-sb-lens-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 24px 12px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}
.chat-sb-lens-empty button {
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
}
.chat-sb-lens-empty button:hover { border-color: var(--accent); }
.chat-sb-lens-empty button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 767px) {
    .lp-view-lens-panel {
        top: auto !important;
        right: 8px;
        bottom: 8px;
        left: 8px !important;
        width: auto;
        border-radius: 16px;
    }
    .lp-view-lens-row,
    .lp-view-lens-option { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .lp-view-lens-panel { animation: none; }
    .lp-view-lens-switch,
    .lp-view-lens-switch span { transition: none; }
}
