/* ============================================================
   TrouNoir — Design system
   Palette dérivée du logo : noir profond + jaune solaire + violet magique
   Style : épuré, généreux, mobile-first, dark thème
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
    /* Surfaces */
    --bg:           #0a0a0a;
    --bg-soft:      #14101e;
    --bg-card:      #1c1727;
    --bg-elevated:  #251e34;

    /* Foregrounds */
    --fg:           #f8e9d2;
    --fg-muted:     #a89cb9;
    --fg-dim:       #6b5f7d;

    /* Accent jaune (primary) — issu du wordmark */
    --accent:       #FFD23F;
    --accent-hover: #ffdf66;
    --accent-soft:  rgba(255, 210, 63, 0.12);
    --accent-text:  #1a1308;

    /* Secondary violet — issu du contour du logo */
    --secondary:       #C026D3;
    --secondary-hover: #d943e8;
    --secondary-soft:  rgba(192, 38, 211, 0.16);

    /* Bordures */
    --border:       #2a2336;
    --border-soft:  #1f1a2a;
    --ring:         rgba(255, 210, 63, 0.4);

    /* État */
    --success:      #6bd97d;
    --error:        #ff7a8a;

    /* Géométrie */
    --radius-sm:    10px;
    --radius:       16px;
    --radius-lg:    22px;
    --radius-full:  999px;

    /* Espacement */
    --space-1:      0.4rem;
    --space-2:      0.75rem;
    --space-3:      1.1rem;
    --space-4:      1.6rem;
    --space-5:      2.4rem;

    /* Safe area */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bot: env(safe-area-inset-bottom, 0px);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bot);
    /* Subtle radial gradient violet en arrière-plan (très discret) */
    background-image:
        radial-gradient(circle at 20% 0%, rgba(192, 38, 211, 0.08), transparent 50%),
        radial-gradient(circle at 80% 100%, rgba(255, 210, 63, 0.06), transparent 50%);
    background-attachment: fixed;
}

#app {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 1.2rem 3rem;
}

.view { animation: fade-in 0.25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============ Logo + brand ============ */
.brand {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.logo {
    width: 180px; height: auto;
    max-width: 50vw;
    filter: drop-shadow(0 8px 30px rgba(255, 210, 63, 0.18));
    user-select: none; -webkit-user-drag: none;
}
.logo-mini {
    width: 40px; height: 40px;
    flex-shrink: 0;
    user-select: none; -webkit-user-drag: none;
}
.tagline {
    color: var(--fg-muted);
    margin: 0;
    font-style: italic;
    font-size: 0.95rem;
    max-width: 420px;
}

/* ============ Topbar ============ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 0 1.2rem;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 0.75rem;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}
.topbar-left > div { min-width: 0; }
.topbar strong { display: block; font-size: 1rem; line-height: 1.2; }
.topbar small { color: var(--fg-muted); font-size: 0.8rem; }
.topbar-right { display: flex; align-items: center; gap: 0.35rem; }

.btn-icon {
    width: 38px; height: 38px;
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-icon:hover, .btn-icon:focus-visible { background: var(--accent-soft); border-color: var(--accent); outline: none; }
.btn-icon:active { transform: scale(0.94); }

/* --- Avatar utilisateur dans la topbar (clickable → profil) --- */
.user-avatar-btn {
    width: 44px; height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.user-avatar-btn::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}
.user-avatar-btn:hover::after,
.user-avatar-btn:focus-visible::after {
    border-color: var(--accent);
}
.user-avatar-btn:focus-visible { outline: none; }
.user-avatar-btn:hover { transform: translateY(-1px); }
.user-avatar-btn:active { transform: scale(0.94); }

.user-avatar {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--hue, 280) 70% 55%) 0%, hsl(var(--hue, 280) 60% 38%) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.45), inset 0 -1px 2px rgba(0,0,0,0.15);
    user-select: none;
}
.user-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Burger menu --- */
.menu-wrap { position: relative; }
.btn-burger {
    width: 42px; height: 42px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: inline-flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
    padding: 0;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-burger span {
    display: block;
    width: 18px; height: 2px;
    background: var(--fg);
    border-radius: 1px;
    transition: transform 0.25s, opacity 0.2s, background 0.15s;
}
.btn-burger:hover, .btn-burger:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
    outline: none;
}
.btn-burger:hover span { background: var(--accent); }
.btn-burger.open {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-burger.open span { background: var(--accent-text); }
.btn-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.btn-burger.open span:nth-child(2) { opacity: 0; }
.btn-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.menu {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    min-width: 240px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.45rem;
    z-index: 50;
    box-shadow: 0 18px 50px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
    gap: 0.15rem;
    animation: menu-pop 0.18s ease;
}
@keyframes menu-pop {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}
.menu button {
    text-align: left;
    padding: 0.7rem 0.9rem;
    background: transparent;
    color: var(--fg);
    border: none;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.menu button:hover, .menu button:focus-visible {
    background: var(--accent-soft);
    color: var(--accent);
    outline: none;
}
.menu button.menu-danger:hover {
    background: rgba(255, 122, 138, 0.15);
    color: var(--error);
}
.menu button[hidden] { display: none; }

.badge {
    background: var(--accent);
    color: var(--accent-text);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: var(--radius-full);
    min-width: 1.6rem;
    text-align: center;
    line-height: 1.4;
}

/* ============ OAuth (Google sign-in) ============ */
.oauth-block {
    max-width: 380px;
    margin: 1.8rem auto 0.3rem;
    display: flex; flex-direction: column; gap: 1rem;
}
.btn-google {
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    gap: 0.7rem;
    padding: 0.85rem 1.1rem;
    background: #fff;
    color: #1f1f1f;
    border: 1px solid #dadce0;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.btn-google:active { transform: scale(0.98); }
.btn-google svg { flex-shrink: 0; }
.oauth-divider {
    text-align: center;
    color: var(--fg-muted);
    font-size: 0.8rem;
    position: relative;
    margin: 0.4rem 0 0.2rem;
}
.oauth-divider::before,
.oauth-divider::after {
    content: '';
    position: absolute;
    top: 50%; width: calc(50% - 4.5rem);
    height: 1px; background: var(--border);
}
.oauth-divider::before { left: 0; }
.oauth-divider::after  { right: 0; }
.oauth-divider span { background: var(--bg); padding: 0 0.7rem; position: relative; z-index: 1; }

/* ============ Tabs (Auth) ============ */
.tabs {
    display: flex; gap: 0.4rem;
    max-width: 380px;
    margin: 1.8rem auto 1.2rem;
    padding: 0.3rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}
.tab {
    flex: 1;
    padding: 0.6rem 0.5rem;
    background: transparent;
    color: var(--fg-muted);
    border: none;
    border-radius: var(--radius-full);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.tab.active { background: var(--accent); color: var(--accent-text); }
.tab:hover:not(.active) { color: var(--fg); }

/* ============ Forms ============ */
.form {
    display: flex; flex-direction: column;
    gap: 0.85rem;
    max-width: 380px;
    margin: 0 auto;
}
.form label {
    display: flex; flex-direction: column; gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--fg-muted);
    font-weight: 500;
}
.form input, .form textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-soft);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    -webkit-appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form input:focus, .form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--ring);
}
.form button[type=submit] {
    margin-top: 0.4rem;
    padding: 0.95rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-text);
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.form button[type=submit]:hover { background: var(--accent-hover); }
.form button[type=submit]:active { transform: scale(0.98); }

.hint { color: var(--fg-muted); font-size: 0.82rem; text-align: center; margin: 0; }
.error { color: var(--error); text-align: center; margin: 0; font-size: 0.88rem; }

/* ============ Capture dock (fixed bottom, toujours visible) ============ */
.capture-dock {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    padding: 1.2rem 1rem calc(0.7rem + var(--safe-bot));
    pointer-events: none;
    /* Fondu doux entre le contenu et le dock pour éviter une coupure franche */
    background: linear-gradient(
        180deg,
        rgba(10, 10, 10, 0)    0%,
        rgba(10, 10, 10, 0.55) 45%,
        rgba(10, 10, 10, 0.92) 100%
    );
    animation: dock-rise 0.45s cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.capture-dock-inner {
    pointer-events: auto;
    max-width: 720px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.55rem;
    padding: 0.55rem;
    background: rgba(20, 16, 30, 0.72);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 -4px 20px rgba(0, 0, 0, 0.35),
        0 20px 50px rgba(0, 0, 0, 0.5);
}

@keyframes dock-rise {
    from { transform: translateY(120%); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

/* Réserve l'espace en bas du view-capture pour ne pas masquer le contenu */
#view-capture {
    padding-bottom: calc(120px + var(--safe-bot));
}

.capture-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.3rem;
    min-height: 78px;
    padding: 0.65rem 0.5rem;
    background: var(--bg-card);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease,
        color 0.2s ease;
}
.capture-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 120%, var(--accent-soft) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.capture-btn:hover, .capture-btn:focus-visible {
    background: var(--bg-elevated);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent-soft);
    outline: none;
}
.capture-btn:hover::before,
.capture-btn:focus-visible::before { opacity: 1; }
.capture-btn:active {
    transform: translateY(0) scale(0.96);
    transition-duration: 0.08s;
}
.capture-btn .emoji {
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
    transition: transform 0.3s cubic-bezier(0.5, -0.4, 0.5, 1.6);
}
.capture-btn:hover .emoji,
.capture-btn:focus-visible .emoji { transform: scale(1.12) rotate(-6deg); }
.capture-btn-label {
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.capture-btn.recording {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
    animation: pulse 1.5s ease-in-out infinite;
}
.capture-btn.recording::before { opacity: 0; }
.capture-btn.recording .emoji { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }

@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--secondary-soft); } 50% { box-shadow: 0 0 0 12px transparent; } }

@media (max-width: 480px) {
    .capture-dock { padding: 0.9rem 0.6rem calc(0.5rem + var(--safe-bot)); }
    .capture-dock-inner { padding: 0.45rem; gap: 0.4rem; border-radius: var(--radius); }
    .capture-btn { min-height: 70px; font-size: 0.78rem; padding: 0.5rem 0.35rem; gap: 0.25rem; }
    .capture-btn .emoji { font-size: 1.45rem; }
    #view-capture { padding-bottom: calc(108px + var(--safe-bot)); }
}

@media (prefers-reduced-motion: reduce) {
    .capture-dock { animation: none; }
    .capture-btn,
    .capture-btn .emoji,
    .capture-btn::before { transition: none; }
    .capture-btn:hover,
    .capture-btn:focus-visible { transform: none; }
}

/* ============ Status & banner ============ */
.status { color: var(--fg-muted); font-size: 0.85rem; min-height: 1.2em; margin: 0.5rem 0; text-align: center; }
.status.success { color: var(--success); }
.status.error { color: var(--error); }

.offline-banner {
    background: var(--secondary-soft);
    color: var(--secondary);
    text-align: center;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin: 0.6rem 0;
    border: 1px solid var(--secondary);
}

/* ============ Subtabs (Liste / Carte / Mon Carnet / Résumé) ============ */
.subtabs {
    display: flex;
    gap: 0.4rem;
    margin: 1.6rem 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.4rem;
    scrollbar-width: thin;
}
.subtabs::-webkit-scrollbar { height: 3px; }
.subtabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.subtab {
    flex: 0 0 auto;
    padding: 0.55rem 1.1rem;
    background: var(--bg-soft);
    color: var(--fg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.subtab:hover { color: var(--fg); border-color: var(--secondary); }
.subtab.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }

.subpanel { margin: 0.5rem 0 2.5rem; }

/* ============ Panel header (titre + sous-titre dans un panel) ============ */
.panel-header {
    margin: 0 0 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-soft);
}
.panel-title {
    margin: 0 0 0.3rem;
    font-size: 1.2rem;
    color: var(--fg);
    letter-spacing: -0.01em;
    font-weight: 700;
}
.panel-subtitle {
    margin: 0;
    color: var(--fg-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ============ Timeline / Entries ============ */
.entry-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 1rem;
}

/* Timeline mode : ligne verticale subtile sur la gauche, points sur les entries */
.entry-list.timeline {
    position: relative;
}
.entry-list.timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: linear-gradient(180deg,
        transparent 0%,
        var(--border) 8%,
        var(--border) 92%,
        transparent 100%
    );
    pointer-events: none;
}
@media (max-width: 640px) {
    .entry-list.timeline::before { display: none; }
}

.entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 1.2rem;
    align-items: start;
    transition: border-color 0.2s, transform 0.1s;
    position: relative;
}
.entry:hover { border-color: var(--secondary); }
.entry.solo { background: linear-gradient(180deg, var(--bg-card) 0%, rgba(192, 38, 211, 0.04) 100%); }
.entry.solo .entry-avatar::after {
    content: '🔒';
    position: absolute;
    bottom: -4px; right: -6px;
    background: var(--bg);
    border-radius: 50%;
    padding: 2px 4px;
    font-size: 0.65rem;
    line-height: 1;
}

/* --- Sidebar (avatar + auteur + date + lieu) --- */
.entry-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding-top: 0.15rem;
    color: var(--fg-muted);
    font-size: 0.78rem;
    text-align: center;
}

.entry-avatar {
    position: relative;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--hue, 200) 70% 55%) 0%, hsl(var(--hue, 200) 60% 40%) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 -1px 2px rgba(0,0,0,0.15);
    flex-shrink: 0;
    z-index: 1; /* au-dessus de la ligne timeline */
}
.entry-type-badge {
    position: absolute;
    bottom: -4px; left: -4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    line-height: 1;
}

.entry-side .entry-author {
    color: var(--fg);
    font-weight: 600;
    font-size: 0.82rem;
    max-width: 110px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.entry-date {
    display: flex; flex-direction: column; align-items: center;
    line-height: 1.15;
    gap: 0.02rem;
}
.entry-day {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.entry-month {
    font-size: 0.7rem;
    color: var(--fg-muted);
    text-transform: lowercase;
    letter-spacing: 0.04em;
}
.entry-time {
    font-size: 0.75rem;
    color: var(--fg-muted);
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    margin-top: 0.15rem;
}

.entry-geo {
    display: inline-flex; align-items: center; gap: 0.25rem;
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    background: var(--secondary-soft);
    border-radius: var(--radius-full);
    line-height: 1.3;
    margin-top: 0.15rem;
    transition: background 0.15s;
}
.entry-geo:hover { background: rgba(192, 38, 211, 0.28); }
.entry-geo span { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.68rem; }

/* --- Main content (photo / audio / text + actions) --- */
.entry-main {
    display: flex; flex-direction: column;
    gap: 0.65rem;
    min-width: 0; /* permet text overflow proper dans grid */
}
.entry-photo img {
    width: 100%; height: auto;
    border-radius: var(--radius-sm);
    display: block;
    background: var(--bg-soft);
}
.entry-audio audio {
    width: 100%;
    border-radius: var(--radius-full);
}
.entry-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
    color: var(--fg);
    font-size: 0.95rem;
}

.entry-transcript {
    display: flex; flex-direction: column; gap: 0.3rem;
    padding: 0.7rem 0.9rem;
    background: var(--secondary-soft);
    border-left: 3px solid var(--secondary);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--fg);
}
.entry-transcript-label {
    color: var(--secondary);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.entry-error {
    color: var(--error);
    font-size: 0.82rem;
    padding: 0.5rem 0.7rem;
    background: rgba(255, 122, 138, 0.1);
    border-radius: var(--radius-sm);
}

/* --- States --- */
.entry.pending {
    border-style: dashed;
    border-color: var(--secondary);
    opacity: 0.92;
}
.entry.dead {
    border-color: var(--error);
    opacity: 0.65;
}

/* --- Mobile : sidebar passe en haut, horizontal compact --- */
@media (max-width: 640px) {
    .entry {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        padding: 0.9rem 1rem;
    }
    .entry-side {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        text-align: left;
        gap: 0.6rem 0.7rem;
        padding-bottom: 0.7rem;
        border-bottom: 1px solid var(--border-soft);
    }
    .entry-avatar { width: 38px; height: 38px; font-size: 0.8rem; }
    .entry-type-badge { width: 18px; height: 18px; font-size: 0.6rem; bottom: -2px; left: -2px; }
    .entry-side .entry-author { max-width: 160px; }
    .entry-date { flex-direction: row; gap: 0.35rem; align-items: baseline; }
    .entry-day { font-size: 1rem; }
    .entry-time { margin-top: 0; }
    .entry-geo { margin-top: 0; margin-left: auto; }
}

.entry-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.2rem; }
.btn-mini {
    padding: 0.32rem 0.7rem;
    background: var(--bg-soft);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font: inherit; font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-mini:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-mini:disabled { opacity: 0.5; cursor: wait; }

.empty {
    color: var(--fg-dim);
    text-align: center;
    font-style: italic;
    padding: 2.5rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    margin: 0;
}

/* ============ Map ============ */
.map {
    width: 100%; height: 520px;
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
    border: 1px solid var(--border);
}
@media (max-width: 600px) { .map { height: 60vh; } }
.leaflet-popup-content-wrapper { border-radius: var(--radius-sm); }
.leaflet-popup-content { color: #111; font-family: inherit; margin: 0.75rem; }

/* ============ Summary ============ */
.summary-controls {
    display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
    margin-bottom: 1.1rem;
}
.radio-inline {
    display: inline-flex; align-items: center;
    gap: 0.45rem;
    color: var(--fg); font-size: 0.92rem;
    cursor: pointer;
}
.radio-inline input[type=radio] {
    accent-color: var(--accent);
    width: 1.05rem; height: 1.05rem;
}
.btn-primary {
    padding: 0.75rem 1.4rem;
    background: var(--accent); color: var(--accent-text);
    border: none; border-radius: var(--radius-sm);
    font: inherit; font-weight: 700; cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.summary-output {
    background: var(--bg-card);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    white-space: pre-wrap;
    word-break: break-word;
    font: inherit;
    line-height: 1.65;
    margin: 0;
}

/* ============ Modal (text capture) ============ */
.modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    z-index: 100;
    animation: fade-in 0.15s ease;
}
.modal-inner {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    width: 100%; max-width: 500px;
    display: flex; flex-direction: column; gap: 0.9rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal textarea {
    background: var(--bg-soft);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    font: inherit;
    line-height: 1.5;
    resize: vertical;
    min-height: 130px;
}
.modal textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; }
.modal-actions button {
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-sm);
    font: inherit; font-weight: 600;
    cursor: pointer; border: none;
}
#text-cancel { background: var(--bg-soft); color: var(--fg); border: 1px solid var(--border); }
#text-save { background: var(--accent); color: var(--accent-text); }

/* ============ Dictée modal ============ */
.dicta-modal {
    gap: 0.85rem;
    max-width: 560px;
}
.dicta-header {
    display: flex; align-items: center; gap: 0.6rem;
    color: var(--fg-muted);
    font-size: 0.88rem;
}
.dicta-state-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.2s;
}
.dicta-state-dot.on {
    background: var(--error);
    animation: rec-pulse 1.3s infinite ease-out;
}
.dicta-controls {
    display: flex; align-items: center; gap: 0.6rem;
    flex-wrap: wrap;
}
.dicta-mic {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.65rem 1rem;
    background: var(--secondary-soft);
    color: var(--secondary);
    border: 1px solid var(--secondary);
    border-radius: var(--radius-full);
    font: inherit;
    font-weight: 600; font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
}
.dicta-mic #dicta-mic-emoji { font-size: 1.1rem; line-height: 1; }
.dicta-mic:hover { background: var(--secondary); color: #fff; }
.dicta-mic.on {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
    animation: rec-pulse 1.5s infinite ease-out;
}
.dicta-mic.on:hover { background: var(--error); filter: brightness(1.1); }
#dicta-fallback-msg { text-align: left; margin: 0; }

/* ============ Pitch (vue Auth) ============ */
.pitch {
    max-width: 560px;
    margin: 2.5rem auto 1rem;
    padding: 1.6rem 1.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    line-height: 1.65;
    color: var(--fg);
}
.pitch h2 {
    margin: 0 0 0.8rem;
    color: var(--accent);
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}
.pitch p { margin: 0 0 1rem; color: var(--fg); }
.pitch p:last-child { margin-bottom: 0; }
.pitch strong { color: var(--accent); font-weight: 600; }
.pitch em { color: var(--secondary); font-style: italic; }
.pitch .kbd {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    white-space: nowrap;
}
.pitch-list {
    list-style: none;
    padding: 0;
    margin: 1.1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.pitch-list li {
    padding: 0.55rem 0.85rem;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
}
.pitch-list li strong { color: var(--fg); }
.pitch-footer {
    text-align: center;
    color: var(--fg-muted);
    margin-top: 1.2rem !important;
    font-size: 0.95rem;
}

/* ============ Info / Mode d'emploi ============ */
.info {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 0 3rem;
    line-height: 1.7;
    color: var(--fg);
}
.info h2 {
    margin: 2.2rem 0 0.7rem;
    color: var(--accent);
    font-size: 1.15rem;
    letter-spacing: -0.005em;
}
.info h2:first-of-type { margin-top: 0.5rem; }
.info p { margin: 0 0 0.9rem; }
.info ul {
    margin: 0.5rem 0 1.1rem;
    padding-left: 1.4rem;
    display: flex; flex-direction: column; gap: 0.45rem;
}
.info li { padding-left: 0.2rem; }
.info strong { color: var(--accent); font-weight: 600; }
.info em { color: var(--secondary); }
.info code {
    background: var(--bg-soft);
    color: var(--accent);
    padding: 0.05rem 0.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.88em;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.info-aside {
    padding: 0.9rem 1.1rem;
    background: var(--secondary-soft);
    border-left: 3px solid var(--secondary);
    border-radius: var(--radius-sm);
    margin: 0.5rem 0 1.4rem !important;
    color: var(--fg);
}
.info-aside strong { color: var(--secondary); }
.info-footer {
    text-align: center;
    color: var(--fg-muted);
    margin-top: 2.5rem !important;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
}

/* ============ CaptureStatus overlay (multi-phases) ============ */
.cs-overlay {
    position: fixed; inset: 0;
    z-index: 10002;
    background: rgba(10, 10, 10, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.cs-overlay.show { opacity: 1; }

.cs-card {
    width: 100%; max-width: 380px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.4rem 1.3rem;
    text-align: center;
    display: flex; flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(192,38,211,0.15);
    transform: translateY(10px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cs-overlay.show .cs-card { transform: none; }

.cs-icon-wrap {
    position: relative;
    width: 96px; height: 96px;
    display: flex; align-items: center; justify-content: center;
}
.cs-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}
.cs-icon {
    position: relative;
    font-size: 2.6rem;
    line-height: 1;
    z-index: 1;
    transition: transform 0.3s, color 0.3s;
}

/* Phase prepare : ring jaune qui tourne */
[data-phase="prepare"] .cs-ring {
    border: 3px solid transparent;
    border-top-color: var(--accent);
    border-right-color: var(--accent);
    animation: cs-spin 0.9s linear infinite;
}
[data-phase="prepare"] .cs-icon { animation: cs-bob 1.2s ease-in-out infinite; }
@keyframes cs-spin { to { transform: rotate(360deg); } }
@keyframes cs-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* Phase geo : ring violet qui pulse */
[data-phase="geo"] .cs-ring {
    border: 3px solid var(--secondary);
    animation: cs-pulse-ring 1.6s ease-out infinite;
}
[data-phase="geo"] .cs-icon { animation: cs-pin-bounce 1.4s ease-in-out infinite; }
@keyframes cs-pulse-ring {
    0%   { transform: scale(0.85); opacity: 0.7; box-shadow: 0 0 0 0 rgba(192, 38, 211, 0.55); }
    70%  { transform: scale(1.1);  opacity: 0;   box-shadow: 0 0 0 20px rgba(192, 38, 211, 0); }
    100% { opacity: 0; }
}
@keyframes cs-pin-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Phase upload : ring conique en rotation */
[data-phase="upload"] .cs-ring {
    background: conic-gradient(from 0deg, var(--accent), var(--secondary), var(--accent));
    -webkit-mask: radial-gradient(circle, transparent 38px, black 40px);
            mask: radial-gradient(circle, transparent 38px, black 40px);
    animation: cs-spin 1.6s linear infinite;
}
[data-phase="upload"] .cs-icon { animation: cs-bob 1s ease-in-out infinite; }

/* Phase success : burst */
[data-phase="success"] .cs-icon-wrap::before {
    content: '✨';
    position: absolute;
    top: -8px; right: -8px;
    font-size: 1.4rem;
    animation: cs-sparkle 0.8s ease-out;
}
[data-phase="success"] .cs-icon-wrap::after {
    content: '🌀';
    position: absolute;
    bottom: -10px; left: -10px;
    font-size: 1.5rem;
    animation: cs-sparkle 0.8s ease-out 0.2s both;
}
[data-phase="success"] .cs-ring {
    background: radial-gradient(circle, rgba(255,210,63,0.35) 0%, transparent 70%);
    animation: cs-success-burst 0.7s ease-out;
}
[data-phase="success"] .cs-icon { animation: cs-success-pop 0.55s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes cs-sparkle {
    0%   { transform: scale(0) rotate(-90deg); opacity: 0; }
    60%  { transform: scale(1.3) rotate(20deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes cs-success-burst {
    0%   { transform: scale(0); opacity: 0; }
    50%  { transform: scale(1.4); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}
@keyframes cs-success-pop {
    0%   { transform: scale(0.4); }
    60%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}
[data-phase="success"] .cs-title { color: var(--accent); }

/* Phase queued : orbite continue (signifie "en attente, sync au retour") */
[data-phase="queued"] .cs-icon-wrap {
    transform: scale(1.05);
}
[data-phase="queued"] .cs-ring {
    border: 2px dashed var(--secondary);
    animation: cs-spin 4s linear infinite;
}
[data-phase="queued"] .cs-icon-wrap::after {
    content: '🛰️';
    position: absolute;
    font-size: 1.3rem;
    top: 50%; left: 50%;
    transform-origin: -32px 0;
    animation: cs-orbit 3s linear infinite;
}
@keyframes cs-orbit {
    0%   { transform: rotate(0)   translate(56px, 0) rotate(0); }
    100% { transform: rotate(360deg) translate(56px, 0) rotate(-360deg); }
}
[data-phase="queued"] .cs-title { color: var(--secondary); }

/* Phase failed : shake + bordure rouge */
[data-phase="failed"] .cs-icon-wrap::before {
    content: '✕';
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 4rem; color: var(--error);
    font-weight: 700;
    z-index: 2;
    animation: cs-fail-pop 0.4s ease-out;
}
[data-phase="failed"] .cs-icon { opacity: 0.35; filter: grayscale(0.8); }
[data-phase="failed"] .cs-card { animation: cs-shake 0.6s ease-in-out; border-color: var(--error); }
@keyframes cs-fail-pop {
    0% { transform: scale(0) rotate(-90deg); opacity: 0; }
    60% { transform: scale(1.3) rotate(15deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes cs-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-9px); }
    40%, 80% { transform: translateX(9px); }
}
[data-phase="failed"] .cs-title { color: var(--error); }

.cs-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--fg);
    font-weight: 700;
    letter-spacing: -0.005em;
    min-height: 1.4em;
}
.cs-detail {
    margin: 0;
    color: var(--fg-muted);
    font-size: 0.88rem;
    line-height: 1.45;
    min-height: 1.4em;
}

.cs-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-soft);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}
.cs-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--secondary));
    border-radius: var(--radius-full);
    transition: width 0.18s ease;
}
.cs-bar.indeterminate {
    width: 40% !important;
    animation: cs-indeterminate 1.3s ease-in-out infinite;
}
@keyframes cs-indeterminate {
    0%   { transform: translateX(-110%); }
    100% { transform: translateX(280%); }
}

.cs-close {
    margin-top: 0.3rem;
    padding: 0.55rem 1.5rem;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: var(--radius-full);
    font: inherit; font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.cs-close:hover { background: var(--accent-hover); }
.cs-close:active { transform: scale(0.96); }

@media (prefers-reduced-motion: reduce) {
    .cs-overlay, .cs-card, .cs-icon-wrap *, .cs-ring, .cs-icon, .cs-bar {
        animation: none !important;
        transition: opacity 0.15s ease !important;
    }
}

@media (max-width: 480px) {
    .cs-card { padding: 1.5rem 1.1rem 1.1rem; max-width: 92vw; }
    .cs-icon-wrap { width: 84px; height: 84px; }
    .cs-icon { font-size: 2.2rem; }
}

/* ============ Toasts ============ */
#toast-container {
    position: fixed;
    top: calc(0.7rem + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex; flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    width: min(420px, calc(100vw - 1.4rem));
}
.toast {
    background: var(--bg-elevated);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    line-height: 1.4;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
    word-break: break-word;
}
.toast.show { opacity: 1; transform: none; }
.toast-success {
    background: linear-gradient(135deg, var(--accent) 0%, #ffea7a 100%);
    color: var(--accent-text);
    border-color: var(--accent);
    font-weight: 600;
}
.toast-error {
    background: var(--bg-elevated);
    color: var(--error);
    border-color: var(--error);
    font-weight: 500;
}

/* ============ Black hole capture animation ============ */
.bh-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    overflow: hidden;
    animation: bh-overlay-fade 1.3s ease forwards;
}
@keyframes bh-overlay-fade {
    0%   { background: rgba(0,0,0,0); }
    10%  { background: rgba(0,0,0,0.55); }
    85%  { background: rgba(0,0,0,0.8); }
    100% { background: rgba(0,0,0,0); }
}
.bh-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
}
.bh-subject {
    position: absolute;
    left: 50%; top: 50%;
    width: 160px; height: 160px;
    border-radius: 24%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    background-size: cover; background-position: center;
    color: var(--accent-text);
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    padding: 0.6rem;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    animation: bh-subject-suck 1.3s cubic-bezier(0.5, 0.05, 0.85, 0.15) forwards;
    box-shadow:
        0 0 40px 4px rgba(255, 210, 63, 0.7),
        0 0 90px 20px rgba(192, 38, 211, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    will-change: transform, opacity;
}
.bh-subject.has-image { background-color: transparent; }
.bh-subject.has-text {
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(255, 210, 63, 0.95), rgba(192, 38, 211, 0.85));
    color: #fff;
    overflow: hidden;
}
@keyframes bh-subject-suck {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
        filter: blur(0);
    }
    35% {
        transform: translate(-50%, -50%) scale(0.85) rotate(180deg);
        opacity: 1;
        filter: blur(0);
    }
    75% {
        transform: translate(-50%, -50%) scale(0.18) rotate(900deg);
        opacity: 0.85;
        filter: blur(1px);
    }
    100% {
        transform: translate(-50%, -50%) scale(0) rotate(1620deg);
        opacity: 0;
        filter: blur(4px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bh-overlay { display: none !important; }
}

/* ============ Audio recorder modal ============ */
.audio-modal-inner {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.4rem 1.2rem;
    width: 100%; max-width: 560px;
    display: flex; flex-direction: column; gap: 1.1rem;
    box-shadow: 0 25px 70px rgba(0,0,0,0.55), 0 0 0 1px rgba(192, 38, 211, 0.12);
}
.audio-header {
    display: flex; align-items: center; gap: 0.6rem;
    color: var(--fg);
    font-size: 0.95rem;
}
.audio-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--error);
    box-shadow: 0 0 0 0 var(--error);
    animation: rec-pulse 1.2s infinite ease-out;
}
.audio-dot.paused {
    background: var(--fg-muted);
    animation: none;
    box-shadow: none;
}
@keyframes rec-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,122,138,0.6); }
    70%  { box-shadow: 0 0 0 10px rgba(255,122,138,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,122,138,0); }
}
.audio-state { font-weight: 600; flex: 1; }
.audio-timer {
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 1rem;
    color: var(--accent);
    letter-spacing: 0.04em;
}

.audio-canvas {
    width: 100%;
    height: 120px;
    background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: block;
}

.audio-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.6rem;
}
.audio-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.3rem;
    padding: 0.8rem 0.5rem;
    background: var(--bg-card);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.85rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.audio-btn:active { transform: scale(0.96); }
.audio-btn:hover { background: var(--bg-elevated); border-color: var(--fg-muted); }
.audio-btn-emoji { font-size: 1.4rem; line-height: 1; }
.audio-btn-cancel:hover { border-color: var(--error); color: var(--error); }
.audio-btn-pause:hover  { border-color: var(--secondary); color: var(--secondary); }
.audio-btn-finish {
    background: var(--accent); color: var(--accent-text); border-color: var(--accent);
}
.audio-btn-finish:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ============ Trips list ============ */
.trips-list {
    list-style: none; padding: 0; margin: 1.2rem 0;
    display: flex; flex-direction: column; gap: 0.7rem;
}
.trip-item {
    display: flex; align-items: stretch; gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s, transform 0.1s;
}
.trip-item:hover { border-color: var(--accent); }
.trip-main {
    flex: 1;
    display: flex; flex-direction: column; align-items: flex-start;
    text-align: left;
    padding: 1rem 1.2rem;
    background: transparent; color: var(--fg);
    border: none; cursor: pointer; font: inherit;
    gap: 0.2rem;
}
.trip-main:hover, .trip-main:focus-visible { background: var(--accent-soft); outline: none; }
.trip-main strong { font-size: 1.05rem; }
.trip-main small { color: var(--fg-muted); font-size: 0.8rem; }
.trip-item > .btn-icon {
    border-radius: 0; border: none;
    border-left: 1px solid var(--border);
    align-self: stretch; height: auto; width: 52px;
}

/* ============ Admin ============ */
#view-admin h3 {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.82rem;
    margin: 1.8rem 0 0.7rem;
    font-weight: 700;
}
.admin-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.admin-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    display: flex; justify-content: space-between; align-items: center;
    gap: 0.6rem;
}
.admin-item > div:first-child { min-width: 0; flex: 1; }
.admin-item strong { display: block; }
.admin-item small { color: var(--fg-muted); font-size: 0.78rem; display: block; margin-top: 0.1rem; }
.admin-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.btn-secondary, .btn-danger {
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-soft); color: var(--fg);
    font: inherit; font-size: 0.8rem; font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-secondary:hover { background: var(--secondary-soft); border-color: var(--secondary); color: var(--fg); }
.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }

.admin-form { margin: 0.5rem 0 1rem; max-width: none; }
.form-row {
    display: flex; gap: 0.5rem; align-items: stretch; flex-wrap: wrap;
}
.form-row input {
    flex: 1 1 160px;
    padding: 0.7rem 0.85rem;
    background: var(--bg-soft); color: var(--fg);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font: inherit; -webkit-appearance: none;
}
.form-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.form-row button {
    padding: 0.7rem 1.2rem;
    background: var(--accent); color: var(--accent-text);
    border: none; border-radius: var(--radius-sm);
    font: inherit; font-weight: 700; cursor: pointer;
}

/* ============================================================
   Profile view — avatar, surnom, mot de passe
   ============================================================ */

.btn-ghost {
    padding: 0.5rem 0.85rem;
    background: transparent; color: var(--fg-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit; font-size: 0.8rem; font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-ghost:hover { color: var(--error); border-color: var(--error); }

/* Hero : grand avatar centré + identité */
.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 2.2rem 1rem 1.8rem;
    margin: 0.5rem 0 1.8rem;
    background:
        radial-gradient(ellipse at top, var(--accent-soft) 0%, transparent 55%),
        radial-gradient(ellipse at bottom, var(--secondary-soft) 0%, transparent 60%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    text-align: center;
}

.profile-avatar-wrap {
    position: relative;
    width: 128px; height: 128px;
}
.profile-avatar {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--hue, 280) 70% 55%) 0%, hsl(var(--hue, 280) 60% 38%) 100%);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow: hidden;
    box-shadow:
        0 0 0 4px var(--bg),
        0 0 0 5px var(--border),
        0 18px 40px rgba(0, 0, 0, 0.45);
    user-select: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.profile-avatar-large { font-size: 2.6rem; }
.profile-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.profile-avatar-wrap:hover .profile-avatar { transform: translateY(-2px); }

.profile-avatar-edit {
    position: absolute;
    bottom: 2px; right: 2px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    border: 3px solid var(--bg);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, background 0.15s ease;
}
.profile-avatar-edit:hover { background: var(--accent-hover); transform: scale(1.06); }
.profile-avatar-edit:active { transform: scale(0.94); }
.profile-avatar-edit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.profile-identity {
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
    margin-top: 0.4rem;
}
.profile-name {
    font-size: 1.35rem;
    color: var(--fg);
    letter-spacing: -0.01em;
}
.profile-email {
    color: var(--fg-muted);
    font-size: 0.9rem;
}
.profile-provider-badge {
    margin-top: 0.4rem;
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--fg-muted);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.profile-avatar-actions {
    display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center;
    margin-top: 0.2rem;
}

/* Cards (surnom, mot de passe) */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem 1.3rem 1.2rem;
    margin: 0 0 1.2rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.profile-card:hover { border-color: var(--border); }
.profile-card-header { margin-bottom: 0.9rem; }
.profile-card-header h3 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    color: var(--fg);
    font-weight: 700;
    letter-spacing: -0.005em;
}
.profile-card-header p {
    margin: 0;
    color: var(--fg-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}
.profile-card-locked {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-soft) 100%);
    border-style: dashed;
}

.profile-form { gap: 0.6rem; max-width: none; }
.profile-form label {
    display: flex; flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--fg-muted);
}
.profile-form input {
    padding: 0.75rem 0.9rem;
    background: var(--bg-soft);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    -webkit-appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.profile-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.profile-form button[type=submit] {
    align-self: flex-start;
    margin-top: 0.25rem;
}
.profile-form .hint { text-align: left; }
.profile-form .hint.success { color: var(--success); }
.profile-form .hint.error { color: var(--error); }

#avatar-status.success { color: var(--success); }
#avatar-status.error { color: var(--error); }

@media (max-width: 480px) {
    .profile-hero { padding: 1.8rem 0.8rem 1.4rem; }
    .profile-avatar-wrap { width: 108px; height: 108px; }
    .profile-avatar-large { font-size: 2.2rem; }
    .profile-card { padding: 1.1rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .user-avatar-btn,
    .profile-avatar,
    .profile-avatar-edit { transition: none; }
}
