/* ============================================================
   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 {
    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-badge-active {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}

.plan-compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.plan-compare-table th,
.plan-compare-table td {
    padding: 0.65rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}

.plan-compare-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.plan-compare-table td {
    color: var(--text-primary);
}

.plan-compare-table td:first-child {
    color: var(--text-secondary);
}

.plan-compare-table tr:last-child td {
    border-bottom: none;
}

.plan-compare-table .plan-col-active {
    color: var(--gold);
    font-weight: 500;
}

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

.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;
}

@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;
}

/* 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;
    }
}