@layer htmxo {
.htmxo-thread { display: flex; flex-direction: column; min-height: 0; }
.htmxo-thread-viewport { position: relative; min-height: 0; }
.htmxo-thread-scroll {
    max-height: var(--htmxo-thread-height, 60vh);
    overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain;
}
.htmxo-thread-items { display: flex; flex-direction: column; gap: var(--htmxo-thread-gap, 0.5rem); }
.htmxo-thread-items:empty::before {
    content: attr(data-empty); display: block; padding: 1rem 0;
    text-align: center; font-size: 0.875em; color: var(--htmxo-muted);
}
.htmxo-thread-item { min-width: 0; }
.htmxo-thread-older {
    display: flex; align-items: center; justify-content: center;
    height: 2rem; overflow: hidden; font-size: 0.8em; color: var(--htmxo-muted);
}
.htmxo-thread-older:empty { height: 0; }
.htmxo-thread-older [role="button"] { cursor: pointer; text-decoration: underline dotted; }
.htmxo-thread-status { padding: 0.25rem 0; font-size: 0.8em; color: var(--htmxo-error); }
.htmxo-thread-status details { color: var(--htmxo-muted); }
.htmxo-thread-status[hidden] { display: none; }
.htmxo-thread-focus { animation: htmxo-thread-focus 2.5s ease-out; border-radius: 0.25rem; }
@keyframes htmxo-thread-focus {
    from { background-color: color-mix(in srgb, var(--htmxo-accent) 25%, transparent); }
    to   { background-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
    .htmxo-thread-focus { animation: none; outline: 2px solid var(--htmxo-accent); }
}
}
.htmxo-thread-viewport > .htmxo-thread-new {
    position: absolute; left: 50%; bottom: 0.75rem; transform: translateX(-50%);
    width: auto; margin: 0; padding: 0.2rem 0.75rem; border-radius: 999px;
    font-size: 0.8rem; line-height: 1.4; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.htmxo-thread-viewport > .htmxo-thread-new[hidden] { display: none; }
