/* Chat minimap — one tick per message on the chat column's edge, with a
   hover/focus preview card and click-to-jump. The strip is a child of
   #chat-column (not the sidebar or the artifact pane), so it can never overlap
   either; chat-minimap.js also hides it when the column is too narrow for the
   gutter. Ticks are positioned by JS from each message's offset in the
   conversation's scroll height, so the rail is a miniature of the transcript.
   The preview card's horizontal edge is JS-owned too (chat-minimap.js reads the
   measured rail rect and places the card on its inner side); the right offset
   below is only the fallback for the no-rect path. */
#chat-column {
    position: relative;
}
.chat-minimap {
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 100%;
    z-index: var(--z-raised, 100);
    pointer-events: none;
}
.chat-minimap.hidden {
    display: none;
}
.chat-minimap-ticks {
    position: relative;
    width: 100%;
    height: 100%;
}
button.chat-minimap-tick {
    position: absolute;
    left: 2px;
    width: 24px;
    height: 9px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--md-on-surface-variant);
    cursor: pointer;
    pointer-events: auto;
}
.chat-minimap-tick::after {
    content: "";
    position: absolute;
    inset: -8px -2px; /* the 24x9 visual becomes a 28x25 hit target — above the 24px WCAG 2.5.8
        floor, the same ::after expansion as .spcy-toast-close (css/shared.css). The painted
        bar stays the ::before below; only the hit box grows. */
}
.chat-minimap-tick::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    opacity: .32;
    transition: width var(--md-duration-s) var(--md-easing-standard),
                opacity var(--md-duration-s) var(--md-easing-standard),
                background-color var(--md-duration-s) var(--md-easing-standard);
}
.chat-minimap-tick:hover::before,
.chat-minimap-tick:focus-visible::before,
.chat-minimap-tick.is-active::before {
    width: 18px;
    opacity: 1;
    background: var(--md-on-surface);
}
.chat-minimap-tick:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}
.chat-minimap-preview {
    position: absolute;
    /* Fallback for a rail box that cannot be measured; positionCard() sets both
       left and right from the live rect, so JS owns placement. */
    right: 2.5rem;
    left: auto;
    top: 0;
    width: min(20rem, 48vw);
    max-width: 22rem;
    padding: 10px 12px;
    border: 1px solid var(--md-outline-variant);
    border-radius: var(--radius-lg, 12px);
    background: var(--md-surface-container-high);
    color: var(--md-on-surface);
    box-shadow: var(--md-elevation-3);
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    z-index: var(--z-raised, 100);
    pointer-events: auto;
}
.chat-minimap-preview.hidden {
    display: none;
}
.chat-minimap-preview-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.chat-minimap-preview-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: var(--type-sm);
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-minimap-preview-icon {
    flex-shrink: 0;
    color: var(--md-on-surface-variant);
    font-size: var(--type-sm);
}
.chat-minimap-preview-snippet {
    display: -webkit-box;
    margin: 4px 0 0;
    overflow: hidden;
    color: var(--md-on-surface-variant);
    font-size: var(--type-xs);
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}
.chat-minimap-preview-snippet.hidden {
    display: none;
}
.chat-minimap-preview-role {
    display: inline-block;
    margin-top: 8px;
    color: var(--md-on-surface-variant);
    font-size: var(--type-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.chat-minimap-preview-role--user {
    color: var(--brand);
}
.chat-minimap-flash {
    animation: chat-minimap-flash var(--md-duration-l, 300ms) var(--md-easing-standard) both;
    border-radius: var(--radius-lg, 12px);
}
@keyframes chat-minimap-flash {
    0% {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 45%, transparent);
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}
@media (max-width: 999px) {
    .chat-minimap,
    .chat-minimap-preview {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .chat-minimap-tick::before {
        transition: none;
    }
    .chat-minimap-flash {
        animation: none;
    }
}
