/* refs-popover.css — `?` icon bidirectional refs popover.
 * Spec: docs/specs/portal-bidirectional-refs.md §4.1.
 *
 * The popover DOM is built by shared/help-popover.js with `extraClass:
 * 'eclaw-refs-icon-anchor'`. This stylesheet styles the icon button itself
 * and the popover's inner content (header / sections / rows). The popover
 * shell (positioning, focus ring, close button) is owned by help-popover.css.
 */

/* ── ⓘ button ────────────────────────────────────────────────────────────── */
.eclaw-refs-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted, #888);
    font-size: 14px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.12s ease-out, background 0.12s ease-out;
    vertical-align: middle;
}
.eclaw-refs-icon:hover,
.eclaw-refs-icon:focus-visible {
    color: var(--accent, #6f7df4);
    background: rgba(111, 125, 244, 0.12);
    outline: none;
}
.eclaw-refs-icon:focus-visible {
    box-shadow: 0 0 0 2px rgba(111, 125, 244, 0.35);
}

/* ── Popover inner content ──────────────────────────────────────────────── */
.eclaw-refs-icon-popover {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 240px;
    max-width: 340px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text, #e0e0e0);
}

.eclaw-refs-icon-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 6px;
}
.eclaw-refs-icon-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #e0e0e0);
}
.eclaw-refs-icon-subtitle {
    font-size: 11px;
    color: var(--muted, #888);
    margin-top: 2px;
    word-break: break-all;
}

.eclaw-refs-icon-section + .eclaw-refs-icon-section {
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
    padding-top: 6px;
}

.eclaw-refs-icon-section-title {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted, #888);
}

.eclaw-refs-icon-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.eclaw-refs-icon-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    min-width: 0;
}
.eclaw-refs-icon-glyph {
    flex: 0 0 auto;
    font-size: 13px;
    line-height: 1;
}
.eclaw-refs-icon-link {
    flex: 1 1 auto;
    color: var(--accent, #93a4ff);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.eclaw-refs-icon-link:hover,
.eclaw-refs-icon-link:focus-visible {
    text-decoration: underline;
    outline: none;
}

.eclaw-refs-icon-empty {
    margin: 2px 0 0;
    font-size: 12px;
    font-style: italic;
    color: var(--muted, #888);
}
.eclaw-refs-icon-error {
    color: #f08080;
    font-size: 12px;
}
.eclaw-refs-icon-loading {
    color: var(--muted, #888);
    font-size: 13px;
    padding: 4px 0;
}

/* ── Mobile bottom-sheet variant ────────────────────────────────────────── */
@media (max-width: 720px) {
    .help-popover.help-popover--sheet {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 14px 14px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 12px);
    }
    .eclaw-refs-icon-popover {
        max-width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .eclaw-refs-icon {
        transition: none;
    }
}
