.page-header-main {
    align-items: flex-start;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
}

.page-subtitle {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.status-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: rgb(var(--color-text-muted));
}

.chat-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.chat-card-header {
    background: rgb(var(--color-surface-2));
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgb(var(--color-border));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-card-title {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: rgb(var(--color-text-muted));
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chat-card-menu {
    color: rgb(var(--color-text-muted));
}

.voice-messages {
    height: 420px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.connect-overlay {
    position: absolute;
    inset: 0;
    background: rgb(var(--color-bg) / 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.connect-card {
    padding: 2rem;
    text-align: center;
    max-width: 22rem;
    width: 100%;
    margin: 1rem;
}

.connect-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    margin: 0 auto 1.25rem;
}

.connect-icon-mark {
    font-size: 1.5rem;
    color: rgb(var(--color-text-secondary));
}

.connect-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: rgb(var(--color-text));
    margin-bottom: 0.5rem;
}

.connect-description {
    font-size: 0.875rem;
    color: rgb(var(--color-text-secondary));
    margin-bottom: 1.5rem;
}

.controls-card {
    padding: 1.25rem;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
}

.voice-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mic-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spacer-ghost {
    display: block;
}

.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgb(var(--color-text-secondary));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.field-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: rgb(var(--color-bg));
    border: 1px solid rgb(var(--color-border));
    border-radius: 0.5rem;
    color: rgb(var(--color-text));
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2371717a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    transition: border-color 0.2s;
}

.field-select:focus {
    border-color: rgb(var(--color-accent));
    box-shadow: 0 0 0 3px rgb(var(--color-accent) / 0.15);
}

.talk-btn {
    width: 5rem;
    height: 5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgb(var(--color-border));
    background: rgb(var(--color-surface-2));
    color: rgb(var(--color-text));
    font-size: 2rem;
    transition: all 0.3s;
    position: relative;
}

.talk-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.talk-btn.recording {
    background: rgb(var(--color-danger) / 0.2);
    border: 2px solid rgb(var(--color-danger));
    color: rgb(var(--color-danger-soft));
    transform: scale(1.05);
}

.talk-btn.recording::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 1px solid rgb(var(--color-danger));
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    opacity: 0.5;
}

.talk-btn:not(:disabled):not(.recording):hover {
    border-color: rgb(var(--color-accent));
}

.talk-status-shell {
    text-align: center;
}

.talk-status-text {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgb(var(--color-text-muted));
}

.volume-bars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: 1.5rem;
    justify-content: center;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.volume-bars.is-visible {
    opacity: 1;
}

.volume-bar {
    width: 0.25rem;
    border-radius: 9999px;
    background: linear-gradient(to top, rgb(var(--color-success)), rgb(var(--color-success) / 0.85));
    transition: height 0.15s;
    height: 4px;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes barAnim {
    0%,
    100% {
        height: 4px;
    }

    50% {
        height: 100%;
    }
}

.recording-active .volume-bar {
    animation: barAnim 0.8s ease-in-out infinite;
}

.recording-active .volume-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.recording-active .volume-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.recording-active .volume-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.recording-active .volume-bar:nth-child(5) {
    animation-delay: 0.15s;
}

.msg-bubble {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    max-width: 85%;
}

.msg-bubble.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.msg-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgb(var(--color-surface-2));
    border: 1px solid rgb(var(--color-border));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.msg-avatar-icon {
    font-size: 0.875rem;
    color: rgb(var(--color-text));
}

.msg-content {
    background: rgb(var(--color-surface-2));
    border: 1px solid rgb(var(--color-surface-2));
    border-radius: 0.75rem;
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgb(var(--color-text));
}

.msg-bubble.user .msg-content {
    background: rgb(var(--color-accent) / 0.12);
    border-color: rgb(var(--color-accent) / 0.25);
}

.msg-time {
    font-size: 0.625rem;
    font-family: var(--font-mono);
    color: rgb(var(--color-text-muted));
    margin-top: 0.5rem;
    display: block;
}

.msg-error {
    background: rgb(var(--color-danger) / 0.08);
    border: 1px solid rgb(var(--color-danger) / 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: rgb(var(--color-danger-soft));
    width: 100%;
}

.msg-system {
    text-align: center;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: rgb(var(--color-text-muted));
    padding: 0.25rem 0;
}

@media (max-width: 768px) {
    .page-shell {
        padding: 1.25rem 1rem 1.5rem;
    }

    .nav-bar {
        padding: 0.875rem 1rem;
    }

    .page-header {
        gap: 0.875rem;
    }

    .page-heading {
        width: 100%;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .spacer-ghost {
        display: none;
    }

    .msg-bubble {
        max-width: 100%;
    }
}