/* ============================================================
   Posthum.ai — dashboard.css : Dashboard stats + galerie photos
   ============================================================ */

/* ── Stats grid ───────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: border-color 0.2s ease;
}

.stat-card:hover {
    border-color: rgba(201, 169, 110, 0.3);
}

.stat-card--disabled {
    opacity: 0.5;
    pointer-events: none;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon--photos {
    background: rgba(99, 179, 237, 0.1);
    color: #63b3ed;
}

.stat-icon--storage {
    background: rgba(201, 169, 110, 0.1);
    color: var(--gold);
}

.stat-icon--access {
    background: rgba(72, 187, 120, 0.1);
    color: #48bb78;
}

.stat-icon--date {
    background: rgba(160, 174, 192, 0.1);
    color: #a0aec0;
}

.stat-icon--texts {
    background: rgba(246, 173, 85, 0.1);
    color: #f6ad55;
}

.stat-icon--vocal {
    background: rgba(197, 137, 232, 0.1);
    color: #c589e8;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-value--sm {
    font-size: 1rem;
    font-weight: 500;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Storage bar */
.storage-bar,
.storage-bar-wrap {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin: 0.5rem 0 0.25rem;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
    transition: width 0.6s ease;
    width: 0%;
}

.storage-limit {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Info cards ───────────────────────────────────────────────────────────── */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.info-card h3 {
    font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.info-card--cta {
    border-color: rgba(201, 169, 110, 0.2);
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.05), transparent);
}

.info-card--cta p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-key {
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
}

.info-value--gold {
    color: var(--gold);
    font-weight: 500;
}

.badge-soon {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 0.25rem;
    color: var(--text-muted);
}

/* ── Welcome banner ───────────────────────────────────────────────────────── */
.welcome-banner {
    margin-bottom: 2rem;
}

.welcome-banner h1 {
    font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.welcome-banner h1 span {
    color: var(--gold);
}

.welcome-banner p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════════════════════════
   GALERIE PHOTOS
   ══════════════════════════════════════════════════════════════════════════ */

/* Zone drag & drop */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.2s;
    margin-bottom: 1.5rem;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: rgba(201, 169, 110, 0.5);
    background: rgba(201, 169, 110, 0.04);
}

.upload-dropzone-icon {
    color: var(--gold);
    margin-bottom: 0.75rem;
}

.upload-dropzone p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.upload-dropzone small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.upload-dropzone label {
    cursor: pointer;
    color: var(--gold);
    text-decoration: underline;
}

#file-input {
    display: none;
}

/* Erreurs upload */
.upload-errors {
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #fca5a5;
    margin-bottom: 1rem;
    white-space: pre-line;
}

/* Queue */
.upload-queue {
    margin-bottom: 1.5rem;
}

.upload-queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.upload-queue-header h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.upload-queue-actions {
    display: flex;
    gap: 0.5rem;
}

.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
}

.queue-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.queue-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.queue-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 0.65rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.queue-remove:hover {
    background: rgba(239, 68, 68, 0.8);
}

.queue-meta {
    padding: 0.35rem 0.5rem 0.1rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.queue-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-size {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.queue-status {
    padding: 0.2rem 0.5rem 0.35rem;
    font-size: 0.65rem;
    text-align: center;
}

.status--pending {
    color: var(--text-muted);
}

.status--uploading {
    color: var(--gold);
}

.status--done {
    color: var(--success);
}

.status--error {
    color: var(--danger);
}

/* Barre de progression */
.upload-progress {
    margin-bottom: 1.25rem;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ── Galerie ── */
.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.gallery-header h2 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gallery-count-badge {
    background: rgba(201, 169, 110, 0.1);
    color: var(--gold);
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.gallery-loading {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 1rem 0;
}

.gallery-item {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.gallery-item:hover {
    border-color: rgba(201, 169, 110, 0.3);
}

.gallery-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-thumb img {
    transform: scale(1.03);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-delete {
    background: rgba(239, 68, 68, 0.8);
    border: none;
    color: white;
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.gallery-delete:hover {
    background: var(--danger);
}

.gallery-caption {
    padding: 0.3rem 0.5rem 0.1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-size {
    display: block;
    padding: 0 0.5rem 0.35rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.gallery-empty {
    display: none;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.gallery-empty svg {
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.text-danger {
    color: var(--danger);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   ABONNEMENT
   ══════════════════════════════════════════════════════════════════════════ */
.plan-current-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.plan-current-header h2 {
    font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
    font-weight: 400;
    font-size: 1.35rem;
    color: var(--text-primary);
    margin: 0.35rem 0 0.15rem;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.plan-badge--free {
    background: rgba(201, 169, 110, 0.1);
    border: 1px solid rgba(201, 169, 110, 0.3);
    color: var(--gold);
}

.plan-badge--premium {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #60a5fa;
}

.plan-renewal {
    font-size: 0.8rem;
    white-space: nowrap;
}

.plan-usage {
    margin-top: 1.25rem;
}

.plan-usage-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.plan-usage-value {
    font-size: 0.8rem;
}

/* ── Comparaison des plans (cartes) ──────────────────────────────────────── */
.plan-comparison {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.plan-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.plan-card--current {
    border-color: rgba(201, 169, 110, 0.35);
}

.plan-card--premium {
    border-color: rgba(96, 165, 250, 0.25);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.05), transparent);
}

.plan-card-header h3 {
    font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
    font-weight: 400;
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 0;
}

.plan-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 20px;
    padding: 0.15rem 0.5rem;
}

.plan-price {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 500;
    margin: 0.35rem 0 0.75rem;
}

.plan-period {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.plan-features li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.3rem 0;
}

@media (max-width: 640px) {
    .plan-comparison {
        grid-template-columns: 1fr;
    }
}

.billing-notice {
    background: rgba(201, 169, 110, 0.06);
    border: 1px solid rgba(201, 169, 110, 0.15);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* ── Barre de progression par item ───────────────────────────────────────── */
.item-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin-top: 0.375rem;
    overflow: hidden;
    position: relative;
}

.item-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
    transition: width 0.15s ease;
}

.item-progress-label {
    position: absolute;
    right: 0;
    top: -14px;
    font-size: 0.6rem;
    color: var(--gold);
}

/* ── Validation loader ────────────────────────────────────────────────────── */
.validation-loader {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.loader-ring--sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* ── Note cold start ──────────────────────────────────────────────────────── */
.upload-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* ── Vocal recorder page ─────────────────────────────────────────────────── */
.vocal-page .page-header {
    margin-bottom: 1.5rem;
}

.vocal-page .page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.recorder-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.recorder-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.3s;
}

.status-dot--recording {
    background: #e53e3e;
    animation: pulse-dot 1s infinite;
}

.status-dot--paused {
    background: var(--gold);
}

.status-dot--idle {
    background: var(--border);
}

.status-dot--warning {
    background: #dd6b20;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

.waveform-container {
    width: 100%;
    max-width: 600px;
    height: 60px;
    background: var(--bg-input);
    border-radius: 8px;
    overflow: hidden;
}

.waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.recording-timer {
    font-size: 2.5rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    font-family: ui-monospace, monospace;
}

.recording-title-wrap {
    width: 100%;
    max-width: 420px;
}

.mic-select-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
}

.device-selectors {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 420px;
}

.mic-select-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.mic-select {
    flex: 1;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
}

.btn-save-device {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
}

.btn-save-device:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-save-device--saved {
    color: var(--gold);
    border-color: var(--gold);
}

/* ── Test du matériel audio (window.AudioTest) ─────────────────────────────── */
.audio-test-mount {
    margin-top: 0.6rem;
}

.vocal-audio-tests,
.training-audio-tests {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.25rem;
    margin: 0.75rem 0 0.25rem;
}

.audio-test {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.audio-test-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.audio-test-btn--active {
    color: var(--gold);
    border-color: var(--gold);
}

.audio-test-meter {
    flex: 1;
    min-width: 90px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.audio-test-meter-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #83b58c, var(--gold, #c9a96e));
    transition: width 0.05s linear;
}

.audio-test-status {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
    flex-basis: 100%;
}

.audio-test-status--ok {
    color: #83b58c;
}

.audio-test-status--warn {
    color: #d3b894;
}

.audio-test-status--error {
    color: #d68b8b;
}

.audio-test-playback {
    flex-basis: 100%;
    width: 100%;
    max-width: 320px;
    height: 34px;
    margin-top: 0.15rem;
}

.recorder-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.btn-record {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #e53e3e;
    background: transparent;
    color: #e53e3e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.2s,
        color 0.2s;
}

.btn-record:hover:not(:disabled) {
    background: #e53e3e;
    color: #fff;
}

.btn-record:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-pause,
.btn-stop {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.2s,
        color 0.2s;
}

.btn-pause:hover:not(:disabled),
.btn-stop:hover:not(:disabled) {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-pause:disabled,
.btn-stop:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.upload-progress-wrap {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.upload-progress-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.upload-progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 99px;
    transition: width 0.2s;
}

.upload-progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.vocal-alert {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
}

.vocal-alert--info {
    background: rgba(66, 153, 225, 0.12);
    color: #4299e1;
}

.vocal-alert--success {
    background: rgba(72, 187, 120, 0.12);
    color: #48bb78;
}

.vocal-alert--error {
    background: rgba(229, 62, 62, 0.12);
    color: #e53e3e;
}

.vocal-alert--warning {
    background: rgba(221, 107, 32, 0.12);
    color: #dd6b20;
}

/* Recordings list */
.recordings-section {
    margin-top: 0.5rem;
}

.recordings-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text-primary);
}

.recordings-loading,
.recordings-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.recording-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s;
}

.recording-item:hover {
    border-color: var(--gold);
}

.recording-item-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.recording-item-info {
    flex: 1;
    min-width: 0;
}

.recording-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-item-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.recording-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-danger-ghost {
    color: #e53e3e !important;
}

.btn-danger-ghost:hover {
    background: rgba(229, 62, 62, 0.1) !important;
}

/* stat card disabled state */
.stat-card--disabled {
    opacity: 0.45;
}

/* ── Role badge (dropdown) ───────────────────────────────────────────────── */
.role-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 99px;
    margin-top: 3px;
    letter-spacing: 0.03em;
}

.role-badge--depositor {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.role-badge--heir {
    background: rgba(99, 179, 237, 0.12);
    color: #63b3ed;
    border: 1px solid rgba(99, 179, 237, 0.25);
}

/* ── Héritier pending card ───────────────────────────────────────────────── */
.heritier-pending-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 560px;
    margin: 2rem auto;
}

.heritier-pending-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.heritier-pending-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.heritier-pending-steps {
    text-align: left;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.pending-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pending-step-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ── Text memories ──────────────────────────────────────────────────────────── */

.texte-page {
    max-width: 760px;
}

.composer-card {
    margin-bottom: 2rem;
}

.mood-picker {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.mood-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 0.3rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.mood-btn {
    background: none;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 3px 5px;
    line-height: 1;
    transition:
        border-color 0.12s,
        background 0.12s,
        transform 0.12s;
}

.mood-btn:hover {
    border-color: var(--border);
    background: var(--bg-hover);
    transform: scale(1.15);
}

.mood-btn.active {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.12);
    transform: scale(1.2);
}

.composer-title {
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.memory-textarea {
    width: 100%;
    resize: vertical;
    min-height: 160px;
    line-height: 1.7;
    font-size: 0.875rem;
    font-family: inherit;
    margin-bottom: 0.6rem;
}

.composer-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.composer-footer-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.composer-footer-right {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.char-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.char-count.warning {
    color: #e6a817;
}

.char-count.danger {
    color: #e53e3e;
}

.tags-input {
    border: 1px dashed var(--border);
    background: transparent;
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    color: var(--text-primary);
    flex: 1;
    min-width: 120px;
    transition: border-color 0.15s;
}

.tags-input:focus {
    outline: none;
    border-color: var(--gold);
    border-style: solid;
}

.tags-input::placeholder {
    color: var(--text-muted);
}

/* Champ date du composer */
.composer-date-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.composer-date-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.composer-date-input {
    font-size: 0.8rem;
    padding: 0.28rem 0.65rem;
    width: auto;
    color-scheme: dark;
}

/* Tags autocomplete dropdown */
.tags-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 120px;
}

.tags-input-wrapper .tags-input {
    width: 100%;
}

.tags-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    z-index: 200;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.tags-dropdown.hidden {
    display: none;
}

.tags-dropdown-item {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.1s;
}

.tags-dropdown-item:hover {
    background: rgba(201, 169, 110, 0.1);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition:
        background 0.12s,
        color 0.12s;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.memories-list-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.memories-list-header h2 {
    font-size: 1rem;
    margin: 0;
}

.memory-count {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    vertical-align: middle;
}

.text-memory-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.text-memory-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    transition: border-color 0.15s;
}

.text-memory-item:hover {
    border-color: var(--gold);
}

.text-memory-header {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.text-memory-mood {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1.25;
}

.text-memory-meta {
    flex: 1;
    min-width: 0;
}

.text-memory-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-memory-date {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.text-memory-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.btn-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    transition:
        background 0.12s,
        border-color 0.12s,
        color 0.12s;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--bg-hover);
    border-color: var(--gold);
    color: var(--text-primary);
}

.text-memory-body {
    font-size: 0.82rem;
    color: var(--text-secondary, var(--text-muted));
    line-height: 1.7;
    margin: 0 0 0.4rem 0;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.text-memory-body.expanded {
    max-height: none;
}

.text-memory-body-toggle {
    font-size: 0.72rem;
    color: var(--gold);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0 0 0.4rem 0;
    display: block;
}

.text-memory-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
}

.tag {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.65rem;
    padding: 1px 8px;
    color: var(--text-muted);
}

/* ============================================================
   Pages IA — Simulation vocale + Tchat mémoire
   ============================================================ */

/* ── Layout IA ──────────────────────────────────────────────────────────────── */
.ia-page {
    max-width: 780px;
}

.tchat-page {
    max-width: 820px;
}

.page-header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

/* Badge démo */
.ia-demo-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    background: rgba(99, 179, 237, 0.12);
    color: #63b3ed;
    border-radius: 20px;
    border: 1px solid rgba(99, 179, 237, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 0.4rem;
}

/* Notice */
.ia-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.ia-notice p {
    margin: 0;
    line-height: 1.5;
}

/* Card générique */
.ia-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ia-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

/* Radio row */
.radio-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.radio-option input {
    accent-color: var(--gold);
}

/* Preview souvenir */
.memory-preview-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-top: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
}

.memory-preview-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    font-style: italic;
}

.char-counter {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 0.25rem;
}

/* Result card */
.ia-result-card {
    border-color: rgba(201, 169, 110, 0.2);
}

.vocal-result-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1rem;
}

.vocal-result-icon {
    width: 44px;
    height: 44px;
    background: rgba(201, 169, 110, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    flex-shrink: 0;
}

.vocal-result-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.vocal-result-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.vocal-player {
    width: 100%;
    height: 40px;
    margin-bottom: 0.875rem;
    border-radius: 6px;
}

.vocal-result-actions {
    display: flex;
    gap: 0.5rem;
}

/* Generating state */
.ia-generating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.generating-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: ia-spin 0.8s linear infinite;
}

@keyframes ia-spin {
    to {
        transform: rotate(360deg);
    }
}

.generating-label {
    color: var(--text-secondary);
}

/* Erreur */
.ia-error {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ── Tchat ──────────────────────────────────────────────────────────────────── */
.tchat-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 520px;
}

.tchat-window {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.tchat-message {
    display: flex;
    gap: 0.625rem;
    align-items: flex-end;
    max-width: 80%;
}

.tchat-message--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.tchat-message--ia {
    align-self: flex-start;
}

.avatar-ia {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light, #e0c87a));
    color: var(--bg-dark);
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-user {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.6875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tchat-bubble {
    padding: 0.625rem 0.875rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.55;
}

.tchat-bubble p {
    margin: 0;
}

.tchat-bubble--ia {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.tchat-bubble--user {
    background: rgba(201, 169, 110, 0.12);
    border: 1px solid rgba(201, 169, 110, 0.2);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.tchat-bubble--error {
    color: #f87171;
    font-style: italic;
}

/* Typing indicator */
.tchat-typing .tchat-bubble--ia {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0.75rem 1rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.tchat-welcome {
    display: flex;
    gap: 0.625rem;
    align-items: flex-end;
}

/* Zone de saisie */
.tchat-input-area {
    border-top: 1px solid var(--border);
    padding: 0.875rem 1rem 0.625rem;
    background: var(--bg-card);
    flex-shrink: 0;
}

.tchat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.tchat-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    transition: border-color 0.15s;
    line-height: 1.4;
}

.tchat-input:focus {
    outline: none;
    border-color: rgba(201, 169, 110, 0.4);
}

.btn-send {
    width: 38px;
    height: 38px;
    background: var(--gold);
    border: none;
    border-radius: 8px;
    color: var(--bg-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.15s ease,
        opacity 0.15s;
    flex-shrink: 0;
}

.btn-send:hover {
    background: var(--gold-light, #e0c87a);
}

.btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tchat-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.375rem;
}

.tchat-char-count {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-xs {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* ============================================================
   Conversation vocale — Interface immersive avec visualiseurs
   ============================================================ */

.vocal-live {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.vocal-live-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.vocal-live-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 0;
}

.vocal-viz {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    max-width: 320px;
}

.vocal-canvas {
    width: 100%;
    height: 160px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.vocal-viz--user .vocal-canvas {
    border-color: rgba(201, 169, 110, 0.15);
}

.vocal-viz--ia .vocal-canvas {
    border-color: rgba(100, 180, 230, 0.15);
}

.vocal-viz-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.vocal-viz--user .vocal-viz-label {
    color: var(--gold);
}

.vocal-viz--ia .vocal-viz-label {
    color: #64b4e6;
}

.vocal-live-controls {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-vocal-pause {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: transparent;
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-vocal-pause:hover {
    background: rgba(201, 169, 110, 0.15);
    transform: scale(1.08);
}

.btn-vocal-pause.is-paused {
    border-color: #64b4e6;
    color: #64b4e6;
}

.btn-vocal-pause.is-paused:hover {
    background: rgba(100, 180, 230, 0.15);
}

.vocal-live-status {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 1.4em;
    margin-top: 1rem;
    animation: vocal-status-pulse 2s ease-in-out infinite;
}

.vocal-live-status:empty {
    animation: none;
}

/* Divulgation permanente « voix synthétique » pendant la conversation vocale
   (obligation Microsoft). Discrète mais toujours lisible. */
.vocal-voice-disclosure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.75rem auto 0;
    padding: 0.4rem 0.85rem;
    max-width: max-content;
    border: 1px solid rgba(201, 169, 110, 0.35);
    border-radius: 999px;
    background: rgba(201, 169, 110, 0.08);
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: center;
}

/* Piège connu : `display: flex` (spécificité 0,1,0) l'emporte sur la règle UA
   `[hidden] { display: none }` (0,0,1) → sans ce sélecteur, la divulgation
   resterait visible même quand la voix clonée n'est pas sélectionnée. */
.vocal-voice-disclosure[hidden] {
    display: none;
}

.vocal-voice-disclosure-icon {
    flex-shrink: 0;
}

@keyframes vocal-status-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@media (max-width: 600px) {
    .vocal-live-stage {
        flex-direction: column;
        gap: 1.5rem;
    }

    .vocal-viz {
        max-width: 100%;
    }

    .vocal-canvas {
        height: 120px;
    }

    .vocal-live {
        padding: 1rem;
    }
}

/* ================================================================
   Voice Quality Score Card
   ================================================================ */
.voice-quality-card {
    background: var(--card-bg, #1e1e2e);
    border: 1px solid var(--border-color, #2e2e3e);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

/* Setup row — config left, quality right */
.vocal-setup-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.vocal-setup-config {
    flex: 1;
    min-width: 0;
}

.vocal-setup-quality {
    flex: 0 0 380px;
    min-width: 0;
}

.quality-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quality-header-left {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.quality-icon {
    color: #c9a96e;
    flex-shrink: 0;
    margin-top: 2px;
}

.quality-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color, #e0e0e0);
}

.quality-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    margin-top: 2px;
}

.quality-score-badge {
    display: flex;
    align-items: baseline;
    gap: 2px;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.quality-score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color, #e0e0e0);
}

.quality-score-max {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
}

.quality-score-badge.level-insuffisant .quality-score-value {
    color: #f87171;
}

.quality-score-badge.level-correct .quality-score-value {
    color: #facc15;
}

.quality-score-badge.level-bon .quality-score-value {
    color: #34d399;
}

.quality-score-badge.level-excellent .quality-score-value {
    color: #60a5fa;
}

/* Gauge */
.quality-gauge-wrap {
    margin-bottom: 1rem;
}

.quality-gauge-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.quality-gauge-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease, background-color 0.4s ease;
    background-color: #888;
}

.quality-gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted, #888);
    margin-top: 4px;
    padding: 0 2px;
}

/* Sub-scores */
.subscore-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.subscore-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
}

.subscore-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
}

.subscore-icon {
    font-size: 0.9rem;
}

.subscore-label {
    color: var(--text-color, #e0e0e0);
    flex: 1;
}

.subscore-value {
    color: var(--text-muted, #888);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.subscore-bar-wrap {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.subscore-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Pending message */
.quality-pending-msg {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.15);
    border-radius: 8px;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted, #888);
}

.quality-pending-msg svg {
    color: #facc15;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Loading spinner */
.quality-loading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    padding: 0.5rem 0;
}

.quality-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #c9a96e;
    border-radius: 50%;
    animation: quality-spin 0.8s linear infinite;
}

@keyframes quality-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Computed-at footer */
.quality-computed-at {
    font-size: 0.72rem;
    color: var(--text-muted, #888);
    text-align: right;
    margin-top: 0.6rem;
    opacity: 0.7;
}

/* Quality actions (recalculate) */
.quality-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Improve section */
.quality-improve-section {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(248, 113, 113, 0.15);
    border-radius: 8px;
}

.quality-improve-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    line-height: 1.5;
}

.quality-improve-header svg {
    color: #f87171;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 600px) {
    .subscore-grid {
        grid-template-columns: 1fr;
    }

    .quality-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .vocal-setup-row {
        flex-direction: column;
    }

    .vocal-setup-quality {
        flex: 1;
    }
}

/* ============================================================
   Posthum.ai — Voice training v2 (Lot A) — modules d'apprentissage
   ============================================================ */

.voice-training-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.training-score-card {
    background: var(--bg-card, #141414);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 14px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.training-score-overview {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.training-score-ring {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.training-score-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gold, #c9a96e);
}

.training-score-num {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    line-height: 1;
}

.training-score-max {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
}

.training-score-meta h2.training-score-level {
    margin: 0 0 0.4rem;
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--text-primary, #e8e4de);
    text-transform: capitalize;
}

.training-score-tagline {
    color: var(--text-muted, #999);
    font-size: 0.9rem;
    margin: 0 0 0.8rem;
    max-width: 480px;
    line-height: 1.45;
}

.training-score-gaps {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted, #888);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.training-gap-pill {
    display: inline-block;
    background: rgba(201, 169, 110, 0.12);
    color: var(--gold, #c9a96e);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    margin-left: 0.3rem;
}

.training-recalc-btn {
    margin-top: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #e8e4de);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.training-recalc-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(201, 169, 110, 0.4);
}

.training-recalc-btn:focus-visible {
    outline: 2px solid var(--gold, #c9a96e);
    outline-offset: 2px;
}

.training-recalc-btn:disabled {
    opacity: 0.7;
    cursor: progress;
}

.training-back-bottom {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
}

.training-recalc-btn--loading svg {
    display: none;
}

.spinner.spinner--inline {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(201, 169, 110, 0.25);
    border-top-color: var(--gold, #c9a96e);
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

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

.training-subscores {
    display: grid;
    gap: 0.6rem;
}

.training-subscore-row {
    display: grid;
    grid-template-columns: 200px 1fr 60px auto;
    align-items: center;
    gap: 1rem;
}

.training-subscore-action {
    min-width: 0;
}

.training-subscore-cta {
    background: rgba(201, 169, 110, 0.08);
    color: var(--gold, #c9a96e);
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.training-subscore-cta:hover {
    background: rgba(201, 169, 110, 0.18);
    border-color: rgba(201, 169, 110, 0.55);
}

.training-subscore-cta:focus-visible {
    outline: 2px solid var(--gold, #c9a96e);
    outline-offset: 2px;
}

.training-subscore-label strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text-primary, #e8e4de);
}

.training-subscore-desc {
    display: block;
    font-size: 0.74rem;
    color: var(--text-muted, #888);
    margin-top: 0.1rem;
}

.training-subscore-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.training-subscore-fill {
    height: 100%;
    background: var(--gold, #c9a96e);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.training-subscore-row--gap .training-subscore-fill {
    background: linear-gradient(90deg, #d3786e, #d3a86e);
}

.training-subscore-value {
    text-align: right;
    color: var(--text-primary, #e8e4de);
    font-size: 0.95rem;
}

.training-subscore-value small {
    color: var(--text-muted, #888);
    font-size: 0.7rem;
    margin-left: 0.15rem;
}

.training-locked-banner {
    background: rgba(131, 181, 140, 0.08);
    border: 1px solid rgba(131, 181, 140, 0.25);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    color: #a8d2af;
}

/* Le `display: flex` ci-dessus l'emporte sur la règle UA `[hidden] { display: none }`
   (spécificité 0,1,0 > 0,0,1). Sans cette règle, l'attribut `hidden` posé par
   toggleLockedBanner() était ignoré et le bandeau « Profil vocal complet » restait
   affiché même à 43/100. On rétablit le masquage attendu.

   Même pattern sur la page Conversation vocale (ia-vocal.js togglé via `.hidden`) :
   `.quality-pending-msg` et `.quality-actions` déclarent aussi `display: flex`
   → sans le sélecteur `[hidden]`, « En attente de calcul » et la barre d'actions
   restaient visibles une fois le vrai score chargé. */
.training-locked-banner[hidden],
.quality-pending-msg[hidden],
.quality-actions[hidden] {
    display: none;
}

.training-locked-banner strong {
    display: block;
    margin-bottom: 0.2rem;
}

.training-locked-banner p {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(232, 228, 222, 0.75);
}

.training-section-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-primary, #e8e4de);
    margin: 0 0 1rem;
    letter-spacing: 0.02em;
}

/* ── I-08 : bandeau « passages en attente d'évaluation » ─────────────────────
   Discret, placé sous la vue d'ensemble du score. Masqué (attribut hidden) s'il
   ne reste aucun passage en attente. */
.training-pending-reassess {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem 0.85rem;
    margin: 0 0 1.5rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid rgba(201, 169, 110, 0.28);
    border-radius: 8px;
    background: rgba(201, 169, 110, 0.06);
    font-size: 0.82rem;
}

/* Piège connu [hidden] : `display:flex` (0,1,0) l'emporte sur la règle UA
   `[hidden]{display:none}` (0,0,1) → sans ce sélecteur le bandeau resterait
   affiché même vidé. */
.training-pending-reassess[hidden] {
    display: none;
}

.training-pending-reassess-text {
    color: rgba(232, 228, 222, 0.85);
}

.training-reassess-status {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.training-reassess-btn--loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ── Parcours « Créer mon profil vocal cloné » (Azure Personal Voice) ─────────
   Carte cohérente avec le design system training. Toute la section est masquée
   (attribut hidden) tant que le clonage n'est pas activé côté serveur. */
.training-personal-voice {
    background: linear-gradient(180deg, rgba(201, 169, 110, 0.05), transparent 60%);
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.pv-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.pv-header .training-section-title {
    margin-bottom: 0.5rem;
}

.pv-intro {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 60ch;
}

.pv-status-badge {
    flex-shrink: 0;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    white-space: nowrap;
}

.pv-status-badge--ready {
    background: rgba(131, 181, 140, 0.15);
    color: #83b58c;
}

.pv-status-badge--progress {
    background: rgba(201, 169, 110, 0.15);
    color: #c9a96e;
}

.pv-status-badge--failed {
    background: rgba(214, 139, 139, 0.15);
    color: #d68b8b;
}

.pv-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0;
    padding: 0.6rem 0.9rem;
    border: 1px solid rgba(214, 139, 139, 0.4);
    border-radius: 8px;
    background: rgba(214, 139, 139, 0.08);
    color: #d68b8b;
    font-size: 0.8rem;
}

.pv-step {
    margin-top: 1.25rem;
}

.pv-step-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.pv-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(201, 169, 110, 0.15);
    color: #c9a96e;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.pv-step-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary, #e8e4de);
}

.pv-step-desc {
    margin: 0 0 1rem;
    font-size: 0.83rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.pv-consent-text,
.pv-sentence-text {
    margin: 0;
    padding: 0.85rem 1rem;
    border-left: 3px solid rgba(201, 169, 110, 0.5);
    border-radius: 0 8px 8px 0;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary, #e8e4de);
    font-size: 0.92rem;
    line-height: 1.55;
    font-style: italic;
}

.pv-sentence-card {
    margin-bottom: 1rem;
}

.pv-sentence-index {
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pv-record-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.pv-rec-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.pv-rec-btn--recording {
    border-color: #d68b8b;
    color: #d68b8b;
}

.pv-rec-status {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.pv-waveform {
    display: block;
    margin-top: 0.75rem;
}

.pv-waveform canvas {
    width: 100%;
    max-width: 100%;
    height: 56px;
}

.pv-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1.1rem 0;
}

.pv-dot {
    width: 0.7rem;
    height: 0.7rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.pv-dot:hover {
    transform: scale(1.2);
}

.pv-dot--current {
    border-color: #c9a96e;
    box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.25);
}

.pv-dot--done {
    background: #83b58c;
    border-color: #83b58c;
}

.pv-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.pv-submit-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pv-step--status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

.pv-step--status .pv-step-desc {
    max-width: 46ch;
}

.pv-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.pv-status-icon--ready {
    background: rgba(131, 181, 140, 0.15);
    color: #83b58c;
}

.pv-status-icon--progress {
    background: rgba(201, 169, 110, 0.12);
    color: #c9a96e;
}

.pv-loading {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
}

/* Piège connu [hidden] : les éléments ci-dessous portent un `display:*` explicite
   (spécificité de classe > règle UA `[hidden]{display:none}`) et sont togglés via
   l'attribut hidden → sans ces sélecteurs ils resteraient visibles. */
.training-personal-voice[hidden],
.pv-error[hidden],
.pv-waveform[hidden],
.pv-status-badge[hidden] {
    display: none;
}

.training-modules-grid {
    display: block;
}

.training-modules-section-header {
    margin-top: 0;
    margin-bottom: 0.85rem;
}

.training-modules-section-header:not(:first-child),
.training-modules-section-header--secondary {
    margin-top: 2.2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.training-modules-section-header h3 {
    margin: 0 0 0.2rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary, #e8e4de);
    letter-spacing: 0.01em;
}

.training-modules-section-header p {
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
}

.training-modules-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.training-modules-grid-inner--secondary .training-module-card {
    opacity: 0.85;
}

.training-modules-grid-inner--secondary .training-module-card:hover {
    opacity: 1;
}

.training-module-card {
    background: var(--bg-card, #141414);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.2s, transform 0.2s;
}

.training-module-card:hover {
    border-color: var(--gold, #c9a96e);
    transform: translateY(-1px);
}

.training-module-card--suggested {
    border-color: rgba(201, 169, 110, 0.5);
    background: linear-gradient(180deg, rgba(201, 169, 110, 0.04), transparent 60%);
}

/* Module terminé (tous les passages enregistrés) — liseré vert sobre du design
   system, prime visuellement sur l'état « suggéré ». */
.training-module-card--done {
    border-color: rgba(131, 181, 140, 0.45);
    background: linear-gradient(180deg, rgba(131, 181, 140, 0.05), transparent 60%);
}

/* Légende expliquant le liseré doré « Suggéré » (répond à la confusion sur la
   couleur différente d'un module ciblant un axe faible). */
.training-modules-legend {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted, #888);
}

.training-legend-swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(201, 169, 110, 0.5);
    background: linear-gradient(180deg, rgba(201, 169, 110, 0.28), rgba(201, 169, 110, 0.06));
}

.training-module-card--locked {
    opacity: 0.45;
    filter: grayscale(0.5);
    cursor: not-allowed;
    pointer-events: auto;
}

.training-module-card--locked:hover {
    border-color: var(--border, #2a2a2a);
    transform: none;
}

.training-module-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.training-module-card-title {
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text-primary, #e8e4de);
    margin: 0;
    line-height: 1.3;
}

.training-module-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    flex-shrink: 0;
}

.training-tag {
    font-size: 0.68rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.training-tag--suggested {
    background: rgba(201, 169, 110, 0.18);
    color: var(--gold, #c9a96e);
}

.training-tag--done {
    background: rgba(131, 181, 140, 0.18);
    color: #83b58c;
}

.training-tag--locked {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted, #888);
}

/* Module dont la fonctionnalité requise (ex. realtime) n'est pas activée sur
   CET environnement. Pilotable par config (VOICE_REALTIME_ENABLED) — pas un
   verrou PROD-only en dur. */
.training-tag--unavailable {
    background: rgba(120, 140, 200, 0.18);
    color: #97a8d6;
}

.training-module-card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    margin: 0;
    line-height: 1.45;
}

.training-module-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    font-size: 0.78rem;
    color: var(--text-muted, #999);
}

.training-module-card-meta strong {
    color: var(--text-primary, #e8e4de);
    font-weight: 400;
}

.training-module-card-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

.training-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.training-progress-fill {
    height: 100%;
    background: var(--gold, #c9a96e);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.training-progress-text {
    font-size: 0.74rem;
    color: var(--text-muted, #888);
    min-width: 40px;
    text-align: right;
}

.training-module-card-btn {
    align-self: flex-start;
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

/* ── Vue détail d'un module ──────────────────────────────────── */

.training-module-detail {
    padding: 0.5rem 0;
}

.training-back-btn {
    margin-bottom: 1rem;
}

.training-module-detail-header h2 {
    font-size: 1.35rem;
    font-weight: 300;
    margin: 0 0 0.3rem;
    color: var(--text-primary, #e8e4de);
}

.training-passages-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    display: grid;
    gap: 1rem;
}

.training-passage-item {
    background: var(--bg-card, #141414);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}

.training-passage-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.training-passage-number {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    font-weight: 500;
}

.training-passage-tone {
    font-size: 0.72rem;
    color: var(--gold, #c9a96e);
    background: rgba(201, 169, 110, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    text-transform: lowercase;
}

.training-passage-title {
    color: var(--text-primary, #e8e4de);
    font-size: 0.95rem;
    font-weight: 400;
}

.training-passage-text {
    color: var(--text-primary, #d8d4ce);
    line-height: 1.6;
    font-size: 0.93rem;
    margin-bottom: 0.85rem;
    white-space: pre-line;
}

.training-passage-controls {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.training-passage-rec-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.training-passage-rec-btn--recording {
    background: rgba(220, 100, 100, 0.18);
    color: #e89999;
    border-color: rgba(220, 100, 100, 0.35);
}

.training-passage-status {
    font-size: 0.82rem;
    color: var(--text-muted, #999);
}

/* ── Récap module : compteurs OK / à améliorer / à refaire ───── */

.training-module-summary {
    margin: 0.4rem 0 1rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 169, 110, 0.18);
    border-radius: 8px;
}

.training-module-summary-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.training-summary-pill {
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted, #999);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.training-summary-pill--good { color: #83b58c; border-color: rgba(131, 181, 140, 0.35); }
.training-summary-pill--medium { color: #c9a96e; border-color: rgba(201, 169, 110, 0.35); }
.training-summary-pill--weak { color: #d68b8b; border-color: rgba(214, 139, 139, 0.35); }
.training-summary-pill--pending { color: #97a8d6; border-color: rgba(151, 168, 214, 0.35); }
.training-summary-pill--todo { opacity: 0.75; }

.training-module-summary-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted, #999);
}

/* ── Verdict par passage (bannière colorée) ──────────────────── */

.training-verdict {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    margin-bottom: 0.7rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
}

.training-verdict-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.training-verdict-body { flex: 1; }
.training-verdict-body p { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--text-muted, #999); }
.training-verdict-score { opacity: 0.85; }
.training-verdict-ts { font-size: 0.75rem; color: var(--text-muted, #999); white-space: nowrap; }

.training-verdict--good {
    border-color: rgba(131, 181, 140, 0.4);
    background: rgba(131, 181, 140, 0.08);
}
.training-verdict--good .training-verdict-icon { color: #83b58c; }

.training-verdict--medium {
    border-color: rgba(201, 169, 110, 0.4);
    background: rgba(201, 169, 110, 0.08);
}
.training-verdict--medium .training-verdict-icon { color: #c9a96e; }

.training-verdict--weak {
    border-color: rgba(214, 139, 139, 0.4);
    background: rgba(214, 139, 139, 0.08);
}
.training-verdict--weak .training-verdict-icon { color: #d68b8b; }

/* Enregistré mais évaluation en attente (ex. Speech F0 429) — état neutre
   bleu-gris, PAS une erreur : le passage compte pour la progression. */
.training-verdict--pending {
    border-color: rgba(151, 168, 214, 0.4);
    background: rgba(151, 168, 214, 0.08);
}
.training-verdict--pending .training-verdict-icon { color: #97a8d6; }

/* ── Waveform live pendant enregistrement ────────────────────── */

.training-passage-waveform {
    margin-top: 0.6rem;
    padding: 0.5rem 0.7rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(201, 169, 110, 0.18);
    border-radius: 6px;
}

.training-waveform-canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 64px;
}

/* ── Feedback prononciation ─────────────────────────────────── */

.training-passage-feedback {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.training-feedback-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.training-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
}

.training-pill strong {
    font-weight: 500;
}

.training-pill small {
    font-size: 0.66rem;
    opacity: 0.75;
}

.training-pill--good {
    background: rgba(131, 181, 140, 0.18);
    color: #a8d2af;
}

.training-pill--medium {
    background: rgba(201, 169, 110, 0.18);
    color: var(--gold, #c9a96e);
}

.training-pill--bad {
    background: rgba(220, 100, 100, 0.18);
    color: #e89999;
}

.training-pill--ai {
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.training-feedback-summary-text {
    font-size: 0.85rem;
    color: var(--text-muted, #aaa);
    margin: 0.3rem 0 0.6rem;
    font-style: italic;
}

.training-words {
    line-height: 1.9;
    font-size: 0.92rem;
}

.training-word {
    padding: 0.05rem 0.25rem;
    border-radius: 3px;
    transition: background 0.15s;
}

.training-word--good { color: #a8d2af; }
.training-word--medium { color: var(--gold, #c9a96e); }
.training-word--bad {
    color: #e89999;
    text-decoration: underline wavy rgba(220, 100, 100, 0.5);
}

@media (max-width: 700px) {
    .training-subscore-row {
        grid-template-columns: 130px 1fr 60px;
    }
    .training-score-overview {
        gap: 1.2rem;
    }
}

/* ============================================================
   I-03 — Timeline d'évolution du score (sparkline SVG vanilla)
   ============================================================ */

.training-score-history {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.training-score-history-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.training-score-history-title {
    font-size: 0.88rem;
    color: var(--text-primary, #e8e4de);
    letter-spacing: 0.01em;
}

.training-score-history-delta {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
}

.training-score-history-svg {
    display: block;
    width: 100%;
    overflow: visible;
}

/* ============================================================
   I-04 — Badges de complétion + célébration à 95
   ============================================================ */

.training-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.8rem;
}

.training-badges--milestone {
    margin-top: 0.7rem;
}

.training-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.74rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.training-badge--axis {
    background: rgba(131, 181, 140, 0.15);
    color: #a8d2af;
    border: 1px solid rgba(131, 181, 140, 0.3);
}

.training-badge--milestone {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted, #888);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0.6;
}

.training-badge--milestone.is-reached {
    background: rgba(201, 169, 110, 0.15);
    color: var(--gold, #c9a96e);
    border-color: rgba(201, 169, 110, 0.35);
    opacity: 1;
}

/* Coche de complétion par axe dans la ligne de sous-score */
.training-subscore-check {
    color: #83b58c;
    font-size: 0.85em;
    margin-left: 0.25rem;
}

.training-subscore-row--done .training-subscore-fill {
    background: #83b58c;
}

/* ── Célébration au franchissement de 95 ─────────────────────── */

.training-celebrate {
    animation: training-celebrate-pulse 1s ease;
}

@keyframes training-celebrate-pulse {
    0% { box-shadow: 0 0 0 0 rgba(131, 181, 140, 0); }
    35% { box-shadow: 0 0 0 6px rgba(131, 181, 140, 0.35); }
    100% { box-shadow: 0 0 0 0 rgba(131, 181, 140, 0); }
}

.training-confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.training-confetti-piece {
    position: absolute;
    top: -12px;
    width: 8px;
    height: 12px;
    border-radius: 1px;
    opacity: 0.9;
    animation-name: training-confetti-fall;
    animation-timing-function: cubic-bezier(0.2, 0.6, 0.4, 1);
    animation-fill-mode: forwards;
}

@keyframes training-confetti-fall {
    0% { transform: translateY(-12px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(540deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .training-celebrate { animation: none; }
    .training-confetti { display: none; }
}

/* ── Héritier — Souvenirs reçus (I-19) ──────────────────────────────────────── */

.heir-depositor-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.heir-depositor-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.heir-depositor-name {
    font-size: 1.05rem;
    font-weight: 600;
}

.heir-depositor-meta {
    font-size: 0.8rem;
}

.heir-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.heir-upload-zone {
    margin: 1.25rem 0;
    border: 1.5px dashed var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.heir-upload-zone:hover {
    border-color: var(--gold);
    background: var(--bg-hover);
}

.heir-upload-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.heir-upload-label svg {
    color: var(--gold);
}

/* Onglets souvenirs */
.heir-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.heir-tab {
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.heir-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.heir-tab.active {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.35);
    color: var(--gold);
    font-weight: 600;
}

.heir-tab-panel {
    animation: heir-fade-in 0.2s ease;
}

@keyframes heir-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bandeau de préavis « seconde mort » (I-65) — phase sunset.
   Ton sobre et digne entre les mois 9 et 11 ; plus visible sous 30 jours. */
.heir-sunset-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-left: 3px solid var(--gold);
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.06);
}

/* Piège connu [hidden] : le `display:flex` ci-dessus (0,1,0) l'emporterait sur
   la règle UA `[hidden] { display:none }` (0,0,1) → sans ce sélecteur le bandeau
   resterait affiché en phase normal/expired. */
.heir-sunset-banner[hidden] {
    display: none;
}

.heir-sunset-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1;
}

.heir-sunset-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Sous 30 jours : intensité accrue (bordure et fond plus marqués). */
.heir-sunset-banner--urgent {
    border-color: rgba(212, 175, 55, 0.55);
    background: rgba(212, 175, 55, 0.12);
}

.heir-sunset-banner--urgent .heir-sunset-text {
    color: var(--text-primary);
    font-weight: 500;
}
