:root {
    --dvh: 100dvh;
}

html,
body {
    height: var(--dvh);
    background-color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
    overflow: hidden;
    margin: 0;
}

.safe-bottom {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background-color: #38bdf8;
    animation: dotBounce 1.2s infinite ease-in-out both;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

#canvas-container {
    width: 100%;
    height: 100%;
    touch-action: none;
    position: relative;
    overflow: hidden;
}

.agent-tag {
    position: absolute;
    transform: translate(-50%, -120%);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 25;
    white-space: nowrap;
}

.speech-bubble {
    position: absolute;
    transform: translate(-50%, -155%) scale(0.85);
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 35;
    opacity: 0;
    user-select: none;
    background: transparent;
    border: none;
    font-size: 1.55rem;
    line-height: 1;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
}

.speech-bubble.visible {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    transform: translate(-50%, -170%) scale(1);
    animation: bubbleFloat 1.5s ease-in-out infinite alternate;
}

.speech-bubble.visible:hover {
    transform: translate(-50%, -175%) scale(1.25);
    z-index: 45;
}

.speech-bubble.pitch-glow {
    filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.95));
    font-size: 1.75rem;
}

@keyframes bubbleFloat {
    0% {
        margin-top: 0px;
    }

    100% {
        margin-top: -6px;
    }
}

.prose h1,
.prose h2,
.prose h3 {
    color: #f8fafc;
    font-weight: 700;
    margin-top: 0.9rem;
    margin-bottom: 0.4rem;
}

.prose p,
.prose li {
    color: #cbd5e1;
    font-size: 0.85rem;
    line-height: 1.6;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.6rem 0;
    font-size: 0.78rem;
}

.prose th,
.prose td {
    border: 1px solid #334155;
    padding: 6px 8px;
    text-align: left;
}

.prose th {
    background-color: #1e293b;
    color: #38bdf8;
}

.prose pre {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 0.5rem;
    padding: 0.7rem;
    overflow-x: auto;
}