/* ═══════════════════════════════════════════════════
   Voicemail Transcriber — dark-native, project-native UI
   ═══════════════════════════════════════════════════ */

/* ── Container ── */

.vm-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ── Status Bar ── */

.vm-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    margin-bottom: 12px;
}

.vm-status-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.vm-status-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.vm-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-tertiary, #636366);
    transition: background 0.25s ease;
}

.vm-status-dot[data-status="success"] { background: var(--success, #32D74B); }
.vm-status-dot[data-status="error"]   { background: #FF453A; }
.vm-status-dot[data-status="info"]    { background: var(--apple-blue); }
.vm-status-dot[data-status="loading"] {
    background: var(--apple-blue);
    animation: vmDotPulse 1.2s ease-in-out infinite;
}

.vm-status-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Action Buttons ── */

.vm-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    line-height: 22px;
}

.vm-action-btn:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--apple-blue) 40%, var(--border));
    background: color-mix(in srgb, var(--apple-blue) 6%, var(--bg-input));
}

.vm-action-btn-primary {
    color: var(--apple-blue);
    background: color-mix(in srgb, var(--apple-blue) 10%, var(--bg-input));
    border-color: color-mix(in srgb, var(--apple-blue) 35%, var(--border));
}

.vm-action-btn-primary:hover {
    color: var(--apple-blue);
    background: color-mix(in srgb, var(--apple-blue) 16%, var(--bg-input));
    border-color: var(--apple-blue);
}

/* ── Card ── */

.vm-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
}

/* ── Card Header ── */

.vm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.vm-card-title {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
}

.vm-card-subtitle {
    margin: 3px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

/* ── Card Section ── */

.vm-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.vm-section:last-child,
.vm-section-drop {
    border-bottom: none;
}

/* ── Section Label ── */

.vm-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 3px solid var(--apple-blue);
}

.vm-section-label-flat {
    border-left: none;
    padding-left: 0;
    margin-bottom: 0;
}

/* ── Audio Speed Select ── */

.vm-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text);
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.vm-select:focus-visible {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

/* ── Model Warmup Status ── */

.vm-warmup-section {
    padding-top: 10px;
    padding-bottom: 10px;
}

.vm-warmup-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.vm-warmup-status strong {
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-secondary) 12%, transparent);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 4px 9px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.vm-warmup-status strong[data-status="warming"] {
    background: color-mix(in srgb, var(--apple-blue) 14%, transparent);
    color: var(--apple-blue);
}

.vm-warmup-status strong[data-status="ready"] {
    background: color-mix(in srgb, var(--success) 16%, transparent);
    color: var(--success);
}

.vm-warmup-status strong[data-status="failed"],
.vm-warmup-status strong[data-status="skipped"] {
    background: color-mix(in srgb, var(--warning, #f59e0b) 16%, transparent);
    color: var(--warning, #f59e0b);
}

.vm-warmup-status span {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

/* ── Drop Zone ── */

.vm-section-drop {
    padding: 16px;
}

.vm-drop-zone {
    min-height: 260px;
    border: 2px dashed color-mix(in srgb, var(--apple-blue) 35%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--apple-blue) 3%, var(--bg-card));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s var(--transition-smooth), background 0.18s var(--transition-smooth), transform 0.14s var(--transition-smooth);
}

.vm-drop-zone:hover,
.vm-drop-zone.vm-dragover,
.vm-drop-zone:focus-visible {
    border-color: var(--apple-blue);
    background: color-mix(in srgb, var(--apple-blue) 8%, var(--bg-card));
    outline: none;
}

.vm-drop-zone.vm-dragover {
    transform: translateY(-2px);
}

.vm-drop-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--apple-blue) 12%, transparent);
    color: var(--apple-blue);
    display: grid;
    place-items: center;
    margin-bottom: 2px;
}

.vm-drop-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vm-drop-zone h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 650;
    line-height: 1.2;
}

.vm-drop-zone p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.vm-drop-zone .vm-drop-small {
    max-width: 480px;
    color: var(--text-tertiary);
    font-size: 11px;
}

/* ── File Meta Pills ── */

.vm-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.vm-file-meta[hidden] { display: none !important; }

.vm-file-pill {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 4px 9px;
    font-size: 12px;
}

/* ── Audio Player ── */

.vm-player {
    display: grid;
    grid-template-columns: auto auto minmax(140px, 1fr) auto auto auto;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    overflow: visible;
}

.vm-player[hidden] { display: none !important; }

.vm-icon-btn {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
    font-family: inherit;
    min-height: 34px;
    min-width: 52px;
    padding: 0 10px;
    transition: border-color 0.16s, color 0.16s, background 0.16s;
}

.vm-icon-btn-sm {
    min-width: 40px;
    font-size: 11px;
}

.vm-icon-btn:hover,
.vm-icon-btn:focus-visible {
    border-color: var(--apple-blue);
    color: var(--apple-blue);
    background: color-mix(in srgb, var(--apple-blue) 6%, var(--bg-input));
    outline: none;
}

.vm-scrubber {
    width: 100%;
    cursor: pointer;
    accent-color: var(--apple-blue);
}

.vm-time-label {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    white-space: nowrap;
}

.vm-speed-select {
    min-width: 62px;
}

/* ── Loading Card ── */

.vm-loading-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
}

.vm-loading-card[hidden] { display: none !important; }

.vm-loading-body strong,
.vm-loading-body span {
    display: block;
    line-height: 1.35;
}

.vm-loading-body strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
}

.vm-loading-body span {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
}

.vm-spinner {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--apple-blue) 20%, transparent);
    border-top-color: var(--apple-blue);
    animation: vmSpin 0.75s linear infinite;
}

/* ── Results ── */

.vm-results {
    margin-top: 4px;
}

.vm-results[hidden] { display: none !important; }

.vm-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.vm-results-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vm-backend-label {
    color: var(--text-tertiary);
    font-size: 11px;
}

.vm-results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Output Grid ── */

.vm-output-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.vm-output-card {
    min-width: 0;
}

.vm-output-card-wide {
    grid-column: 1 / -1;
}

.vm-card-copy {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    min-height: 28px;
    padding: 0 9px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.vm-card-copy:hover {
    border-color: color-mix(in srgb, var(--apple-blue) 50%, var(--border));
    color: var(--apple-blue);
    background: color-mix(in srgb, var(--apple-blue) 8%, var(--bg-input));
}

.vm-output-text {
    display: block;
    width: 100%;
    min-height: 200px;
    border: 0;
    resize: vertical;
    background: transparent;
    color: var(--text);
    padding: 14px 16px;
    font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    outline: none;
    box-sizing: border-box;
}

.vm-transcript-text {
    min-height: 240px;
    font-family: inherit;
    font-size: 14px;
}

/* ── Policy Matches ── */

.vm-policy-section[hidden] { display: none !important; }

.vm-client-match-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.vm-client-match-bar[hidden] { display: none !important; }

.vm-client-match-bar span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid color-mix(in srgb, var(--apple-blue) 28%, var(--border));
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1;
    min-height: 28px;
    padding: 0 10px;
}

.vm-client-chip-link,
.vm-client-link {
    color: var(--apple-blue);
    font-weight: 700;
    text-decoration: none;
}

.vm-client-chip-link:hover,
.vm-client-link:hover,
.vm-client-chip-link:focus-visible,
.vm-client-link:focus-visible {
    text-decoration: underline;
    outline: none;
}

.vm-policy-list {
    display: grid;
}

.vm-policy-group-label {
    border-top: 1px solid var(--border);
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 10px 16px 8px;
    text-transform: uppercase;
}

.vm-policy-group-label:first-child {
    border-top: none;
}

.vm-policy-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.vm-policy-card + .vm-policy-card {
    border-top: 1px solid var(--border);
}

.vm-policy-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.vm-policy-type {
    border-radius: 999px;
    background: color-mix(in srgb, var(--apple-blue) 10%, transparent);
    color: var(--apple-blue);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    text-transform: uppercase;
}

.vm-policy-client {
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
}

.vm-policy-meta {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.vm-policy-reason {
    color: var(--text-tertiary);
    font-size: 11px;
    margin-top: 3px;
}

.vm-policy-link,
.vm-policy-sync {
    border: 1px solid color-mix(in srgb, var(--apple-blue) 42%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--apple-blue) 9%, var(--bg-card));
    color: var(--apple-blue);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    line-height: 1;
    min-height: 34px;
    padding: 0 12px;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
}

.vm-policy-link {
    display: inline-flex;
    align-items: center;
}

.vm-policy-link:hover,
.vm-policy-sync:hover,
.vm-policy-link:focus-visible,
.vm-policy-sync:focus-visible {
    border-color: var(--apple-blue);
    background: color-mix(in srgb, var(--apple-blue) 14%, var(--bg-card));
    outline: none;
}

.vm-policy-empty {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    padding: 16px;
}

/* ── Responsive ── */

@media (max-width: 700px) {
    .vm-container {
        padding: 0 14px 72px;
    }

    .vm-drop-zone {
        min-height: 220px;
        padding: 22px 16px;
    }

    .vm-drop-zone h2 {
        font-size: 18px;
    }

    .vm-player {
        grid-template-columns: auto auto auto auto;
        gap: 6px;
    }

    .vm-scrubber,
    .vm-time-label {
        grid-column: 1 / -1;
    }

    .vm-warmup-status {
        grid-template-columns: 1fr auto;
    }

    .vm-output-grid {
        grid-template-columns: 1fr;
    }

    .vm-output-card-wide {
        grid-column: 1;
    }

    .vm-results-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .vm-policy-card {
        grid-template-columns: 1fr;
    }

    .vm-policy-link,
    .vm-policy-sync {
        justify-content: center;
        width: 100%;
    }
}
