/* Voicemail Transcriber */

.vm-review-strip {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.1fr) minmax(200px, 0.8fr) auto auto;
    align-items: center;
    gap: 18px;
    min-height: 56px;
    padding: 8px 0 12px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 6px;
}

.vm-review-progress,
.vm-current-file,
.vm-review-status {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.vm-review-progress > span,
.vm-current-file > span,
.vm-review-status > span {
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.vm-current-file strong,
.vm-review-status strong {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vm-review-strip .progress-track {
    height: 7px;
    margin: 0;
}

.vm-container {
    box-sizing: border-box;
    max-width: 1480px;
    margin: 0 auto;
    padding: 16px 20px 76px;
}

body.dark-mode .vm-card {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(255, 255, 255, 0.04);
}

body.dark-mode .vm-card,
body.dark-mode .vm-drop-zone,
body.dark-mode .vm-detail-item,
body.dark-mode .vm-search-text,
body.dark-mode .vm-output-text {
    color-scheme: dark;
}

.vm-workspace {
    display: grid;
    grid-template-columns: minmax(270px, 0.78fr) minmax(520px, 1.55fr) minmax(300px, 0.92fr);
    gap: 14px;
    align-items: start;
}

.vm-left-rail,
.vm-main-rail,
.vm-right-rail {
    min-width: 0;
}

.vm-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px var(--shadow), 0 0 0 0.5px rgba(0, 122, 255, 0.03);
}

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

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

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

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

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

.vm-section-label {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.vm-section-label-flat {
    letter-spacing: 0.04em;
}

.vm-action-btn,
.vm-card-copy,
.vm-policy-sync,
.vm-policy-link,
.vm-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 0 11px;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.vm-action-btn:hover,
.vm-card-copy:hover,
.vm-policy-sync:hover,
.vm-policy-link:hover,
.vm-icon-btn:hover,
.vm-action-btn:focus-visible,
.vm-card-copy:focus-visible,
.vm-policy-sync:focus-visible,
.vm-policy-link:focus-visible,
.vm-icon-btn:focus-visible {
    border-color: color-mix(in srgb, var(--apple-blue) 48%, var(--border));
    color: var(--apple-blue);
    background: color-mix(in srgb, var(--apple-blue) 7%, var(--bg-input));
    transform: translateY(-1px);
    outline: none;
}

.vm-action-btn-primary,
.vm-policy-link {
    color: #fff;
    background: var(--apple-blue);
    border-color: var(--apple-blue);
}

.vm-action-btn-primary:hover,
.vm-policy-link:hover,
.vm-policy-link:focus-visible {
    color: #fff;
    background: color-mix(in srgb, var(--apple-blue) 86%, #111827);
}

.vm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-tertiary);
}

.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(--warning, #f59e0b);
    animation: vmDotPulse 1.15s ease-in-out infinite;
}

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

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

.vm-warmup-status strong {
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-secondary) 11%, transparent);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 8px;
    text-transform: uppercase;
}

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

.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="failed"],
.vm-warmup-status strong[data-status="skipped"] {
    background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent);
    color: var(--warning, #f59e0b);
}

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

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

.vm-drop-zone {
    min-height: 168px;
    border: 1px dashed color-mix(in srgb, var(--apple-blue) 38%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--apple-blue) 4%, var(--bg-card));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.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(-1px);
}

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

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

.vm-drop-zone h2 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 750;
}

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

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

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

.vm-file-pill,
.vm-tag {
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 650;
}

.vm-tag-muted {
    color: var(--text-tertiary);
}

.vm-player[hidden],
.vm-loading-card[hidden],
.vm-history[hidden],
.vm-results[hidden],
.vm-policy-section[hidden],
.vm-company-memory[hidden],
.vm-memory-section[hidden],
.vm-client-match-bar[hidden],
.vm-search-panel[hidden],
.vm-learning-status[hidden] {
    display: none !important;
}

.vm-player {
    display: grid;
    gap: 12px;
    padding-bottom: 12px;
}

.vm-player .vm-card-header {
    border-bottom: 0;
    padding-bottom: 4px;
}

.vm-select {
    min-height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    padding: 0 9px;
}

.vm-audio-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 52px;
    padding: 0 16px;
    color: var(--apple-blue);
}

.vm-audio-wave span {
    display: block;
    width: 3px;
    min-height: 8px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.72;
}

.vm-audio-wave span:nth-child(3n) { height: 34px; }
.vm-audio-wave span:nth-child(3n + 1) { height: 18px; }
.vm-audio-wave span:nth-child(3n + 2) { height: 27px; }

.vm-player-controls {
    display: grid;
    grid-template-columns: auto auto auto minmax(90px, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0 14px;
}

.vm-icon-btn-sm {
    min-width: 42px;
    padding: 0 8px;
}

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

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

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

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

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

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

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

.vm-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 10px 14px;
    border: 0;
    border-top: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    text-align: left;
}

.vm-history-item:first-child {
    border-top: 0;
}

.vm-history-item:hover,
.vm-history-item:focus-visible {
    background: color-mix(in srgb, var(--apple-blue) 6%, transparent);
    outline: none;
}

.vm-history-body {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.vm-history-body strong,
.vm-history-body small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vm-history-body strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 750;
}

.vm-history-body small {
    color: var(--text-secondary);
    font-size: 11px;
}

.vm-history-actions {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.vm-history-status,
.vm-match-badge {
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-secondary) 11%, transparent);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    min-height: 24px;
    padding: 7px 9px;
    white-space: nowrap;
}

.vm-history-status-processing {
    background: color-mix(in srgb, var(--apple-blue) 13%, transparent);
    color: var(--apple-blue);
}

.vm-history-status-pending {
    background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent);
    color: var(--warning, #f59e0b);
}

.vm-history-status-done,
.vm-match-badge {
    background: color-mix(in srgb, var(--success) 15%, transparent);
    color: var(--success);
}

.vm-history-status-error {
    background: color-mix(in srgb, #ff453a 15%, transparent);
    color: #ff453a;
}

.vm-history-action,
.vm-history-delete {
    min-height: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 750;
    padding: 0 9px;
}

.vm-results {
    display: grid;
    gap: 14px;
}

.vm-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
}

.vm-results-bar-left,
.vm-results-actions,
.vm-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

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

.vm-output-text {
    display: block;
    width: 100%;
    min-height: 146px;
    border: 0;
    resize: vertical;
    background: transparent;
    color: var(--text);
    padding: 15px 18px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.62;
    outline: none;
    box-sizing: border-box;
}

.vm-transcript-text {
    min-height: 300px;
    font-size: 14px;
    color: color-mix(in srgb, var(--text) 92%, #334155);
}

.vm-transcript-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px 14px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
}

.vm-transcript-footer strong {
    border-radius: 999px;
    margin-left: 6px;
    padding: 4px 8px;
    background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent);
    color: var(--warning, #f59e0b);
}

.vm-transcript-footer strong[data-level="high"] {
    background: color-mix(in srgb, var(--success) 15%, transparent);
    color: var(--success);
}

.vm-transcript-footer strong[data-level="medium"] {
    background: color-mix(in srgb, var(--apple-blue) 13%, transparent);
    color: var(--apple-blue);
}

.vm-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
}

.vm-detail-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: start;
    gap: 9px;
    min-height: 78px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-card) 78%, var(--bg-input));
    padding: 10px;
}

.vm-detail-item[data-status="ok"] {
    border-color: color-mix(in srgb, var(--success) 24%, var(--border));
}

.vm-detail-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--apple-blue);
    background: color-mix(in srgb, var(--apple-blue) 9%, transparent);
    font-size: 9px;
    font-weight: 850;
}

.vm-detail-body {
    display: grid;
    gap: 4px;
    min-width: 0;
}

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

.vm-detail-input {
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 620;
    line-height: 1.38;
    outline: none;
    padding: 0;
}

textarea.vm-detail-input {
    min-height: 48px;
    resize: none;
    overflow-wrap: anywhere;
    overflow: hidden;
}

.vm-detail-item[data-field="organization"] textarea.vm-detail-input,
.vm-detail-item[data-field="client"] textarea.vm-detail-input,
.vm-detail-item[data-field="propertyAddress"] textarea.vm-detail-input {
    min-height: 58px;
}

.vm-detail-status {
    align-self: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--warning, #f59e0b) 13%, transparent);
    color: var(--warning, #f59e0b);
    font-size: 9px;
    font-weight: 850;
    line-height: 1;
    padding: 5px 6px;
    text-transform: uppercase;
}

.vm-detail-item[data-status="ok"] .vm-detail-status {
    background: color-mix(in srgb, var(--success) 14%, transparent);
    color: var(--success);
}

.vm-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 14px 14px;
}

.vm-learning-status {
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--apple-blue) 5%, transparent);
    font-size: 12px;
    line-height: 1.45;
    padding: 10px 14px;
}

.vm-actions-card .vm-output-text {
    min-height: 118px;
}

.vm-hawksoft-note-card .vm-output-text {
    min-height: 104px;
}

.vm-search-panel {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.vm-search-panel label {
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.vm-search-text {
    width: 100%;
    min-height: 176px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    line-height: 1.48;
    padding: 10px;
    resize: none;
    overflow: hidden;
}

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

.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;
    min-height: 28px;
    padding: 0 9px;
}

.vm-client-chip-link,
.vm-client-link {
    color: var(--apple-blue);
    font-weight: 800;
    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: 850;
    letter-spacing: 0.04em;
    padding: 11px 14px 8px;
    text-transform: uppercase;
}

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

.vm-policy-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 13px 14px;
    border-top: 1px solid var(--border);
}

.vm-policy-card-strong {
    background: color-mix(in srgb, var(--apple-blue) 4%, transparent);
}

.vm-policy-card:first-child {
    border-top: 0;
}

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

.vm-policy-type {
    border-radius: 999px;
    background: color-mix(in srgb, var(--apple-blue) 11%, transparent);
    color: var(--apple-blue);
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    padding: 5px 8px;
}

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

.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: 4px;
}

.vm-policy-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

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

.vm-memory-body {
    display: grid;
}

.vm-memory-company {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 14px;
}

.vm-memory-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--apple-blue) 10%, var(--bg-input));
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
}

.vm-memory-company strong,
.vm-memory-company span {
    display: block;
    min-width: 0;
}

.vm-memory-company strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

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

.vm-memory-contacts {
    display: grid;
    border-top: 1px solid var(--border);
}

.vm-memory-row {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
}

.vm-memory-row span {
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 750;
}

.vm-memory-row strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.vm-memory-row em {
    border-radius: 999px;
    background: color-mix(in srgb, var(--success) 13%, transparent);
    color: var(--success);
    font-size: 10px;
    font-style: normal;
    font-weight: 850;
    padding: 5px 7px;
}

.vm-memory-meta {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    color: var(--text-secondary);
    font-size: 12px;
}

.vm-memory-meta strong {
    color: var(--text);
    font-size: 12px;
}

.vm-memory-save {
    margin: 0 14px 14px;
}

@media (max-width: 1160px) {
    .vm-workspace {
        grid-template-columns: minmax(260px, 0.78fr) minmax(460px, 1.28fr);
    }

    .vm-right-rail {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(280px, 0.65fr);
        gap: 14px;
    }
}

@media (max-width: 860px) {
    .vm-container {
        padding: 12px 12px 72px;
    }

    .vm-review-strip,
    .vm-workspace,
    .vm-right-rail {
        grid-template-columns: 1fr;
    }

    .vm-review-strip {
        gap: 10px;
        padding: 10px 14px 14px;
    }

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

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

    .vm-results-actions,
    .vm-card-actions,
    .vm-policy-actions {
        width: 100%;
    }

    .vm-results-actions .vm-action-btn,
    .vm-card-actions .vm-card-copy,
    .vm-policy-actions .vm-policy-sync,
    .vm-policy-actions .vm-policy-link,
    .vm-memory-save {
        width: 100%;
    }

    .vm-player-controls {
        grid-template-columns: repeat(3, auto);
    }

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