/* App-wide tweaks on top of Bulma (loaded from CDN in the layout). */
:root { --chat-max: 52rem; }

.chat-layout { display: grid; grid-template-columns: 16rem 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .chat-layout { grid-template-columns: 1fr; } .chat-sidebar { display: none; } }
.chat-sidebar a { display: block; padding: .4rem .6rem; border-radius: 6px; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sidebar a.is-active, .chat-sidebar a:hover { background: var(--bulma-scheme-main-bis); }
.chat-main { max-width: var(--chat-max); width: 100%; display: flex; flex-direction: column; min-height: calc(100vh - 9rem); }
#messages { flex: 1; display: flex; flex-direction: column; gap: .75rem; padding-bottom: 1rem; }
.bubble { padding: .75rem 1rem; border-radius: 14px; max-width: 85%; line-height: 1.5; overflow-wrap: anywhere; }
.bubble.is-user { align-self: flex-end; background: var(--bulma-link); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.bubble.is-assistant { align-self: flex-start; background: var(--bulma-scheme-main-ter); border-bottom-left-radius: 4px; }
.bubble.is-assistant :is(ul, ol) { margin: .4rem 0 .4rem 1.25rem; }
.bubble.is-assistant ul { list-style: disc; } .bubble.is-assistant ol { list-style: decimal; }
.bubble.is-assistant p + p { margin-top: .5rem; }
.bubble.is-assistant pre { padding: .5rem; border-radius: 6px; font-size: .85em; }
.tool-pill { align-self: flex-start; font-size: .8rem; color: var(--bulma-text-weak); padding: .1rem .6rem; border: 1px dashed var(--bulma-border); border-radius: 999px; }
.typing::after { content: "…"; animation: blink 1s steps(3) infinite; }
@keyframes blink { 50% { opacity: .3; } }
.chat-form { position: sticky; bottom: 0; background: var(--bulma-scheme-main); padding: .75rem 0 1rem; }
.chat-form textarea { resize: none; }

.slide-kind-card { cursor: pointer; }
.camera-tile { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.camera-tile iframe, .camera-tile video, .camera-tile img { width: 100%; height: 100%; border: 0; object-fit: contain; display: block; }
.camera-tile .camera-label { position: absolute; left: .5rem; top: .5rem; background: rgba(0,0,0,.55); color: #fff; padding: .1rem .5rem; border-radius: 6px; font-size: .85rem; }
.bubble:has([data-chat-message-target="output"]:not(:empty)) .typing { display: none; }
