/* ============================================================
   TOTEN TONNEAU — Design System
   Dark-first, toggle .theme-light sur <html>
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,300;0,400;0,700;1,400&display=swap');

@font-face {
    font-family: 'Carolingia';
    src: url('/assets/font/carolingia/carolingia.woff2') format('woff2'),
         url('/assets/font/carolingia/carolingia.ttf') format('truetype');
    font-display: swap;
}

/* ===== Variables ===== */
:root {
    --admin-bar-height: 0px;
    --member-bar-height: 0px;

    /* Surfaces empilées (dark) */
    --surface-0: #000000;
    --surface-1: #111111;
    --surface-2: #1a1a1a;
    --surface-3: #222222;

    /* Accent */
    --color-accent: #900d0d;
    --color-accent-hover: #b01010;

    /* Texte */
    --color-text: #e8e8e8;
    --color-text-muted: #888888;
    --color-text-inverse: #000000;

    /* Bordures */
    --color-border: #2a2a2a;

    /* État */
    --color-danger: #c0392b;
    --color-success: #27ae60;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,.6);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.7);

    /* Divers */
    --radius: 6px;
    --radius-lg: 12px;
    --transition: .25s ease;
    --header-height: 60px;
}

/* ===== Light theme ===== */
.theme-light {
    --surface-0: #f8f9fb;
    --surface-1: #ffffff;
    --surface-2: #f0f0f2;
    --surface-3: #e4e4e8;
    --color-text: #1a1a1a;
    --color-text-muted: #666666;
    --color-text-inverse: #f8f9fb;
    --color-border: #d4d4d8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--admin-bar-height) + var(--header-height) + var(--member-bar-height)); }

body {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--surface-0);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

a { color: var(--color-accent-hover); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); }

img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.section {
    padding: 5rem 0;
}
.section--alt {
    background: var(--surface-1);
}
.section--alt-calendar {
    padding: 0;
    background: #000000;
}
.section__separator {
    width: 60px;
    height: 3px;
    background: var(--color-accent);
    border: none;
    margin: 1.25rem 0 2rem;
}

/* ===== Header / Nav ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(0,0,0,.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}
.theme-light .site-header {
    background: rgba(248,249,251,.92);
}

.site-header .container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 2rem;
}

.site-logo {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}
.site-logo a { color: inherit; display: flex; align-items: center; gap: .5rem; }
.site-logo a:hover { color: var(--color-accent); text-decoration: none; }
.theme-light .site-logo { color: #000; }
.site-logo img { height: 1.6rem; width: auto; display: block; }
.site-logo .logo-light { display: none; }
.theme-light .site-logo .logo-dark { display: none; }
.theme-light .site-logo .logo-light { display: block; }

.site-nav { display: flex; align-items: center; gap: .15rem; margin-left: auto; }
.site-nav--mobile { display: none; }
.site-nav a {
    color: rgba(255,255,255,.75);
    padding: .4rem .75rem;
    font-size: .9rem;
    letter-spacing: .04em;
    position: relative;
    transition: color var(--transition);
}
.site-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--transition), left var(--transition);
}
.site-nav a:hover { color: #fff; text-decoration: none; }
.site-nav a:hover::after { width: 100%; left: 0; }
.site-nav a.active { color: #fff; }
.site-nav a.active::after { width: 100%; left: 0; }
.theme-light .site-nav a { color: rgba(0,0,0,.6); }
.theme-light .site-nav a:hover,
.theme-light .site-nav a.active { color: #000; }

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition);
    flex-shrink: 0;
}
.theme-toggle:hover { color: var(--color-text); border-color: var(--color-text-muted); }

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: .25rem;
    margin-left: auto;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}
.hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0,0,0,.7) 0%,
        rgba(0,0,0,.4) 50%,
        rgba(0,0,0,.85) 100%
    );
    z-index: 1;
}
.hero__content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    padding: 0 1.5rem;
}
.hero__title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.1;
    margin-bottom: .75rem;
    text-shadow: 0 4px 20px rgba(0,0,0,.6);
}
.hero__subtitle {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: rgba(255,255,255,.7);
    font-weight: 300;
    font-style: italic;
    letter-spacing: .08em;
    margin-bottom: 2.5rem;
}
.hero__cta {
    display: inline-block;
    padding: .8rem 2.5rem;
    border: 2px solid var(--color-accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    transition: all var(--transition);
}
.hero__cta:hover {
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 0 25px rgba(144,13,13,.4);
}

/* ===== Grid 2 colonnes ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.grid-2--reverse > :first-child { order: 2; }
.grid-2--reverse > :last-child { order: 1; }

.grid-2__img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.grid-2__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.grid-2__img:hover img { transform: scale(1.03); }

/* ===== Cards ===== */
.card {
    background: var(--surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.card--flat:hover {
    transform: none;
    box-shadow: var(--shadow-md);
}

.card__icon {
    font-size: 1.5rem;
    margin-bottom: .75rem;
    color: var(--color-accent);
}
.card__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: .5rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.card__text {
    color: var(--color-text-muted);
    font-size: .95rem;
    line-height: 1.7;
}
.card__link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--color-accent-hover);
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: .04em;
}
.card__link:hover { color: var(--color-accent); }

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ===== Gallery grid ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.gallery-grid__item {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.gallery-grid__item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.gallery-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video embed responsive */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: .65rem 1.8rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: center;
    transition: all var(--transition);
}
.btn:hover {
    background: var(--color-accent-hover);
    text-decoration: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(144,13,13,.3);
}
.btn--outline {
    background: transparent;
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
}
.btn--outline:hover {
    background: var(--color-accent);
    color: #fff;
}
.btn--sm { padding: .35rem .9rem; font-size: .82rem; }
.btn--block { width: 100%; }

/* ===== Section headings ===== */
.section__title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    line-height: 1.2;
}
.section__subtitle {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    margin-top: .5rem;
    line-height: 1.7;
    white-space: pre-line;
}

/* ===== Documents list ===== */
.doc-list { list-style: none; }
.doc-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: background var(--transition);
}
.doc-list li:last-child { border-bottom: none; }
.doc-list li:hover { background: var(--surface-2); }
.doc-list li a { color: var(--color-text); font-weight: 400; }
.doc-list li a:hover { color: var(--color-accent); }
.doc-icon { font-size: 1.3rem; flex-shrink: 0; }
.doc-category {
    margin-left: auto;
    font-size: .78rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    margin-bottom: .4rem;
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .65rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1rem;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(144,13,13,.2);
}

/* Auth form */
.auth-wrap {
    max-width: 400px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--color-text);
}

/* ===== Admin bar ===== */
#admin-bar {
    background: var(--surface-2);
    color: var(--color-text);
    padding: .4rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .85rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--color-accent);
}

/* Quand la barre admin est visible, le header se décale */
body.has-admin-bar {
    --admin-bar-height: 40px;
}
body.has-admin-bar .site-header {
    top: var(--admin-bar-height);
}

/* ===== Member bar ===== */
.member-bar {
    position: sticky;
    top: calc(var(--admin-bar-height) + var(--header-height));
    z-index: 850;
    background: var(--surface-1);
    border-bottom: 2px solid var(--color-accent);
    height: 42px;
    display: none; /* affiché via JS */
}
.member-bar .container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0;
}
.member-nav {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.member-nav::-webkit-scrollbar { display: none; }

.member-nav a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1rem;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-text-muted);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; /* aligne la bordure sur celle du container */
    transition: color var(--transition), border-color var(--transition);
}
.member-nav a:hover { color: var(--color-text); text-decoration: none; }
.member-nav a.member-nav__home { font-style: italic; }
.member-nav a.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* Séparateur vertical entre liens */
.member-nav a + a {
    border-left: 1px solid var(--color-border);
}

/* Zone user droite */
.member-bar__user {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--color-border);
    height: 60%;
}
.member-bar__permission {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--color-accent);
    color: #fff;
    padding: .15rem .5rem;
    border-radius: 3px;
}
.member-bar__grades {
    display: flex;
    align-items: center;
    gap: .25rem;
}
.member-bar__grade {
    font-size: .65rem;
    font-weight: 700;
    text-transform: capitalize;
    color: var(--color-text-muted);
    background: var(--surface-2);
    border: 1px solid var(--color-border);
    padding: .1rem .4rem;
    border-radius: 3px;
    white-space: nowrap;
}
.member-bar__grade--more {
    cursor: default;
    letter-spacing: 0;
}
.member-bar__name {
    font-size: .82rem;
    color: var(--color-text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.member-bar__logout {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    padding-left: .75rem;
    border-left: 1px solid var(--color-border);
    transition: color var(--transition);
}
.member-bar__logout:hover { color: var(--color-accent); }

body.has-member-bar {
    --member-bar-height: 42px;
}

/* Light theme adjustments */
.theme-light .member-bar {
    background: var(--surface-0);
    border-top: 1px solid var(--color-border);
}

/* Responsive — member bar cachée sur mobile, liens injectés dans hamburger */
@media (max-width: 768px) {
    .member-bar { display: none !important; }
    body.has-member-bar { --member-bar-height: 0px; }
}

#nav-member-links { display: none; }

@media (max-width: 768px) {
    #nav-member-links { display: flex; flex-direction: column; width: 100%; }
    .nav-member-sep {
        padding: .75rem 0 .4rem;
        font-size: .7rem;
        font-weight: 700;
        font-style: italic;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--color-accent);
        border-bottom: 1px solid var(--color-border);
        margin-top: .25rem;
    }
}
#admin-bar button {
    background: var(--surface-3);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: .3rem .85rem;
    cursor: pointer;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: all var(--transition);
}
#admin-bar button:hover { background: var(--color-border); }
#admin-bar button.save {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
#admin-bar button.save:hover { background: var(--color-accent-hover); }
#admin-bar button.cancel { background: var(--surface-3); }

/* ===== Edit mode ===== */
[data-editable][contenteditable="true"] {
    outline: 2px dashed var(--color-accent);
    outline-offset: 4px;
    min-height: 1em;
    padding: 2px;
    border-radius: 2px;
}
[data-editable][contenteditable="true"]:focus {
    background: rgba(144,13,13,.08);
}

.replace-file-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .8rem;
    padding: .25rem .7rem;
    border: 1px dashed var(--color-accent);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--color-accent);
    background: transparent;
    font-family: 'Roboto Condensed', sans-serif;
}

/* ===== Alerts ===== */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert-error {
    background: rgba(192,57,43,.9);
    color: #ffffff;
    border: 1px solid rgba(192,57,43,.9);
}
.alert-success {
    background: rgba(39,174,96,.15);
    color: #2ecc71;
    border: 1px solid rgba(39,174,96,.3);
}

/* ===== Countdown ===== */
.countdown {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--radius);
}
.countdown::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 60px 30px var(--surface-1);
    pointer-events: none;
    z-index: 1;
}
.countdown__bg {
    display: block;
    width: 100%;
    height: auto;
}
.countdown__digits {
    position: absolute;
    top: 43%;
    left: 29%;
    right: 28%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.countdown__block { flex: 1; text-align: center; }
.countdown__number {
    display: block;
    font-family: 'Carolingia', 'Roboto Condensed', sans-serif;
    font-size: clamp(1.5rem, 6vw, 2.8rem);
    font-weight: 400;
    color: #213049;
    -webkit-text-stroke: 1px #253144;
    text-shadow: 0 2px 8px rgba(0,0,0,.7), 0 0 20px rgba(0,0,0,.4);
    line-height: 1;
}
.countdown__label {
    display: block;
    font-family: 'Carolingia', 'Roboto Condensed', sans-serif;
    font-size: clamp(.5rem, 1.5vw, .65rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #213049;
    -webkit-text-stroke: 1px #253144;
    text-shadow: 0 1px 4px rgba(0,0,0,.8);
    margin-top: -.75em;
}
.countdown__label__short {
    display: none;
}

@media (max-width: 768px) {
    .countdown__digits {
        left: 29%;
        right: 29%;
    }
    .countdown__label {
        display: none;
    }
    .countdown__label__short {
        display: block;
    }
}


/* ===== Contact avatar — forme bouclier ===== */

/* Couche bordure : même masque, fond rouge, légèrement plus grand */
.contact-avatar-border {
    width: 142px;
    height: 238px;
    margin: 0 auto 1.25rem;
    background: var(--color-accent);
    -webkit-mask-image: url(/api/resource?path=static/img/bouclier.svg);
    mask-image: url(/api/resource?path=static/img/bouclier.svg);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 8px 22px rgba(0,0,0,.65));
    transition: filter var(--transition), transform var(--transition);
}
.card:hover .contact-avatar-border {
    filter: drop-shadow(0 12px 28px rgba(0,0,0,.8));
    transform: scale(1.05) translateY(-4px);
}

#contact .card {
    display: flex;
    flex-direction: column;
}
.contact-email {
    margin-top: 2.5rem;
}
.contact-email__label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: .5rem;
    letter-spacing: .03em;
}
.contact-email__link {
    display: inline-block;
    font-size: 1rem;
    color: var(--color-accent);
    text-decoration: none;
    letter-spacing: .04em;
    transition: opacity .2s;
}
.contact-email__link:hover {
    opacity: .8;
    text-decoration: underline;
}
#contact .card__title{
  text-decoration-line: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
}

/* Couche image : même masque, légèrement plus petite */
.contact-avatar {
    width: 132px;
    height: 223px;
    -webkit-mask-image: url(/api/resource?path=static/img/bouclier.svg);
    mask-image: url(/api/resource?path=static/img/bouclier.svg);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    flex-shrink: 0;
}
.contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 15%;
    display: block;
}

.contact-avatar.norgrim img {
    object-position: 33%;
}

.contact-avatar.awen img {
    object-position: 86%;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 3px solid var(--color-accent);
    padding: 2rem 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: .85rem;
    background: var(--surface-1);
}
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-accent); }

/* ===== Bug Report ===== */
.bug-report-trigger {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .75rem;
    padding: .3rem .8rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-size: .78rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
}
.bug-report-trigger:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.br-previews {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
}
.br-preview-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--surface-3);
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}
.br-preview-item img,
.br-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.br-preview-item__remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,.65);
    border: none;
    color: #fff;
    font-size: .7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.br-error {
    color: var(--color-danger);
    font-size: .82rem;
    margin-top: .5rem;
    display: none;
}
.br-error:not(:empty) { display: block; }
.br-toast {
    position: fixed;
    top: .75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    background: var(--color-success, #3a7a1a);
    color: #fff;
    padding: .5rem 1.5rem;
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
    pointer-events: none;
    animation: brToastIn .2s ease-out, brToastOut .3s ease-in 2.7s forwards;
}
@keyframes brToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes brToastOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-accent { color: var(--color-accent); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .grid-2--reverse > :first-child { order: 0; }
    .grid-2--reverse > :last-child { order: 0; }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .section { padding: 3rem 0; }

    .hero { min-height: 80vh; }
    .hero__title { letter-spacing: .08em; }

    /* Mobile nav */
    .nav-toggle { display: block; }
    .site-nav--desktop { display: none; }
    .site-nav--mobile { display: flex; }

    .site-nav {
        position: fixed;
        right: 0;
        z-index: 899;
        width: 280px;
        height: calc(100vh - var(--header-height));
        height: calc(100dvh - var(--header-height));
        background: var(--surface-1);
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        gap: 0;
        transform: translateX(100%);
        transition: transform var(--transition);
        border-left: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .site-nav.open { transform: translateX(0); }
    .site-nav a {
        padding: .75rem 0;
        border-bottom: 1px solid var(--color-border);
        color: var(--color-text);
        font-size: 1rem;
    }
    .site-nav a:hover { color: var(--color-accent); }
    .site-nav a::after { display: none; }

    .theme-toggle { margin-top: .5rem; align-self: flex-start; }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .section { padding: 2.5rem 0; }
    .card { padding: 1.25rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ============================================================
   ASSOCIATION PAGE — Tabs, Carousel, Modal, Doc cards
   ============================================================ */

/* ===== Tabs ===== */
.assoc-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.assoc-tabs::-webkit-scrollbar { display: none; }

.assoc-tab {
    flex-shrink: 0;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: .85rem 1.5rem;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: .88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
}
.assoc-tab:hover { color: var(--color-text); }
.assoc-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* ===== Panels ===== */
.assoc-panel { display: none; position: relative; }
.assoc-panel.active { display: block; animation: panelFadeIn .3s ease; }

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Category sections within panels ===== */
.cat-section { margin-bottom: 2.5rem; }
.cat-section:last-of-type { margin-bottom: 0; }

.cat-section__title {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-text);
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.cat-section__title::before {
    content: '';
    width: 4px;
    height: 1.1em;
    background: var(--color-accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ===== News carousel ===== */
.news-carousel {
    position: relative;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.news-carousel__track {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: .5rem 0 1rem;
}
.news-carousel__track::-webkit-scrollbar { display: none; }

.news-card {
    flex: 0 0 calc(50% - 0.625rem);
    scroll-snap-align: start;
    background: var(--surface-2);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: default;
}
.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.news-card__date {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-accent);
    margin-bottom: .5rem;
    display: block;
}
.news-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .6rem;
    line-height: 1.3;
}
.news-card__content {
    font-size: .9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}
.news-card__content.expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
}
.news-card__toggle {
    display: inline-block;
    margin-top: .5rem;
    font-size: .82rem;
    font-weight: 700;
    color: var(--color-accent-hover);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}
.news-card__toggle:hover { color: var(--color-accent); }

/* 1 seule carte → centrée */
.news-carousel__track.single {
    justify-content: center;
}

/* ── Carte actualité style home-latest dans le carrousel ─── */
.news-carousel__track .home-latest {
    flex: 0 0 calc(50% - 0.625rem);
    scroll-snap-align: start;
    display: block;
    text-decoration: none;
    color: inherit;
}
@media (max-width: 640px) {
    .news-carousel__track .home-latest { flex: 0 0 85vw; }
}
@media (max-width: 480px) {
    .news-carousel__track .home-latest { flex: 0 0 92vw; }
}

/* ── home-latest : carte actualité partagée ──────────────── */
.home-latest {
    display: block;
    background: var(--surface-1);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.home-latest:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--color-accent-hover);
    color: inherit;
}
.home-latest__meta {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .65rem;
    flex-wrap: wrap;
}
.home-latest__source {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: .18rem .55rem;
    border-radius: 3px;
    background: rgba(144,13,13,.18);
    color: #c0392b;
    border: 1px solid rgba(144,13,13,.3);
}
.home-latest__date {
    font-size: .75rem;
    color: var(--color-text-muted);
}
.home-latest__title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .015em;
    color: var(--color-text);
    margin-bottom: .4rem;
    line-height: 1.3;
}
.home-latest__excerpt {
    font-size: .85rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.home-latest__cta {
    margin-top: .85rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--color-accent);
}
/* Skeleton */
.home-latest--loading .home-latest__title,
.home-latest--loading .home-latest__excerpt,
.home-latest--loading .home-latest__source,
.home-latest--loading .home-latest__date,
.home-latest--loading .home-latest__cta {
    background: var(--surface-3);
    border-radius: 4px;
    color: transparent !important;
    border-color: transparent !important;
    animation: shimmer 1.6s ease-in-out infinite;
    user-select: none;
    pointer-events: none;
}
@keyframes shimmer {
    0%, 100% { opacity: .55; }
    50%       { opacity: 1; }
}
/* Aucune actu */
.home-no-news {
    background: var(--surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    color: var(--color-text-muted);
    font-size: .88rem;
    text-align: center;
}

/* Carousel arrows */
.news-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--surface-1);
    color: var(--color-text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    opacity: 0;
}
.news-carousel:hover .news-carousel__arrow { opacity: 1; }
.news-carousel__arrow:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.news-carousel__arrow--prev { left: 0; }
.news-carousel__arrow--next { right: 0; }

/* Carousel dots */
.news-carousel__dots {
    display: flex;
    justify-content: center;
    gap: .4rem;
    margin-top: .5rem;
}
.news-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--color-border);
    cursor: pointer;
    padding: 0;
    transition: background var(--transition), transform var(--transition);
}
.news-carousel__dot.active {
    background: var(--color-accent);
    transform: scale(1.3);
}

/* ===== Document cards ===== */
.doc-grid {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.doc-card {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: background var(--transition), box-shadow var(--transition);
}
.doc-card:hover {
    background: var(--surface-3);
    box-shadow: var(--shadow-sm);
}

.doc-card__icon {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(144,13,13,.1);
    border-radius: var(--radius);
    flex-shrink: 0;
    align-self: flex-start;
}

.doc-card__body {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
}

.doc-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.doc-card__name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.25;
}

.doc-card__date {
    font-style: italic;
    font-size: .72rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: .25rem;
}

.doc-card__desc {
    font-size: .82rem;
    color: var(--color-text-muted);
}

.doc-card__meta {
    font-size: .78rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.doc-card__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: .15rem;
}

.doc-card__delete {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition);
}
.doc-card__delete:hover {
    background: var(--color-danger);
    color: #fff;
}

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    font-size: .92rem;
    padding: 2.5rem 1rem;
    font-style: italic;
}

/* ===== FAB (floating add button) ===== */
.fab-add {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--color-accent);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    z-index: 10;
}
.fab-add:hover {
    background: var(--color-accent-hover);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalOverlayIn .2s ease;
}
@keyframes modalOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: var(--surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalBoxIn .25s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--color-text-muted) var(--surface-2);
}
.modal-box::-webkit-scrollbar { width: 6px; }
.modal-box::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.modal-box::-webkit-scrollbar-thumb { background: var(--color-text-muted); border-radius: 3px; }
.modal-box::-webkit-scrollbar-thumb:hover { background: var(--color-text); }
@keyframes modalBoxIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-box__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}
.modal-box__header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.modal-box__close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition);
}
.modal-box__close:hover { color: var(--color-danger); }

.modal-box__body { padding: 1.5rem; }

.modal-box__footer {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
}

/* ===== Section header avec bouton aligné à droite ===== */
.page-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-section-header > div { flex: 1; }
.fab-inline { flex-shrink: 0; margin-top: .3rem; }

/* ===== Ancres de navigation rapide ===== */
.page-anchors {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .75rem;
}
.page-anchors a {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    padding: .3rem .7rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    transition: all var(--transition);
}
.page-anchors a:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    text-decoration: none;
}

/* ============================================================
   COMMITTEE PAGE — Gestion membres, documents, médias
   ============================================================ */

/* ===== Filter bar ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.filter-bar select {
    padding: .4rem .75rem;
    background: var(--surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: 'Roboto Condensed', sans-serif;
    font-size: .88rem;
    cursor: pointer;
    transition: border-color var(--transition);
}
.filter-bar select:focus {
    outline: none;
    border-color: var(--color-accent);
}
.filter-bar__count {
    font-size: .8rem;
    color: var(--color-text-muted);
    margin-left: auto;
}

/* ===== Management table (membres, documents) ===== */
.mgmt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.mgmt-table th {
    text-align: left;
    padding: .55rem 1rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}
.mgmt-table td {
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.mgmt-table tr:last-child td { border-bottom: none; }
.mgmt-table tr:hover td { background: var(--surface-2); }
.mgmt-table__name { font-weight: 700; }
.mgmt-table__email { color: var(--color-text-muted); font-size: .85rem; }
.mgmt-table__date  { color: var(--color-text-muted); font-size: .82rem; white-space: nowrap; }
.mgmt-table__actions { display: flex; align-items: center; gap: .4rem; justify-content: flex-end; }

/* Permission select inline */
.permission-select {
    padding: .25rem .5rem;
    background: var(--surface-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: 'Roboto Condensed', sans-serif;
    font-size: .8rem;
    cursor: pointer;
}
.permission-select:focus { outline: none; border-color: var(--color-accent); }

/* Badges de permission */
.permission-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.permission-badge--member    { background: var(--surface-3); color: var(--color-text-muted); }
.permission-badge--auxiliere { background: rgba(180,140,60,.18); color: #b48c3c; }
.permission-badge--first     { background: var(--surface-3); color: var(--color-text-muted); }
.permission-badge--graveur   { background: rgba(46,204,113,.15); color: #27ae60; }
.permission-badge--chroniqueur { background: rgba(155,89,182,.15); color: #8e44ad; }
.permission-badge--collecteur  { background: rgba(230,126,34,.15); color: #d35400; }
.permission-badge--committee { background: rgba(52,152,219,.2); color: #3498db; }
.permission-badge--admin     { background: rgba(144,13,13,.2); color: var(--color-accent-hover); }

/* Badge générique (type, catégorie, étiquette) */
.type-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--surface-3);
    color: var(--color-text-muted);
}

/* Grades */
.grade-badge {
    display: inline-block;
    padding: .12rem .45rem;
    border-radius: 3px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: rgba(240,180,41,.15);
    color: #c8890a;
}
.grade-picker { position: relative; display: inline-block; }
.grade-picker summary { list-style: none; }
.grade-picker summary::-webkit-details-marker { display: none; }
.grade-picker__trigger { position: relative; }
.grade-picker__trigger .grade-picker__dot {
    position: absolute;
    top: 3px; right: 3px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #c8890a;
    pointer-events: none;
}
.grade-picker__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    z-index: 300;
    background: var(--surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: .5rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 210px;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.grade-picker__cat { display: flex; flex-direction: column; gap: .25rem; }
.grade-picker__cat-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-muted); }
.grade-picker__pills { display: flex; flex-wrap: wrap; gap: .25rem; }
.grade-picker__sep { border: none; border-top: 1px solid var(--color-border); margin: .05rem 0; }
.grade-picker__footer { display: flex; justify-content: flex-end; margin-top: .1rem; }
.grade-pill {
    padding: .1rem .4rem;
    border-radius: 3px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
    border: 1px solid var(--color-border);
    background: var(--surface-2);
    color: var(--color-text-muted);
    transition: all .15s;
    line-height: 1.5;
}
.grade-pill.active { background: rgba(240,180,41,.2); color: #c8890a; border-color: #c8890a; }
.grade-pill:hover  { background: var(--surface-3); color: var(--color-text); }
.grade-pill.active:hover { background: rgba(240,180,41,.3); }

/* Petits boutons d'action */
.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--surface-3); color: var(--color-text); }
.btn-icon--danger:hover { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-icon--save:hover   { background: var(--color-success); color: #fff; border-color: var(--color-success); }

/* ===== Section tabs (Photos / Vidéos) ===== */
.section-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
}
.section-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: .65rem 1.25rem;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.section-tab:hover { color: var(--color-text); }
.section-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}
.section-tab-panel { display: none; }
.section-tab-panel.active { display: block; animation: panelFadeIn .25s ease; }

/* ===== Media management grid (photos) ===== */
.media-mgmt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .75rem;
}
.media-mgmt-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--surface-2);
    box-shadow: var(--shadow-sm);
}
.media-mgmt-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.media-mgmt-item:hover img { transform: scale(1.04); }
.media-mgmt-item__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    opacity: 0;
    transition: opacity var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem;
}
.media-mgmt-item:hover .media-mgmt-item__overlay { opacity: 1; }
.media-mgmt-item__caption {
    font-size: .72rem;
    color: rgba(255,255,255,.85);
    text-align: center;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
}
.media-mgmt-item__delete {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(192,57,43,.8);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.media-mgmt-item__delete:hover { background: var(--color-danger); }

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    margin-bottom: 1rem;
}
.upload-zone:hover {
    border-color: var(--color-accent);
    background: rgba(144,13,13,.04);
}
.upload-zone__icon { font-size: 2rem; margin-bottom: .5rem; }
.upload-zone__text { font-size: .9rem; }
.upload-zone__hint { font-size: .78rem; margin-top: .25rem; }

/* ===== Video management cards ===== */
.video-mgmt-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: .85rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: .6rem;
    transition: background var(--transition);
}
.video-mgmt-card:hover { background: var(--surface-3); }
.video-mgmt-thumb {
    width: 100px;
    height: 60px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-3);
}
.video-mgmt-thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-text-muted);
}
.video-mgmt-info { flex: 1; min-width: 0; }
.video-mgmt-title {
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.video-mgmt-desc {
    font-size: .82rem;
    color: var(--color-text-muted);
    margin-top: .15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.video-mgmt-link {
    font-size: .75rem;
    color: var(--color-text-muted);
    margin-top: .1rem;
}
.video-mgmt-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* Progress bar upload */
.upload-progress {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    margin-top: .5rem;
    overflow: hidden;
}
.upload-progress__bar {
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    width: 0%;
    transition: width .3s ease;
}

/* ===== Association page responsive ===== */
@media (max-width: 768px) {
    .assoc-tabs { gap: 0; }
    .assoc-tab { padding: .7rem 1rem; font-size: .78rem; }

    .news-card { flex: 0 0 85vw; }
    .news-carousel__track.single { justify-content: center; }

    .news-carousel__arrow { display: none; }

    .fab-add {
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

@media (max-width: 480px) {
    .news-card { flex: 0 0 92vw; padding: 1.1rem; }
    .doc-card { flex-wrap: wrap; gap: .6rem; padding: .75rem; }
    .doc-card__info { min-width: calc(100% - 60px); }
}

/* ═══════════════════════════════════════════════════════
   QUEST JOURNAL
   ═══════════════════════════════════════════════════════ */

/* ── Beacon ──────────────────────────────────────────── */
.quest-beacon {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 900;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    cursor: pointer;
    transition: width .2s, height .2s, box-shadow .2s;
    user-select: none;
}
.quest-beacon img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 50%; }
@keyframes beacon-slide-in {
    from { right: -180px; opacity: 0; }
    to   { right: 1rem;   opacity: 1; }
}
.quest-beacon { animation: beacon-slide-in .45s cubic-bezier(.22,.68,0,1.2); }
.quest-beacon:hover { height: 180px; cursor: url('/api/resource?path=static/img/quest_cursor.png'), pointer; }
.quest-beacon.pulse::before {
    content: '';
    position: absolute;
    bottom: 65%;
    left: 47%;
    transform: translateX(-50%);
    width: 14%;
    height: 60px;
    background: radial-gradient(ellipse at bottom, rgba(200,170,110,.7) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse-up 2s infinite;
    pointer-events: none;
}
@keyframes pulse-up {
    0%, 100% { opacity: 0;   transform: translateX(-50%) scaleX(1);   }
    50%      { opacity: 1;   transform: translateX(-50%) scaleX(1.4);  }
}
.has-member-bar .quest-beacon { top: 130px; }
.has-admin-bar.has-member-bar .quest-beacon { top: 170px; }

/* ── Panel (parchment slide-in) ──────────────────────── */
.quest-panel {
    position: fixed;
    top: 0; right: 0;
    width: 400px;
    max-width: 92vw;
    height: 100vh;
    z-index: 950;
    background: linear-gradient(160deg, #d4a574 0%, #c4956a 30%, #b8875c 60%, #d4a574 100%);
    color: #3a2a1a;
    transform: translateX(105%);
    transition: transform .35s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0,0,0,.5);
}
.quest-panel.open { transform: translateX(0); }

.quest-panel__header {
    padding: 2rem 1.25rem 1rem;
    border-bottom: 2px solid rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.quest-panel__title {
    font-family: 'Carolingia', serif;
    font-size: 1.6rem;
    margin: 0;
    color: #2a1a0a;
}
.quest-panel__close {
    background: none; border: none;
    font-size: 1.5rem; cursor: pointer;
    color: #5a3a1a; padding: .25rem;
}
.quest-panel__close:hover { color: #2a1a0a; }

.quest-panel__snooze {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,.1);
    background: rgba(0,0,0,.05);
    font-size: .78rem;
    color: #4a3020;
    margin-bottom: 0.75rem;
}
.quest-panel__snooze label {
    white-space: nowrap;
}
.quest-panel__snooze select {
    padding: .2rem .3rem;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 4px;
    background: rgba(255,255,255,.4);
    color: #3a2a1a;
    font-size: .78rem;
    cursor: pointer;
}
.quest-panel__snooze .btn--sm {
    padding: .2rem .6rem;
    font-size: .75rem;
    border-radius: 4px;
    white-space: nowrap;
}

.quest-panel__body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 5rem;
}
.quest-panel__back {
    background: none; border: none;
    padding: 0 0.75rem 0.75rem 0.75rem;
    color: #5a3a1a; cursor: pointer;
    font-size: .9rem;
    display: inline-flex; align-items: center; gap: .3rem;
}
.quest-panel__back:hover { color: #2a1a0a; }

/* ── Quest list items ────────────────────────────────── */
.quest-item {
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: .75rem;
    cursor: pointer;
    transition: background .15s;
}
.quest-item:hover { background: rgba(255,255,255,.35); }
.quest-item__title {
    font-family: 'Carolingia', serif;
    font-size: 1.2rem;
    margin: 0 0 .35rem;
    color: #2a1a0a;
}
.quest-item__desc {
    font-size: .85rem;
    margin: 0 0 .6rem;
    color: #4a3020;
    line-height: 1.3;
}
.quest-item__progress {
    display: flex; align-items: center; gap: .5rem;
    font-size: .8rem; color: #5a3a1a;
}
.quest-item__bar {
    flex: 1; height: 6px;
    background: rgba(0,0,0,.15);
    border-radius: 3px; overflow: hidden;
}
.quest-item__bar-fill {
    height: 100%;
    background: #5a8a3a;
    border-radius: 3px;
    transition: width .3s;
}

/* ── Quest detail title/desc ─────────────────────── */
.quest-detail__title {
    font-family: 'Carolingia', serif;
    font-size: 1.3rem; color: #2a1a0a;
    margin: 0 0 .5rem; line-height: 1.3;
    padding: 0.75rem;
}
.quest-detail__desc { padding: 0 .75rem; font-size: .85rem; color: #4a3020; margin: 0 0 1rem; line-height: 1.4; }

/* ── Quest step card (mobile-first) ─────────────── */
.quest-step {
    display: flex; flex-direction: column; gap: .35rem;
    margin-bottom: .65rem; padding: .7rem .75rem;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(0,0,0,.1);
}
.quest-step.locked { opacity: .45; pointer-events: none; }
.quest-step__head {
    display: flex; align-items: center; gap: .45rem;
}
.quest-step__num {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .75rem; flex-shrink: 0;
    background: rgba(0,0,0,.15); color: #3a2a1a;
}
.quest-step__num.validated { background: #5a8a3a; color: #fff; }
.quest-step__num.submitted { background: #4a7aaa; color: #fff; }
.quest-step__num.rejected  { background: #aa4a4a; color: #fff; }
.quest-step__num.pending   { background: #aa8a3a; color: #fff; }
.quest-step__num.refused     { background: #7a4a7a; color: #fff; }
.quest-step__num.ineligible  { background: #6a6a6a; color: #d0d0d0; }
.quest-step__body { width: 100%; min-width: 0; }
.quest-step__title { font-weight: 700; font-size: .93rem; margin: 0 0 .15rem; color: #2a1a0a; line-height: 1.3; }
.quest-step__desc  { font-size: .81rem; color: #4a3020; margin: 0 0 .35rem; line-height: 1.4; }
.quest-step__deadline { font-size: .73rem; color: #7a4a2a; font-style: italic; margin-bottom: .25rem; }
.quest-step__xp {
    display: inline-block; margin-left: .3rem; padding: .05rem .45rem;
    font-size: .7rem; font-weight: 700; color: #6a4a0a;
    background: linear-gradient(180deg, #f0d68a, #c89c3a);
    border: 1px solid #8a6a1a; border-radius: 10px; vertical-align: middle;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.quest-step__guide { margin: .3rem 0 0; font-size: .8rem; }
.quest-step__guide a { color: #3a5a8a; text-decoration: none; }
.quest-step__guide a:hover { text-decoration: underline; }
.quest-step__status {
    display: inline-block; font-size: .68rem; padding: .12rem .45rem;
    border-radius: 3px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em;
}
.status-locked    { background: #8a8a8a; color: #fff; }
.status-pending   { background: #c0952a; color: #fff; }
.status-submitted { background: #4a7aaa; color: #fff; }
.status-validated { background: #5a8a3a; color: #fff; }
.status-rejected  { background: #aa4a4a; color: #fff; }
.status-refused    { background: #7a4a7a; color: #fff; }
.status-ineligible    { background: #5a5a5a; color: #e0e0e0; font-style: italic; }
.status-not_evaluated { background: #9ca3af; color: #fff; font-style: italic; }

/* ── Step form ──────────────────────────────────── */
.step-form {
    margin-top: .55rem;
}
.step-form .note { font-size: .75rem; color: #7a4a2a; font-style: italic; margin: .3rem 0 0; }
.step-form__choices { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .55rem; }
.step-form__choices label { display: flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .87rem; color: #3a2a1a; font-weight: 400; }
.step-form__choices input[type="radio"] { accent-color: #5a8a3a; }
.step-form__fields { display: flex; flex-direction: column; gap: .55rem; margin-bottom: .55rem; width: 100%; }
.step-form__field-group {
    padding: .55rem .65rem;
    background: rgba(255,255,255,.15); border-radius: 5px;
    border-left: 2px solid rgba(90,60,20,.25);
}
.step-form__field-group label { display: block; font-size: .88rem; font-weight: 700; color: #2a1a0a; margin-bottom: .2rem; }
.step-form__field-desc { font-size: .78rem; color: #4a3020; font-style: italic; margin: .1rem 0 .3rem; line-height: 1.3; }
.step-form__instr-img { max-width: 100%; border-radius: 4px; margin: .2rem 0 .5rem; display: block; }
.step-form__required { color: #aa4a4a; font-size: .85em; }
.step-form input[type="file"] { font-size: .82rem; margin-bottom: .4rem; color: #3a2a1a; width: 100%; }
.step-form__fields input,
.step-form__fields select,
.step-form__fields textarea {
    width: 100%; box-sizing: border-box; padding: .5rem .6rem; min-height: 40px;
    border: 1px solid rgba(0,0,0,.22); border-radius: 5px;
    background: rgba(255,255,255,.55); font-size: .87rem; color: #3a2a1a;
    font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.step-form__fields input:focus,
.step-form__fields select:focus,
.step-form__fields textarea:focus {
    outline: none; border-color: #5a8a3a; box-shadow: 0 0 0 2px rgba(90,138,58,.2);
}
.step-form__fields textarea { resize: vertical; min-height: 72px; }
.step-form .btn { font-size: .83rem; padding: .42rem .85rem; background: #5a8a3a; border: none; color: #fff; border-radius: 5px; cursor: pointer; transition: background .15s; margin-top: .2rem; }
.step-form .btn:hover { background: #4a7a2a; }
.step-form .btn--confirm {margin-right: 1rem;}
.step-form .btn--refuse, .quest-panel .btn--refuse {
    background: transparent; color: #8a3a1a; border: 1px solid #8a3a1a;
    font-size: .8rem; padding: .32rem .7rem; margin-top: .35rem;
    border-radius: 5px; cursor: pointer; transition: background .15s, color .15s; display: inline-block;
}
.step-form .btn--refuse:hover, .quest-panel .btn--refuse:hover { background: #8a3a1a; color: #fff; }
/* ── Conditional field groups ──────────────────────── */
.step-form__field-group--hidden { display: none; }
.step-form__field-group--visible { display: block; }

/* Titre de section dans les formulaires de quête */
.step-form__section-title {
    font-weight: 700; font-size: .83rem; color: #3a2010;
    padding: .35rem 0 .28rem;
    border-bottom: 2px solid rgba(160,100,30,.35);
    margin: .5rem 0 .05rem;
}

/* Premier rang de conditions : pas d'opérateur de jonction */
.field-conditions-list .field-cond-row:first-child .field-cond-join { display: none; }

/* ── Quest matrix (committee dashboard) ──────────────── */
.quest-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    overflow-x: auto;
    display: block;
}
.quest-matrix th,
.quest-matrix td {
    padding: .5rem .6rem;
    border: 1px solid var(--color-border);
    text-align: center;
    white-space: nowrap;
}
.quest-matrix th {
    background: var(--color-card);
    font-weight: 600;
    position: sticky;
    top: 0;
}
.quest-matrix th:first-child,
.quest-matrix td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--color-card);
    z-index: 1;
}
.quest-matrix td .quest-step__status {
    cursor: pointer;
    font-size: .65rem;
    padding: .1rem .4rem;
}

/* ── Tableau données formulaires ─────────────────────── */
.qd-table th,
.qd-table td { text-align: left; white-space: normal; } /*TODO : J'ai enlever max-widht : 240px*/
.qd-table th:first-child,
.qd-table td:first-child { text-align: left; background-color: var(--surface-1); border-left: 0;}
.qd-th { user-select: none; }
.qd-th:hover { background: rgba(0,0,0,.06); }
.qd-th--sorted { background: rgba(170,138,58,.15); }
.qd-row--empty td { color: #aaa; font-style: italic; }
.qd-cell--empty { color: #bbb; font-style: italic; }

/* ── Scrollbar horizontale collante (quest-matrix/qd-table) ─ */
.matrix-wrapper {
    position: relative;
}
.matrix-scroll-table {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.matrix-scroll-table::-webkit-scrollbar {
    display: none;
}
.matrix-sticky-scrollbar {
    position: sticky;
    bottom: 0;
    overflow-x: auto;
    overflow-y: hidden;
    height: 12px;
    z-index: 5;
    background: var(--surface-2);
    border-top: 1px solid var(--color-border);
    scrollbar-color: var(--color-text-muted) var(--surface-2);
    scrollbar-width: thin;
}
.matrix-sticky-scrollbar::-webkit-scrollbar {
    height: 12px;
}
.matrix-sticky-scrollbar::-webkit-scrollbar-track {
    background: var(--surface-2);
}
.matrix-sticky-scrollbar::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: 6px;
    border: 3px solid var(--surface-2);
}
.matrix-sticky-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}
.matrix-sticky-scrollbar__inner {
    height: 1px;
}
[data-matrix-edit] { cursor: pointer; }
[data-matrix-edit]:hover { outline: 1px dashed #b8963e; background: rgba(184, 150, 62, 0.06); border-radius: 2px; }
.matrix-export-bar {
    display: flex;
    justify-content: flex-end;
    padding-bottom: .5rem;
}

/* ── Panel overlay ───────────────────────────────────── */
.quest-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 940;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.quest-overlay.open { opacity: 1; pointer-events: auto; }

/* ── Avatar cropper ──────────────────────────────────── */
#crop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
#crop-modal {
    background: var(--surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .9rem;
}
.theme-light #crop-overlay {
    background: rgba(0,0,0,.5);
}
.theme-light #crop-mask {
    box-shadow: 0 0 0 9999px rgba(0,0,0,.3);
}
#crop-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-text);
}
#crop-viewport {
    position: relative;
    width: 280px;
    height: 280px;
    overflow: hidden;
    border-radius: 50%;
    background: #111;
    cursor: grab;
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}
#crop-viewport:active { cursor: grabbing; }
#crop-img {
    position: absolute;
    top: 0; left: 0;
    max-width: none;
    max-height: none;
    pointer-events: none;
    will-change: width, height, left, top;
}
#crop-mask {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
    pointer-events: none;
    z-index: 1;
}
#crop-controls {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
}
#crop-zoom {
    flex: 1;
    accent-color: var(--color-accent);
}
#crop-hint {
    font-size: .78rem;
    color: var(--color-text-muted);
    margin: 0;
    text-align: center;
}
#crop-actions {
    display: flex;
    gap: .75rem;
    width: 100%;
}
#crop-actions .btn {
    flex: 1;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .quest-beacon,
    .has-member-bar .quest-beacon,
    .has-admin-bar.has-member-bar .quest-beacon {
        width: 100px;
        height: 100px;
        animation: none;
    }
    .quest-panel { width: 100vw; max-width: 100vw; }
    .quest-panel__title { font-size: 1.3rem; }
}
/* ── RichInput toolbar ───────────────────────────────── */
.rich-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px 5px;
    background: var(--surface-2, #2a2a2a);
    border: 1px solid var(--color-border, #444);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}
.rich-toolbar__btn {
    width: 28px; height: 28px;
    border: none; background: transparent;
    border-radius: 4px; cursor: pointer;
    color: var(--color-text, #eee);
    font-size: .88rem;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.rich-toolbar__btn--wiki, .rich-toolbar__btn--lex{
    padding: 0px 1rem;
}
.rich-toolbar__btn:hover { background: var(--surface-3, #3a3a3a); }
.rich-toolbar__sep { 
    width: 1px; height: 18px; background: var(--color-border, #444);   
    margin: 0 2px; 
}
.rich-input-area--active {
    border: 1px solid var(--color-border, #444);
    border-radius: 0 0 4px 4px;
    padding: .5rem .6rem;
    min-height: 6rem;
    outline: none;
    background: var(--surface-1, #1a1a1a);
    color: var(--color-text, #eee);
    font-size: .92rem;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
    cursor: text;
}
.rich-input-area--active:focus { border-color: var(--color-accent, #c09050); }

/* ===== Avatar component ===== */
.avatar {
    --av-size: 40px;
    --av-border: var(--color-border);
    --av-frame-outset: 0px;      /* extension du cadre au-delà du container */
    --av-frame-photo-inset: 0px; /* rétrécissement de la photo à l'intérieur */

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--av-size);
    height: var(--av-size);
    flex-shrink: 0;
    border: 2px solid var(--av-border);
    background: var(--surface-3);
    border-radius: 50%;
    overflow: hidden;
    box-sizing: border-box;
}
.avatar--square { border-radius: var(--radius); }
.avatar--has-frame { overflow: visible; border-color: transparent; background: none;}
.avatar--has-badge { overflow: visible; }

.avatar__photo {
    display: block;
    width: calc(var(--av-size) - 4px);
    height: calc(var(--av-size) - 4px);
    object-fit: cover;
    border-radius: inherit;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar--has-frame .avatar__photo {
    width: calc(var(--av-size) - 2 * var(--av-frame-photo-inset));
    height: calc(var(--av-size) - 2 * var(--av-frame-photo-inset));
}
.avatar__photo--ph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--av-size) * 0.28);
    font-weight: 700;
    color: var(--color-text-muted);
    letter-spacing: .04em;
    background: var(--surface-3);
    user-select: none;
}
.avatar__frame {
    position: absolute;
    inset: calc(-1 * var(--av-frame-outset));
    width: calc(var(--av-size) + 2 * var(--av-frame-outset));
    height: calc(var(--av-size) + 2 * var(--av-frame-outset));
    object-fit: contain;
    max-width: none;
    pointer-events: none;
    z-index: 1;
    border-radius: 0;
    transform: translate(calc(var(--av-size) * var(--av-frame-offset-x, 0)), calc(var(--av-size) * var(--av-frame-offset-y, 0)));
}
.avatar__badge {
    position: absolute;
    object-fit: contain;
    pointer-events: none;
    z-index: 3;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.7));
}

.avatar__badge--br {
    bottom: calc(var(--av-size) * -0.20);
    right:  calc(var(--av-size) * -0.31);
    width:  calc(var(--av-size) * 0.58 * var(--av-badge-br-scale, 1));
    height: calc(var(--av-size) * 0.58 * var(--av-badge-br-scale, 1));
    transform: translate(calc(var(--av-size) * var(--av-badge-br-offset-x, 0)), calc(var(--av-size) * var(--av-badge-br-offset-y, 0)));
}

.avatar__badge--bl {
    bottom: calc(var(--av-size) * -0.20);
    left:   calc(var(--av-size) * -0.31);
    width:  calc(var(--av-size) * 0.58 * var(--av-badge-bl-scale, 1));
    height: calc(var(--av-size) * 0.58 * var(--av-badge-bl-scale, 1));
    transform: translate(calc(var(--av-size) * var(--av-badge-bl-offset-x, 0)), calc(var(--av-size) * var(--av-badge-bl-offset-y, 0)));
}

.avatar__badge--tr {
    top:   calc(var(--av-size) * -0.20);
    right: calc(var(--av-size) * -0.31);
    width:  calc(var(--av-size) * 0.58 * var(--av-badge-tr-scale, 1));
    height: calc(var(--av-size) * 0.58 * var(--av-badge-tr-scale, 1));
    transform: translate(calc(var(--av-size) * var(--av-badge-tr-offset-x, 0)), calc(var(--av-size) * var(--av-badge-tr-offset-y, 0)));
}

.avatar__badge--tl {
    top:  calc(var(--av-size) * -0.20);
    left: calc(var(--av-size) * -0.31);
    width:  calc(var(--av-size) * 0.58 * var(--av-badge-tl-scale, 1));
    height: calc(var(--av-size) * 0.58 * var(--av-badge-tl-scale, 1));
    transform: translate(calc(var(--av-size) * var(--av-badge-tl-offset-x, 0)), calc(var(--av-size) * var(--av-badge-tl-offset-y, 0)));
}

/* .app-nav est cachée par défaut — les styles sont dans app.css (chargé uniquement en mode app) */
.app-nav { display: none; }

/* ── Notifications : cloche & badge ──────────────────────────────────── */
.member-bar__bell {
    position: relative;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: .3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color .18s, background .18s;
}
.member-bar__bell:hover {
    color: var(--color-text);
    background: var(--surface-2);
}
.member-bar__bell-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    background: #cc1111;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}
.member-bar__bell-badge[hidden] { display: none; }

/* ── Notifications : panneau slide-over ─────────────────────────────── */
.notif-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, 100vw);
    background: var(--surface-1);
    border-left: 1px solid var(--color-border);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: -4px 0 24px rgba(0,0,0,.18);
}
.notif-panel.is-open {
    transform: translateX(0);
}
.notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 8999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s;
}
.notif-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.notif-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
.notif-panel__title {
    font-size: .88rem;
    font-weight: 600;
    color: var(--color-text);
}
.notif-panel__actions {
    display: flex;
    gap: .5rem;
    align-items: center;
}
.notif-panel__btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: .25rem;
    border-radius: 4px;
    font-size: .78rem;
    transition: color .15s;
}
.notif-panel__btn:hover { color: var(--color-text); }
.notif-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: .5rem 0;
}
.notif-section__lbl {
    font-size: .67rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--color-text-muted);
    padding: .6rem 1rem .3rem;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background .12s;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item--unread { background: rgba(var(--color-accent-rgb, 139,105,20), .06); }
.notif-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cc1111;
    flex-shrink: 0;
    margin-top: .35rem;
}
.notif-item__dot--read { background: transparent; border: 1px solid var(--color-border); }
.notif-item__body { flex: 1; min-width: 0; }
.notif-item__title { font-size: .8rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: .1rem; }
.notif-item__text { font-size: .85rem; color: var(--color-text); line-height: 1.35; }
.notif-item__date { font-size: .7rem; color: var(--color-text-muted); margin-top: .2rem; }
.notif-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-size: .83rem;
    padding: 2rem 1rem;
}
