.vad-page {
    flex: 1;
    padding: 1.5rem 1.5rem 2rem;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgb(var(--color-surface-2));
}

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 5rem;
}

.setup-card {
    padding: 1.25rem;
}

.section-title {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(var(--color-text-muted));
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.upload-wrapper {
    margin-bottom: 1rem;
}

.upload-zone {
    border: 1.5px dashed rgb(var(--color-border));
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover {
    border-color: rgb(var(--color-accent));
    background: rgb(var(--color-accent) / 0.04);
}

.upload-icon {
    font-size: 1.25rem;
    color: rgb(var(--color-text-muted));
    display: block;
    margin-bottom: 0.25rem;
}

.upload-title {
    font-size: 0.8125rem;
    color: rgb(var(--color-text));
    font-weight: 500;
}

.upload-subtitle {
    font-size: 0.6875rem;
    color: rgb(var(--color-text-muted));
    margin-top: 0.125rem;
}

.upload-status {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
}

.status-success {
    color: rgb(var(--color-success));
    font-size: 0.75rem;
}

.status-warn {
    color: rgb(var(--color-warning));
    font-size: 0.75rem;
}

.status-error {
    color: rgb(var(--color-danger-soft));
    font-size: 0.75rem;
}

.divider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: rgb(var(--color-surface-2));
}

.divider-text {
    font-size: 0.6375rem;
    font-family: var(--font-mono);
    color: rgb(var(--color-text-muted));
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.field-row {
    margin-bottom: 1rem;
}

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

.field-input {
    width: 100%;
    padding: 0.5rem 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;
    transition: border-color 0.2s;
}

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

.field-select {
    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;
}

.dual-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.progress-outer {
    height: 3px;
    background: rgb(var(--color-surface-2));
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 1.125rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgb(var(--color-accent)), rgb(var(--color-accent-soft)));
    transition: width 0.4s;
    width: 0%;
}

.btn-start {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.625rem;
    background: rgb(var(--color-accent-strong));
    color: rgb(var(--color-text));
    border: 1px solid rgb(var(--color-accent) / 0.5);
    box-shadow: 0 8px 24px -12px rgb(var(--color-accent-strong) / 0.55);
}

.btn-start:hover:not(:disabled) {
    background: rgb(var(--color-accent));
}

.btn-stop {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    background: rgb(var(--color-danger) / 0.1);
    color: rgb(var(--color-danger-soft));
    border: 1px solid rgb(var(--color-danger) / 0.2);
}

.btn-stop:hover:not(:disabled) {
    background: rgb(var(--color-danger) / 0.2);
}

.small-gap {
    height: 0.625rem;
}

.controls-card {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.controls-card .btn-ghost {
    justify-content: flex-start;
}

.btn-download {
    color: rgb(var(--color-accent-soft));
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.transcript-card,
.suggestion-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgb(var(--color-surface-2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.transcript-body {
    height: 380px;
    overflow-y: auto;
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgb(var(--color-text-muted));
    gap: 0.75rem;
    text-align: center;
    padding: 2rem;
}

.chat-empty-icon {
    font-size: 2.5rem;
    color: rgb(var(--color-border));
}

.chat-empty-title {
    font-size: 0.875rem;
    color: rgb(var(--color-text-secondary));
    font-weight: 500;
}

.chat-empty-subtitle {
    font-size: 0.8125rem;
    color: rgb(var(--color-text-muted));
    margin-top: 0.25rem;
}

.chat-feed {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    padding: 1.25rem;
}

.chat-row {
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
}

.chat-row.agent {
    flex-direction: row;
}

.chat-row.customer {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8125rem;
}

.chat-avatar.agent {
    background: rgb(var(--color-accent) / 0.15);
    border: 1px solid rgb(var(--color-accent) / 0.25);
    color: rgb(var(--color-accent-soft));
}

.chat-avatar.customer {
    background: rgb(var(--color-success) / 0.1);
    border: 1px solid rgb(var(--color-success) / 0.2);
    color: rgb(var(--color-success));
}

.chat-bubble-wrap {
    max-width: 74%;
}

.chat-name {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: rgb(var(--color-text-muted));
    margin-bottom: 0.25rem;
}

.chat-row.customer .chat-name {
    text-align: right;
}

.chat-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgb(var(--color-text));
}

.chat-bubble.agent {
    background: rgb(var(--color-surface-2));
    border: 1px solid rgb(var(--color-border));
    border-bottom-left-radius: 0.25rem;
}

.chat-bubble.customer {
    background: rgb(var(--color-accent) / 0.14);
    border: 1px solid rgb(var(--color-accent) / 0.22);
    border-bottom-right-radius: 0.25rem;
}

.chat-meta {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: rgb(var(--color-text-muted));
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.meta-separator {
    color: rgb(var(--color-border));
}

.chat-row.customer .chat-meta {
    justify-content: flex-end;
}

.suggestion-icon {
    color: rgb(var(--color-warning));
}

.suggestions-body {
    padding: 1rem;
    max-height: 320px;
    overflow-y: auto;
}

.suggestions-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: rgb(var(--color-text-muted));
    gap: 0.5rem;
    text-align: center;
}

.suggestions-empty-icon {
    font-size: 1.75rem;
    color: rgb(var(--color-border));
}

.suggestions-empty-text {
    font-size: 0.8125rem;
}

.sug-card {
    background: rgb(17 17 20);
    border: 1px solid rgb(var(--color-surface-2));
    border-radius: 0.625rem;
    padding: 1rem;
    margin-bottom: 0.625rem;
}

.sug-card.question-card {
    border-color: rgb(var(--color-accent) / 0.25);
    background: rgb(var(--color-accent) / 0.04);
}

.sug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(var(--color-text));
}

.sug-body {
    font-size: 0.8125rem;
    color: rgb(var(--color-text-secondary));
    line-height: 1.55;
}

.sug-foot {
    font-size: 0.6875rem;
    color: rgb(var(--color-text-muted));
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

.pill-high,
.pill-medium,
.pill-low {
    border-radius: 0.25rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.6875rem;
}

.pill-high {
    background: rgb(52 211 153 / 0.1);
    color: rgb(52 211 153);
    border: 1px solid rgb(52 211 153 / 0.2);
}

.pill-medium {
    background: rgb(251 191 36 / 0.1);
    color: rgb(251 191 36);
    border: 1px solid rgb(251 191 36 / 0.2);
}

.pill-low {
    background: rgb(248 113 113 / 0.1);
    color: rgb(248 113 113);
    border: 1px solid rgb(248 113 113 / 0.2);
}

.spin {
    animation: spinAnim 0.7s linear infinite;
    display: inline-block;
}

@keyframes spinAnim {
    to {
        transform: rotate(360deg);
    }
}

.no-margin {
    margin: 0;
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .left-panel {
        position: static;
    }
}
