/* Revamp doc §7.1 — CoutinhoMessageThread, the shared component for the gated phase's phone-bezel popup
   and (ticket 4) the persistent status-bar drawer. Telegram-style: left-aligned only (one-way narrative
   delivery, not a real back-and-forth — see the component's own remarks), avatar grouped once per burst,
   date dividers, muted timestamps. */

.sd-coutinho-thread {
    display: flex;
    flex-direction: column;
    gap: var(--sd-space-4);
    margin-bottom: var(--sd-space-5);
}

.sd-coutinho-thread__header {
    display: flex;
    align-items: center;
    gap: var(--sd-space-3);
    padding-bottom: var(--sd-space-3);
    border-bottom: 1px solid var(--sd-border-subtle);
}

.sd-coutinho-thread__header .sd-coutinho-avatar {
    width: 40px;
    height: 40px;
}

.sd-coutinho-thread__name {
    font-family: var(--sd-font-data);
    font-size: var(--sd-text-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--sd-text-primary);
}

.sd-coutinho-thread__body {
    display: flex;
    flex-direction: column;
    gap: var(--sd-space-4);
}

.sd-coutinho-date-divider {
    align-self: center;
    font-size: var(--sd-text-xs);
    color: var(--sd-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sd-coutinho-bubble-group {
    display: flex;
    align-items: flex-end;
    gap: var(--sd-space-3);
}

.sd-coutinho-bubble-group__avatar {
    flex-shrink: 0;
}

.sd-coutinho-bubble-group__bubbles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sd-space-1);
    min-width: 0;
}

.sd-coutinho-bubble {
    background: var(--sd-surface-2);
    border: 1px solid var(--sd-border-subtle);
    border-radius: var(--sd-radius-md);
    border-bottom-left-radius: var(--sd-radius-sm);
    padding: var(--sd-space-3) var(--sd-space-4);
    font-size: var(--sd-text-sm);
    font-family: var(--sd-font-display);
    line-height: var(--sd-line-sm);
    color: var(--sd-text-primary);
    max-width: 100%;
}

.sd-coutinho-bubble-group__timestamp {
    font-size: var(--sd-text-xs);
    color: var(--sd-text-tertiary);
    padding: 0 var(--sd-space-1);
}

.sd-coutinho-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--sd-surface-2);
    border: 1px solid var(--sd-border-subtle);
    border-radius: var(--sd-radius-md);
    border-bottom-left-radius: var(--sd-radius-sm);
    padding: var(--sd-space-3) var(--sd-space-4);
    width: fit-content;
}

.sd-coutinho-typing span {
    width: 5px;
    height: 5px;
    border-radius: var(--sd-radius-full);
    background: var(--sd-text-tertiary);
    animation: sd-coutinho-typing-bounce 1.1s infinite ease-in-out;
}

.sd-coutinho-typing span:nth-child(2) { animation-delay: 0.15s; }
.sd-coutinho-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes sd-coutinho-typing-bounce {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
    .sd-coutinho-typing span {
        animation: none;
        opacity: 0.6;
    }
}

/* Phone-bezel treatment (§7.1 A) — a thin bezel border and a small pill notch, restrained rather than
   skeuomorphic, per the design system's "financial terminal, not neon street" invariant. */
.sd-phone-frame {
    padding-top: var(--sd-space-7);
    max-height: 80vh;
    overflow-y: auto;
}

.sd-phone-frame__notch {
    position: absolute;
    top: var(--sd-space-3);
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 6px;
    border-radius: var(--sd-radius-full);
    background: var(--sd-surface-3);
}
