/* Excerpt hover card — the port of the classic ExcerptToolTip.
   Global (not scoped) because BbHoverCardContent renders into a portal
   outside the owning component's scoped-CSS reach — the same reason
   faceted-grid.css and charts.css are global. The detail dialog styles its
   own body inline (like the other dialogs) since it's a normal component
   tree under DialogHost. */

/* BbHoverCardTrigger emits a real <div> (see AsChild="false" in the component
   — without it no element, and no hover handlers, are rendered at all). This
   keeps that wrapper transparent to the hosts' layout: `display: block` +
   `min-width: 0` makes it fill the flex/grid cell it sits in rather than
   sizing to content, so the wrapped card or cell stretches as it did unwrapped.
   Do NOT use `display: contents` here — the wrapper carries the mouseenter
   handler and the card's positioning anchor. */
.excerpt-hover-trigger {
    display: block;
    min-width: 0;
}

.excerpt-hover-card {
    width: 400px;
    max-width: 92vw;
    padding: 0;
    overflow: hidden;
}

.excerpt-hover-head {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.6875rem 0.375rem;
    border-bottom: 1px solid var(--border);
}

.excerpt-hover-kind-icon {
    width: 0.8125rem;
    height: 0.8125rem;
    color: var(--muted-foreground);
    flex: none;
}

.excerpt-hover-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
}

.excerpt-hover-range {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--muted-foreground);
    background: var(--muted);
    border-radius: 999px;
    padding: 0.0625rem 0.375rem;
    flex: none;
    font-variant-numeric: tabular-nums;
}

.excerpt-hover-sub {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    flex-wrap: wrap;
    padding: 0.375rem 0.6875rem 0;
    font-size: 0.65625rem;
    color: var(--muted-foreground);
}

.excerpt-hover-dot {
    opacity: 0.5;
}

.excerpt-hover-layer {
    font-weight: 600;
    color: var(--foreground);
}

.excerpt-hover-body {
    display: flex;
    gap: 0.625rem;
    padding: 0.5rem 0.6875rem 0.625rem;
    align-items: flex-start;
}

.excerpt-hover-quote {
    flex: 1 1 auto;
    min-width: 0;
    border-left: 3px solid var(--border);
    padding-left: 0.5rem;
    font-size: 0.71875rem;
    line-height: 1.5;
    color: var(--foreground);
    max-height: 6.5rem;
    overflow: hidden;
    word-break: break-word;
}

.excerpt-hover-codes {
    flex: 0 0 8.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    border-left: 1px solid var(--border);
    padding-left: 0.5625rem;
    max-height: 6.5rem;
    overflow: hidden;
}

.excerpt-hover-code {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    padding: 0.125rem 0.3125rem;
    font-size: 0.65625rem;
    color: var(--foreground);
    min-width: 0;
}

.excerpt-hover-code-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    flex: none;
}

.excerpt-hover-code-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
}

.excerpt-hover-code-weight {
    font-size: 0.59375rem;
    font-weight: 700;
    color: var(--foreground);
    background: color-mix(in oklab, var(--background) 80%, transparent);
    border-radius: 0.1875rem;
    padding: 0 0.1875rem;
    flex: none;
    font-variant-numeric: tabular-nums;
}

.excerpt-hover-overflow,
.excerpt-hover-nocodes {
    font-size: 0.625rem;
    color: var(--muted-foreground);
    font-style: italic;
    padding-top: 0.125rem;
}

.excerpt-hover-foot {
    border-top: 1px solid var(--border);
    padding: 0.3125rem 0.6875rem;
    font-size: 0.625rem;
    color: var(--muted-foreground);
    background: var(--muted);
}

.excerpt-hover-missing {
    padding: 0.875rem;
    font-size: 0.71875rem;
    color: var(--muted-foreground);
    text-align: center;
}
