/* ============================================================
   IDEA CATCHER — Design system DAJM 2030
   ============================================================ */

/* Variables — mode clair (alignées DAJM 2030) */
:root {
    --bg:          #faf8f4;
    --light:       #fcfbf8;
    --cream:       #f7f3eb;
    --bg-card:     #ffffff;
    --ink:         #10322e;
    --ink-light:   #707070;
    --white:       #ffffff;
    --turquoise:   #48ddc9;
    --turquoise-dk:#2bb8a4;
    --border:      #efe8d9;
    --shadow:      0 2px 12px rgba(16, 50, 46, 0.08);
    --shadow-hover:0 6px 24px rgba(16, 50, 46, 0.14);
    --radius:      8px;
    --radius-sm:   8px;
    --radius-lg:   16px;
    --radius-md:   16px;
    --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --transition:  0.2s ease;

    /* Score colors */
    --score-high:  #48ddc9;
    --score-mid:   #ffb147;
    --score-low:   #ff7a7a;
}

/* Variables — dark mode (alignées DAJM 2030) */
[data-theme="dark"] {
    --bg:        #061312;
    --light:     #162320;
    --cream:     #1e2e2b;
    --bg-card:   #162320;
    --white:     #1a2b28;
    --ink:       #e8f0ef;
    --ink-light: #8aa8a3;
    --border:    #2a3d39;
    --shadow:    0 2px 12px rgba(0, 0, 0, 0.4);
}

/* Reset minimal */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Smooth theme transition */
body, .idea-card, .app-header, #modal, .version-header, .version-body, #filters-bar select {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Keyframes ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}
@keyframes scoreGlow {
    0%, 100% { box-shadow: var(--shadow); }
    50%       { box-shadow: 0 0 24px rgba(72, 221, 201, 0.4); }
}

/* ---- Header ---- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
}
.logo-svg { flex-shrink: 0; color: var(--ink); }
.logo-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.3px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---- Bouton micro header (desktop) ---- */
.btn-record-hdr {
    display: none; /* caché par défaut, affiché via media query */
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    height: 38px;
    background: var(--turquoise);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    transition: background var(--transition), transform 0.15s ease, box-shadow var(--transition);
    box-shadow: 0 2px 10px rgba(72,221,201,0.3);
    white-space: nowrap;
}
.btn-record-hdr:hover  { background: var(--turquoise-dk); transform: translateY(-1px); }
.btn-record-hdr:active { transform: scale(0.97); }
.btn-record-hdr.recording { background: #e05a5a; }
.btn-record-hdr .mic-svg {
    filter: invert(17%) sepia(27%) saturate(700%) hue-rotate(120deg) brightness(50%) contrast(90%);
}
.btn-record-hdr.recording .mic-svg { filter: brightness(0) invert(1); }

/* ---- Bouton icône carré (base squircle) ---- */
.btn-icon-sq {
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    border-radius: var(--radius);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-light);
    transition: background .12s, color .12s, border-color .12s;
    flex-shrink: 0;
    position: relative;
}
.btn-icon-sq:hover { background: var(--cream); color: var(--ink); border-color: var(--ink-light); }

/* ---- Bouton theme toggle SVG ---- */
.btn-theme-toggle {
    /* inherits .btn-icon-sq */
}
.theme-icon { display: flex; align-items: center; }
.theme-icon--dark  { display: none; }
[data-theme="dark"] .theme-icon--light { display: none; }
[data-theme="dark"] .theme-icon--dark  { display: flex; }

/* ---- Boutons ---- */
.btn-primary {
    background: var(--turquoise);
    color: var(--ink);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s ease, box-shadow var(--transition);
    min-height: 44px;
    position: relative;
    overflow: hidden;
}
.btn-primary:hover  { background: var(--turquoise-dk); box-shadow: 0 4px 16px rgba(72,221,201,0.35); }
.btn-primary:active { transform: scale(0.97); }

/* Ripple */
.btn-primary .ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    width: 40px; height: 40px;
    margin-top: -20px; margin-left: -20px;
    animation: ripple 0.5s linear forwards;
    pointer-events: none;
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, border-color .12s, color .12s, transform 0.1s ease;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
}
.btn-secondary:hover  { background: var(--cream); border-color: var(--ink-light); }
.btn-secondary:active { transform: scale(0.97); }

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    border-radius: var(--radius);
    font-size: 16px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-light);
    transition: background .12s, color .12s, border-color .12s, transform 0.15s ease;
    flex-shrink: 0;
}
.btn-icon:hover  { background: var(--cream); color: var(--ink); border-color: var(--ink-light); }
.btn-icon:active { transform: scale(0.92); }

/* ---- Barre d'action fixée en bas ---- */
.record-bar-wrapper {
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}
.btn-record-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    height: 60px;
    background: var(--turquoise);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(72,221,201,0.4);
    transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow var(--transition), background var(--transition);
}
.btn-record-bar:hover  { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(72,221,201,0.5); }
.btn-record-bar:active { transform: translateY(0) scale(0.98); }
.btn-record-bar.recording {
    animation: pulse 1.2s infinite;
    background: #e05a5a;
    box-shadow: 0 4px 20px rgba(224,90,90,0.5);
}
.btn-record-bar .mic-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-record-bar .record-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.btn-record-bar .mic-svg {
    filter: invert(17%) sepia(27%) saturate(700%) hue-rotate(120deg) brightness(50%) contrast(90%);
    transition: filter 0.2s ease;
}
.btn-record-bar.recording .mic-svg { filter: brightness(0) invert(1); }
.btn-record-bar.recording .record-text { color: #fff; }

/* Bouton clavier */
.btn-keyboard {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-light);
    box-shadow: var(--shadow);
    transition: background var(--transition), color var(--transition), transform 0.15s ease;
}
.btn-keyboard:hover  { background: var(--cream); transform: translateY(-2px); }
.btn-keyboard:active { transform: scale(0.95); }
.btn-keyboard .keyboard-svg {
    filter: invert(17%) sepia(27%) saturate(700%) hue-rotate(120deg) brightness(50%) contrast(90%);
    transition: filter 0.2s ease;
}
.btn-keyboard:hover .keyboard-svg {
    filter: invert(17%) sepia(27%) saturate(700%) hue-rotate(120deg) brightness(40%) contrast(100%);
}
[data-theme="dark"] .btn-keyboard .keyboard-svg {
    filter: brightness(0) invert(0.7);
}

/* ---- Panel saisie texte ---- */
#text-input-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    animation: fadeIn 0.2s ease;
}
#text-input-overlay.hidden { display: none; }
#text-input-panel {
    position: relative;
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: slideUp 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.text-panel-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--ink-light);
    cursor: pointer;
    padding: 4px 8px;
}
.text-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}
#idea-text-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 15px;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    resize: none;
    outline: none;
    transition: border-color var(--transition);
    line-height: 1.5;
}
#idea-text-input:focus { border-color: var(--turquoise); }

/* Fill the gap between panel bottom and iOS keyboard */
#keyboard-fill {
    width: 100%;
    background: var(--bg-card);
    height: 0;
    flex-shrink: 0;
}

/* ---- Retry button ---- */
.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), border-color var(--transition);
    box-shadow: var(--shadow);
}
.btn-retry:hover { background: var(--cream); border-color: var(--ink-light); }
.btn-retry:active { transform: scale(0.97); }
.retry-icon {
    filter: invert(17%) sepia(27%) saturate(700%) hue-rotate(120deg) brightness(50%) contrast(90%);
}
[data-theme="dark"] .retry-icon { filter: brightness(0) invert(0.8); }
.retry-msg { color: var(--score-low); font-size: 13px; flex: 1; }

/* ---- Context menu ---- */
#ctx-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0,0,0,0.15);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
#ctx-menu {
    position: fixed;
    z-index: 301;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(16,50,46,0.18);
    padding: 6px;
    min-width: 220px;
    opacity: 0;
    transform: scale(0.88) translateY(-8px);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none;
}
#ctx-menu.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

/* Context menu card micro-interactions */
.ctx-active .idea-card:not(.ctx-target) {
    transform: scale(0.97) !important;
    opacity: 0.55;
    filter: blur(1px);
}
.ctx-active .idea-card.ctx-target {
    z-index: 5;
    box-shadow: 0 12px 40px rgba(16,50,46,0.22);
    border-color: var(--turquoise) !important;
    transform: none !important;
}
.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: background var(--transition);
}
.ctx-item:hover { background: var(--cream); }
.ctx-item:active { transform: scale(0.97); }
.ctx-delete { color: #e05a5a; }
.ctx-delete:hover { background: rgba(224,90,90,0.08); }
.ctx-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}
.ctx-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    filter: invert(17%) sepia(27%) saturate(700%) hue-rotate(120deg) brightness(50%) contrast(90%);
}
.ctx-svg-red {
    filter: invert(30%) sepia(60%) saturate(800%) hue-rotate(320deg) brightness(90%) contrast(110%);
}
[data-theme="dark"] .ctx-svg { filter: brightness(0) invert(0.75); }
[data-theme="dark"] .ctx-svg-red {
    filter: invert(50%) sepia(60%) saturate(600%) hue-rotate(320deg) brightness(110%);
}

/* ---- Toast notification ---- */
.toast-notif {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--bg);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 500;
    animation: fadeInUp 0.25s ease, fadeOut 0.3s ease 1.8s forwards;
    white-space: nowrap;
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateX(-50%) translateY(8px); }
}
@keyframes filterPanelIn {
    from { opacity: 0; transform: translateX(-50%) scale(0.95); }
    to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* Bouton record modal (cercle) */
.btn-record {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--turquoise);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow var(--transition);
    box-shadow: 0 4px 20px rgba(72,221,201,0.4);
}
.btn-record:hover  { transform: scale(1.1);  box-shadow: 0 8px 32px rgba(72,221,201,0.5); }
.btn-record:active { transform: scale(0.95); }
.btn-record.recording {
    animation: pulse 1.2s infinite;
    background: #e05a5a;
    box-shadow: 0 4px 20px rgba(224,90,90,0.5);
}
.btn-record .mic-icon { display: flex; align-items: center; justify-content: center; }
.btn-record .mic-svg {
    filter: invert(17%) sepia(27%) saturate(700%) hue-rotate(120deg) brightness(50%) contrast(90%);
    transition: filter 0.2s ease;
}
.btn-record.recording .mic-svg {
    filter: brightness(0) invert(1);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ---- Progress feedback ---- */
#progress-feedback {
    position: fixed;
    bottom: 92px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 14px;
    color: var(--ink-light);
    text-align: center;
    padding: 8px 18px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: fadeInUp 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 99;
}
#modal-progress {
    font-size: 14px;
    color: var(--ink-light);
    text-align: center;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.progress-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--turquoise);
    animation: pulse 1s infinite;
    flex-shrink: 0;
}

/* ---- Bouton filtres + panel ---- */
.filter-btn-wrapper {
    position: relative;
}
.btn-filter {
    position: relative;
    color: var(--ink-light);
}
.btn-filter:hover { color: var(--ink); }

.filter-active-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--turquoise);
    border: 2px solid var(--bg);
    pointer-events: none;
}

.filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(16,50,46,0.14);
    padding: 16px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: filterPanelIn 0.15s cubic-bezier(0.34,1.56,0.64,1);
    transform-origin: top center;
}
.filter-panel.hidden { display: none; }

.filter-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-label  { font-size: 12px; color: var(--ink-light); font-weight: 500; }

.filter-panel select {
    width: 100%;
    padding: 8px 32px 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23707070' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-height: 36px;
}

.filter-toggle {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink-light);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.filter-toggle:hover { background: var(--cream); border-color: var(--ink-light); color: var(--ink); }
.filter-toggle.active {
    background: rgba(72,221,201,0.12);
    border-color: var(--turquoise);
    color: var(--turquoise-dk);
}

/* ---- Masonry board ---- */
.masonry-board {
    column-count: 4;
    column-gap: 16px;
    padding: 8px 24px 100px;
}
@media (max-width: 1200px) { .masonry-board { column-count: 3; } }
@media (max-width: 768px)  { .masonry-board { column-count: 2; } }
@media (max-width: 480px)  { .masonry-board { column-count: 1; } }

/* ---- Idea card ---- */
.idea-card {
    break-inside: avoid;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34,1.2,0.64,1), box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.4s ease both;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.idea-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--turquoise);
}
.idea-card:active { transform: translateY(-1px) scale(0.99); }

/* Carte avec score élevé (≥ 8) */
.idea-card.score-high {
    border-color: rgba(72, 221, 201, 0.5);
    animation: fadeInUp 0.4s ease both, scoreGlow 3s ease-in-out 0.5s infinite;
}

/* Délai d'entrée en cascade */
.idea-card:nth-child(1)  { animation-delay: 0.05s; }
.idea-card:nth-child(2)  { animation-delay: 0.10s; }
.idea-card:nth-child(3)  { animation-delay: 0.15s; }
.idea-card:nth-child(4)  { animation-delay: 0.20s; }
.idea-card:nth-child(5)  { animation-delay: 0.25s; }
.idea-card:nth-child(6)  { animation-delay: 0.30s; }
.idea-card:nth-child(n+7){ animation-delay: 0.35s; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}
.card-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.card-menu-btn {
    background: none;
    border: none;
    color: var(--ink-light);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    line-height: 1;
    transition: background var(--transition), color var(--transition);
    -webkit-touch-callout: none;
}
.card-menu-btn:hover { background: var(--border); color: var(--ink); }

.card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
}

.score-badge {
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.score-badge.sc-9 { background: #48ddc9; color: var(--ink); }
.score-badge.sc-7 { background: #ffe047; color: #3a2d00; }
.score-badge.sc-6 { background: #ffb147; color: #5a3d00; }
.score-badge.sc-4 { background: #ff7a7a; color: #fff; }
.score-badge.sc-0 { background: #10322e; color: #fff; }
.idea-card:hover .score-badge { transform: scale(1.05); }

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.card-date {
    font-size: 11px;
    color: var(--ink-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.category-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--border);
    color: var(--ink-light);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-summary {
    font-size: 14px;
    color: var(--ink-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (min-width: 769px) {
    .card-summary {
        display: block;
        overflow: visible;
        -webkit-line-clamp: unset;
    }
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--ink-light);
}
.empty-state h2 { font-size: 20px; margin-bottom: 8px; color: var(--ink); }
.empty-state p  { font-size: 15px; }

/* ---- Modal ---- */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 50, 46, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
#modal-overlay.closing { animation: fadeIn 0.2s ease reverse; }

#modal {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    animation: scaleIn 0.25s cubic-bezier(0.34,1.3,0.64,1);
}
#modal.closing { animation: scaleIn 0.2s ease reverse; }

@media (max-width: 640px) {
    #modal-overlay { padding: 0; align-items: flex-end; }
    #modal { border-radius: var(--radius-md) var(--radius-md) 0 0; max-height: 92vh; }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    font-size: 18px;
    cursor: pointer;
    color: var(--ink);
}

.modal-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-right: 52px;
}
.modal-date {
    font-size: 12px;
    color: var(--ink-light);
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; padding-right: 52px; }

.score-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.btn-reanalyze {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-light);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-reanalyze:hover    { background: var(--cream); color: var(--ink); border-color: var(--ink-light); }
.btn-reanalyze:disabled { opacity: 0.5; cursor: default; }

.score-dimensions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.score-dim {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
}
.score-dim-label { color: var(--ink-light); margin-bottom: 2px; }
.score-dim-value { font-weight: 700; color: var(--ink); }

.modal-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-light);
    margin: 20px 0 8px;
}

/* AI verdict block */
.ai-verdict {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--cream);
    border: 1px solid var(--border);
    border-left: 3px solid var(--turquoise);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 12px;
}
[data-theme="dark"] .ai-verdict { background: var(--light); }
.ai-verdict-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--turquoise-dk);
    background: rgba(72,221,201,0.15);
    border: 1px solid rgba(72,221,201,0.35);
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 1px;
}
.ai-verdict-text {
    font-size: 13px;
    color: var(--ink);
    line-height: 1.6;
    margin: 0;
    font-style: italic;
}

.transcript-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 14px;
    color: var(--ink-light);
    line-height: 1.6;
}

/* Accordéon versions */
.version-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}
.version-item:hover { border-color: var(--turquoise); }

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--bg);
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
    user-select: none;
}
.version-header:hover { background: var(--border); }

.version-header .toggle-icon {
    transition: transform 0.25s cubic-bezier(0.34,1.3,0.64,1);
    display: inline-block;
}
.version-header.open .toggle-icon { transform: rotate(180deg); }

.version-body {
    padding: 12px 16px;
    font-size: 14px;
    border-top: 1px solid var(--border);
    animation: fadeInUp 0.2s ease;
}

.score-delta-positive { color: #2bb8a4; font-weight: 700; }
.score-delta-negative { color: #e05a5a; font-weight: 700; }

/* Modal actions */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    align-items: center;
}
.btn-challenge { background: var(--turquoise); }
.btn-bmad      { background: var(--ink); color: var(--cream); border: none; flex: 1; }
.btn-challenge { flex: 1; }

.btn-icon-delete {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(224,90,90,0.1);
    border: 1.5px solid rgba(224,90,90,0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), border-color var(--transition), transform 0.15s ease;
}
.btn-icon-delete:hover  { background: rgba(224,90,90,0.2); border-color: #e05a5a; }
.btn-icon-delete:active { transform: scale(0.92); }
.trash-icon-modal {
    filter: invert(30%) sepia(60%) saturate(800%) hue-rotate(320deg) brightness(90%) contrast(110%);
}

/* ---- Login ---- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}
.login-card h1 { font-size: 28px; margin-bottom: 8px; }
.login-subtitle { color: var(--ink-light); margin-bottom: 28px; font-size: 15px; }

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow var(--transition);
    min-height: 44px;
}
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

.error-msg {
    background: #fde8e8;
    color: #c0392b;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ---- Utilitaires ---- */
.hidden { display: none !important; }

/* ---- Icônes dans boutons primaires (modal) ---- */
.btn-icon-svg {
    width: 17px;
    height: 17px;
    vertical-align: middle;
    margin-right: 2px;
    filter: invert(17%) sepia(27%) saturate(700%) hue-rotate(120deg) brightness(50%) contrast(90%);
    position: relative;
    top: -1px;
}

/* ---- Desktop layout ---- */
@media (min-width: 769px) {
    /* Bouton micro en bas → caché */
    .record-bar-wrapper { display: none; }
    /* Bouton micro header → visible */
    .btn-record-hdr { display: flex; }
    /* Max-width centré */
    .app-header { padding: 14px 40px; }
    #app {
        max-width: 1280px;
        margin: 0 auto;
        padding: 0 24px;
    }
    #filters-bar { padding: 16px 0; }
    .masonry-board { padding: 8px 0 40px; }
    /* Progress feedback adapté */
    #progress-feedback { bottom: 20px; }
}
