/* Voice Settings page */
/* Pinned chrome: the shell is exactly the viewport and only .vs-body scrolls, so the tool
   bar strip and header never slide off (100vh first, 100dvh for phones). */
.vs-shell {
    height: 100vh; height: 100dvh; overflow: hidden;
    display: flex; flex-direction: column;
    background: #F5F5F7;
}
.vs-header {
    background: #1A1A1A; color: #fff;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    display: flex; align-items: center; gap: 10px;
    flex: 0 0 auto;
}
.vs-header h1 { margin: 0; font-size: 14pt; font-weight: 600; flex: 1; }

.vs-body {
    flex: 1; overflow-y: auto;
    padding: 16px;
    display: flex; flex-direction: column; gap: 16px;
    max-width: 640px; width: 100%;
    margin: 0 auto;
}

.vs-card {
    background: #fff;
    border: 1px solid #E0E0E2;
    border-radius: 10px;
    padding: 18px 20px;
}
.vs-card h2 {
    margin: 0 0 4px; font-size: 13pt; font-weight: 700; color: #1A1A1A;
}
.vs-card-toggle {
    cursor: pointer; user-select: none;
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 !important; padding: 2px 0;
}
.vs-card-toggle:hover { color: #1A73E8; }
.vs-arrow {
    font-size: 10pt; color: #999;
    transition: transform 0.2s;
}
.vs-collapsible.collapsed .vs-arrow { transform: rotate(-90deg); }
.vs-collapsible.collapsed .vs-card-content { display: none; }
.vs-card-content { margin-top: 8px; }
.vs-desc {
    margin: 0 0 14px; font-size: 10.5pt; color: #666; line-height: 1.4;
}

/* Model selector */
.vs-field { margin-bottom: 10px; }
.vs-field label {
    display: block; font-size: 9pt; font-weight: 600;
    color: #555; text-transform: uppercase; letter-spacing: 0.4px;
    margin-bottom: 4px;
}
.vs-field select {
    width: 100%; padding: 10px 12px;
    font-size: 12pt; border: 1px solid #D0D0D6;
    border-radius: 6px; background: #fff; color: #1A1A1A;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.vs-model-info {
    font-size: 10pt; color: #888; min-height: 16px;
}

/* Surfaces list */
.vs-surface {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #F0F0F2;
}
.vs-surface:last-child { border-bottom: none; }
.vs-surface-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11pt; font-weight: 700; color: #fff;
    flex: 0 0 auto;
}
.vs-surface-icon.whisper { background: #1A73E8; }
.vs-surface-icon.webspeech { background: #14A08C; }
.vs-surface-info { flex: 1; min-width: 0; }
.vs-surface-name { font-size: 11pt; font-weight: 600; color: #1A1A1A; }
.vs-surface-desc { font-size: 9.5pt; color: #888; margin-top: 1px; }
.vs-surface-engine {
    font-size: 9pt; font-weight: 600;
    padding: 3px 8px; border-radius: 4px;
    flex: 0 0 auto;
}
.vs-surface-engine.whisper {
    background: rgba(26,115,232,0.12); color: #1A73E8;
}
.vs-surface-engine.webspeech {
    background: rgba(20,160,140,0.12); color: #0E7A6B;
}

/* Test area record buttons */
.vs-test-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    font: 600 10.5pt -apple-system, "Segoe UI", system-ui, sans-serif;
    color: #fff; background: #1A73E8;
    border: none; border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    -webkit-appearance: none;
}
.vs-test-btn:hover { background: #2680F0; }
.vs-test-btn.recording {
    background: #C0392B;
    animation: vs-pulse 1.5s ease-in-out infinite;
}
@keyframes vs-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Defaults table */
.vs-defaults-table {
    width: 100%; border-collapse: collapse;
    font-size: 10.5pt;
}
.vs-defaults-table th {
    text-align: left; font-weight: 600; color: #555;
    padding: 6px 10px; border-bottom: 2px solid #E0E0E2;
    font-size: 9.5pt; text-transform: uppercase; letter-spacing: 0.3px;
}
.vs-defaults-table td {
    padding: 8px 10px; border-bottom: 1px solid #F0F0F2;
    color: #333;
}
.vs-defaults-table tr:last-child td { border-bottom: none; }

/* Previous texts picker */
.vs-prev-select {
    width: 100%; padding: 8px 10px;
    font-size: 11pt; border: 1px solid #D0D0D6;
    border-radius: 6px; background: #fff; color: #1A1A1A;
    margin-bottom: 8px;
    -webkit-appearance: none; appearance: none;
}

/* Shared textarea */
.vs-textarea {
    width: 100%; box-sizing: border-box;
    min-height: 100px;
    padding: 10px 12px;
    font: 12pt -apple-system, "Segoe UI", system-ui, sans-serif;
    line-height: 1.5;
    color: #1A1A1A;
    background: #F8F8FA;
    border: 1px solid #D0D0D6;
    border-radius: 6px;
    resize: vertical;
}
.vs-textarea:focus {
    border-color: #1A73E8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
    outline: none;
}

/* Per-model test block */
.vs-model-block {
    margin-bottom: 16px;
    border: 1px solid #E8E8EC;
    border-radius: 8px;
    padding: 12px 14px;
    background: #FAFAFA;
}
.vs-model-block-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.vs-model-block-label {
    font-size: 11pt; font-weight: 600; color: #333;
}
.vs-model-output {
    min-height: 80px;
}

/* Save button */
.vs-save-btn {
    display: inline-block;
    padding: 11px 24px;
    font: 600 11pt -apple-system, "Segoe UI", system-ui, sans-serif;
    color: #fff; background: #14A08C;
    border: none; border-radius: 8px;
    cursor: pointer;
    margin-top: 12px;
    -webkit-appearance: none;
}
.vs-save-btn:hover { background: #18B89E; }
.vs-save-btn:disabled { opacity: 0.5; cursor: default; }
.vs-save-hint {
    display: inline-block; margin-left: 10px;
    font-size: 10pt; color: #888;
}

/* Surface select dropdown */
.vs-surface-select {
    flex: 0 0 auto;
    padding: 5px 8px;
    font-size: 10pt;
    border: 1px solid #D0D0D6;
    border-radius: 5px;
    background: #fff; color: #1A1A1A;
    max-width: 160px;
    -webkit-appearance: none; appearance: none;
}

/* Reset */
.vs-reset-btn {
    padding: 10px 20px;
    font: 600 11pt -apple-system, "Segoe UI", system-ui, sans-serif;
    color: #C0392B; background: rgba(192,57,43,0.08);
    border: 1px solid rgba(192,57,43,0.25);
    border-radius: 8px;
    cursor: pointer;
    -webkit-appearance: none;
}
.vs-reset-btn:hover { background: rgba(192,57,43,0.15); }
.vs-reset-hint {
    display: inline-block; margin-left: 10px;
    font-size: 10pt; color: #999;
}

/* Voice output rows (Story 5600) */
.vs-output-row { flex-wrap: wrap; }
.vs-output-controls {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    flex: 1 1 100%; padding-left: 48px;
}
.vs-output-controls select { flex: 1 1 180px; min-width: 0; }
.vs-surface-icon.browser { background: #6B6B75; }
.vs-surface-icon.google  { background: #1E8E3E; }
.vs-play-btn {
    padding: 8px 14px;
    font: 600 10pt -apple-system, "Segoe UI", system-ui, sans-serif;
    color: #1A73E8; background: #fff;
    border: 1px solid #1A73E8; border-radius: 6px;
    cursor: pointer; flex: 0 0 auto;
}
.vs-play-btn:disabled, .vs-save-btn:disabled { opacity: 0.5; cursor: default; }

/* Google voice card: the month's meter and the cap */
.vs-meter {
    height: 10px; border-radius: 5px; background: #EDEDF0; overflow: hidden;
}
.vs-meter-fill { height: 100%; width: 0; background: #1E8E3E; transition: width 0.3s; }
.vs-meter-fill.vs-meter-warn { background: #E37400; }
.vs-meter-text { margin: 6px 0 14px; font-size: 10pt; color: #555; }
.vs-cap-row { display: flex; gap: 8px; align-items: center; }
.vs-cap-input {
    flex: 1; min-width: 0; padding: 10px 12px;
    font-size: 12pt; border: 1px solid #D0D0D6; border-radius: 6px;
}

/* Male / Female filter for the voice lists */
.vs-filter { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 0 0 6px; font-size: 10.5pt; color: #333; }
.vs-filter-label { font-weight: 600; color: #555; }
.vs-filter label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
