:root {
    color-scheme: dark;
    --background: #090b16;
    --surface: rgba(22, 25, 48, 0.9);
    --surface-strong: #1b1f3b;
    --border: rgba(255, 255, 255, 0.12);
    --text: #f6f7ff;
    --muted: #aeb4d2;
    --primary-a: #8d5cff;
    --primary-b: #36a9ff;
    --danger: #ff6e85;
    --success: #64d7a5;
    --warning: #ffcc6a;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background:
        radial-gradient(circle at 15% 15%, rgba(141, 92, 255, 0.17), transparent 32rem),
        radial-gradient(circle at 85% 10%, rgba(54, 169, 255, 0.14), transparent 30rem),
        var(--background);
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a {
    color: inherit;
}

.site-header {
    width: min(1180px, calc(100% - 32px));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    font-size: 1.15rem;
    font-weight: 850;
    letter-spacing: 0.02em;
    text-decoration: none;
    background: linear-gradient(90deg, var(--primary-a), var(--primary-b));
    -webkit-background-clip: text;
    color: transparent;
}

.main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}

.main-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.94rem;
}

.main-nav a:hover {
    color: var(--text);
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 80px;
    flex: 1 0 auto;
}

.site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 28px;
    flex: 0 0 auto;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer p {
    margin: 0;
}

.auth-card,
.content-card,
.hero-card,
.table-card,
.stat-card {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-card {
    width: min(520px, 100%);
    margin: 5vh auto 0;
    padding: clamp(26px, 5vw, 46px);
    border-radius: 26px;
}

.auth-combined-card {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
    gap: clamp(24px, 4vw, 42px);
    align-items: start;
}

.auth-form-column {
    min-width: 0;
}

.auth-cookie-card {
    min-width: 0;
    padding-left: clamp(22px, 3vw, 36px);
    border-left: 1px solid var(--border);
}

.auth-cookie-card h2 {
    margin-bottom: 10px;
    font-size: 1.35rem;
}

.cookie-info-list {
    display: grid;
    gap: 13px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.cookie-info-list li {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.045);
}

.cookie-info-list strong,
.cookie-info-list span {
    display: block;
}

.cookie-info-list strong {
    margin-bottom: 4px;
    color: var(--text);
}

.cookie-info-list span,
.cookie-info-note {
    color: var(--muted);
    font-size: 0.9rem;
}

.cookie-info-note {
    margin: 18px 0 0;
}

.content-card {
    padding: 26px;
    border-radius: 22px;
}

.narrow-card {
    max-width: 680px;
    margin: 4vh auto 0;
    text-align: center;
}

.hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: clamp(26px, 5vw, 44px);
    border-radius: 28px;
}

.profile-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.profile-hero.has-profile-background {
    background-image:
        linear-gradient(90deg, rgba(12, 14, 30, 0.88), rgba(12, 14, 30, 0.56)),
        var(--profile-background-image);
    background-position: center;
    background-size: cover;
}

.profile-hero.has-profile-background::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.12), transparent 28rem);
    pointer-events: none;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 24px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 14px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.eyebrow {
    margin-bottom: 10px;
    color: #bba8ff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.stack-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
    font-size: 0.92rem;
}

input,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(7, 9, 20, 0.72);
    color: var(--text);
    font: inherit;
    outline: none;
}

input {
    min-height: 48px;
    padding: 0 14px;
}

select {
    min-height: 40px;
    padding: 0 36px 0 12px;
}

input:focus,
select:focus {
    border-color: rgba(141, 92, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(141, 92, 255, 0.16);
}

/* Le clic place précisément le curseur dans les champs de saisie. */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea {
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
    caret-color: var(--text);
}

input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"])::selection,
textarea::selection {
    background: rgba(141, 92, 255, 0.42);
    color: #ffffff;
}

.button-row,
.inline-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.button-row {
    justify-content: center;
    margin-top: 28px;
}

.button {
    min-height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.button-primary {
    background: linear-gradient(90deg, var(--primary-a), var(--primary-b));
}

.button-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
}

.button-small {
    min-height: 40px;
    padding: 0 13px;
    background: rgba(141, 92, 255, 0.2);
    border: 1px solid rgba(141, 92, 255, 0.35);
}

.alert {
    margin: 20px 0;
    padding: 13px 15px;
    border-radius: 13px;
    border: 1px solid;
}

.alert-error {
    color: #ffdfe5;
    border-color: rgba(255, 110, 133, 0.4);
    background: rgba(255, 110, 133, 0.12);
}

.alert-success {
    color: #ddfff0;
    border-color: rgba(100, 215, 165, 0.4);
    background: rgba(100, 215, 165, 0.12);
}

.dashboard-grid,
.stats-grid {
    display: grid;
    gap: 20px;
    margin-top: 22px;
}

.dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    padding: 24px;
    border-radius: 20px;
    display: grid;
    gap: 3px;
    color: var(--muted);
}

.stat-number {
    color: var(--text);
    font-size: 2rem;
    font-weight: 900;
}

.status-badge,
.placeholder-label,
.small-note {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.status-badge {
    padding: 7px 11px;
    white-space: nowrap;
}

.status-admin {
    color: #e9ddff;
    background: rgba(141, 92, 255, 0.19);
}

.status-member {
    color: #dcf3ff;
    background: rgba(54, 169, 255, 0.16);
}

.status-pending_member {
    color: #fff1cc;
    background: rgba(255, 204, 106, 0.15);
}

.placeholder-label {
    padding: 6px 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
}

.small-note {
    margin-left: 7px;
    padding: 3px 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
}

.status-icon {
    margin-bottom: 14px;
    font-size: 3rem;
}

.profile-list {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
}

.profile-list div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.profile-list dt {
    color: var(--muted);
}

.profile-list dd {
    margin: 0;
    font-weight: 750;
    text-align: right;
}

.text-link {
    color: #b9dcff;
    font-weight: 750;
    text-decoration: none;
}

.table-card {
    overflow: hidden;
    border-radius: 22px;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 17px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.empty-state {
    padding: 38px;
    color: var(--muted);
    text-align: center;
}


@media (max-width: 850px) {
    .auth-combined-card {
        grid-template-columns: 1fr;
        margin-top: 3vh;
    }

    .auth-cookie-card {
        padding-top: 24px;
        padding-left: 0;
        border-top: 1px solid var(--border);
        border-left: 0;
    }
}

@media (max-width: 850px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hero-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 650px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px 0;
    }

    .page-shell {
        padding-top: 24px;
    }

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

    .inline-form {
        min-width: 240px;
    }
}

.status-banned {
    color: #ffdfe5;
    background: rgba(255, 110, 133, 0.16);
}

.table-input {
    min-width: 150px;
    min-height: 40px;
}

.alert-warning {
    color: #fff1cc;
    border-color: rgba(255, 204, 106, 0.4);
    background: rgba(255, 204, 106, 0.12);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 22px;
}

.user-chip,
.member-character,
.profile-identity,
.centered-identity {
    display: flex;
    align-items: center;
    gap: 13px;
}

.user-chip span,
.member-character span,
.centered-identity div {
    display: grid;
    gap: 1px;
}

.user-chip small,
.member-character small,
.centered-identity span {
    color: var(--muted);
    font-size: 0.78rem;
}

.user-avatar,
.user-chip-avatar,
.profile-avatar,
.member-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(141, 92, 255, 0.35), rgba(54, 169, 255, 0.35));
}

.user-chip-avatar {
    width: 42px;
    height: 42px;
}

.profile-avatar {
    width: 126px;
    height: 126px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.profile-avatar-small {
    width: 76px;
    height: 76px;
}

.member-avatar {
    width: 54px;
    height: 54px;
}

.avatar-placeholder {
    color: var(--text);
    font-weight: 900;
}

.profile-identity {
    align-items: flex-start;
}

.profile-identity h1 {
    margin-bottom: 6px;
}

.character-world {
    margin-bottom: 14px;
    color: #b9dcff;
    font-weight: 800;
}

.centered-identity {
    width: fit-content;
    margin: 0 auto 26px;
    text-align: left;
}

.member-character {
    min-width: 210px;
}

.lodestone-field {
    display: grid;
    gap: 5px;
}

.small-link {
    color: #b9dcff;
    font-size: 0.78rem;
    text-decoration: none;
}

.small-link:hover {
    text-decoration: underline;
}

@media (max-width: 850px) {
    .header-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .profile-identity {
        flex-direction: column;
    }
}

/* Configuration des jobs */
.jobs-heading {
    align-items: flex-start;
}

.jobs-heading-copy {
    max-width: 820px;
}

.jobs-heading-copy code {
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: #d9e9ff;
    background: rgba(255, 255, 255, 0.05);
    white-space: normal;
    overflow-wrap: anywhere;
}

.jobs-total,
.job-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.jobs-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}

.job-category-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.job-category-header {
    padding: 26px 28px 22px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(141, 92, 255, 0.09), rgba(54, 169, 255, 0.04));
}

.job-category-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.job-category-header h2,
.job-category-header p,
.job-section-heading h3,
.job-section-heading p {
    margin: 0;
}

.job-category-header h2 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.job-category-header p {
    max-width: 760px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.92rem;
}

.job-count-badge {
    min-height: 30px;
    padding: 0 10px;
    color: #ddd5ff;
    background: rgba(141, 92, 255, 0.12);
}

.job-add-section,
.job-list-section {
    padding: 24px 28px;
}

.job-add-section {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.022);
}

.job-section-heading {
    margin-bottom: 17px;
}

.job-section-heading h3 {
    font-size: 1.02rem;
}

.job-section-heading p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.job-add-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
}

.job-add-fields {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(320px, 1.15fr);
    gap: 16px;
    min-width: 0;
}

.job-add-action {
    display: flex;
    align-items: flex-end;
}

.job-add-action .button {
    min-width: 150px;
    min-height: 48px;
}

.job-list-section {
    padding-top: 22px;
}

.job-list-heading {
    margin-bottom: 12px;
}

.job-list {
    display: grid;
    gap: 14px;
}

.job-row {
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(7, 9, 20, 0.35);
}

.job-row-identity {
    display: grid;
    grid-template-columns: 34px 88px;
    gap: 12px;
    align-items: center;
    padding-right: 16px;
    border-right: 1px solid var(--border);
}

.job-position {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
}

.job-position span {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.job-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.job-image-preview {
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    object-fit: contain;
    background: rgba(7, 9, 20, 0.72);
}

.job-image-missing {
    padding: 9px;
    color: var(--warning);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

.job-row-content {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.job-main-fields {
    display: grid;
    grid-template-columns: minmax(190px, 0.85fr) minmax(320px, 1.15fr);
    gap: 16px;
    min-width: 0;
    align-items: start;
}

.job-main-fields label,
.job-add-fields label {
    min-width: 0;
}

.job-main-fields label > span,
.job-add-fields label > span {
    min-height: 22px;
    display: flex;
    align-items: center;
}

.job-main-fields small,
.job-add-fields small {
    display: block;
    min-height: 18px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.35;
}

.job-name-input,
.file-input {
    min-height: 48px;
}

.file-input {
    padding: 7px 9px;
    font-size: 0.82rem;
    line-height: 1.25;
}

.file-input::file-selector-button {
    min-height: 32px;
    margin-right: 9px;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    color: var(--text);
    background: rgba(141, 92, 255, 0.22);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.job-row-actions {
    display: grid;
    grid-template-columns: 96px minmax(220px, 280px) minmax(150px, 190px);
    gap: 10px;
    align-items: stretch;
    justify-content: end;
    min-width: 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.job-order-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.icon-button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.icon-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.11);
}

.icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.32;
}

.job-row-actions .button {
    width: 100%;
    min-height: 44px;
    height: auto;
    padding: 9px 12px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}

.job-save-button {
    color: #e9e3ff;
    border: 1px solid rgba(141, 92, 255, 0.4);
    background: rgba(141, 92, 255, 0.18);
}

.button-danger {
    color: #ffdfe5;
    border: 1px solid rgba(255, 110, 133, 0.35);
    background: rgba(255, 110, 133, 0.13);
}

.job-empty-state {
    display: grid;
    gap: 5px;
    padding: 30px 24px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
}

.job-empty-state strong {
    color: var(--text);
}

@media (max-width: 1050px) {
    .job-add-form {
        grid-template-columns: 1fr;
    }

    .job-add-action .button {
        width: 100%;
    }

    .job-main-fields {
        grid-template-columns: 1fr;
    }

    .job-row-actions {
        grid-template-columns: 96px minmax(190px, 1fr) minmax(150px, 0.72fr);
    }
}

@media (max-width: 760px) {
    .jobs-heading {
        flex-direction: column;
    }

    .jobs-total {
        white-space: normal;
    }

    .job-category-header,
    .job-add-section,
    .job-list-section {
        padding-left: 18px;
        padding-right: 18px;
    }

    .job-add-fields {
        grid-template-columns: 1fr;
    }

    .job-row {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 16px;
        padding: 15px;
    }

    .job-row-identity {
        grid-template-columns: 28px 72px;
        gap: 10px;
        padding-right: 12px;
    }

    .job-image-preview {
        width: 72px;
        height: 72px;
        border-radius: 14px;
    }

    .job-row-actions {
        grid-template-columns: 90px minmax(0, 1fr);
    }

    .job-row-actions .button-danger {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .job-category-title-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .job-row {
        grid-template-columns: 1fr;
    }

    .job-row-identity {
        grid-template-columns: 36px 78px;
        justify-content: start;
        padding: 0 0 14px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .job-image-preview {
        width: 78px;
        height: 78px;
    }

    .job-row-actions {
        grid-template-columns: 1fr;
    }

    .job-row-actions .button-danger {
        grid-column: auto;
    }
}


/* Version compacte des lignes de jobs */
.job-list {
    gap: 9px;
}

.job-row {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    align-items: center;
}

.job-row-identity {
    grid-template-columns: 24px 52px;
    gap: 8px;
    padding-right: 10px;
}

.job-position span {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
}

.job-image-preview {
    width: 52px;
    height: 52px;
    border-radius: 11px;
}

.job-image-missing {
    padding: 5px;
    font-size: 0.6rem;
}

.job-row-content {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.job-main-fields {
    grid-template-columns: minmax(180px, 0.75fr) minmax(250px, 1.25fr);
    gap: 12px;
    align-items: end;
}

.job-main-fields label > span {
    min-height: 18px;
    font-size: 0.78rem;
}

.job-name-input,
.job-row .file-input {
    min-height: 40px;
    height: 40px;
}

.job-row .file-input {
    padding: 4px 7px;
    font-size: 0.76rem;
}

.job-row .file-input::file-selector-button {
    min-height: 28px;
    margin-right: 7px;
    padding: 5px 8px;
}

.job-row-actions {
    display: grid;
    grid-template-columns: 70px 102px 92px;
    gap: 7px;
    align-items: end;
    min-width: 278px;
    padding-top: 0;
    border-top: 0;
}

.job-order-actions {
    gap: 5px;
}

.icon-button,
.job-row-actions .button {
    min-height: 40px;
    height: 40px;
    padding: 5px 8px;
    border-radius: 9px;
    font-size: 0.78rem;
    line-height: 1.1;
}

@media (max-width: 1120px) {
    .job-row-content {
        grid-template-columns: 1fr;
    }

    .job-row-actions {
        justify-content: end;
    }
}

@media (max-width: 760px) {
    .job-row {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .job-row-identity {
        grid-template-columns: 22px 46px;
        gap: 7px;
        padding-right: 8px;
    }

    .job-image-preview {
        width: 46px;
        height: 46px;
    }

    .job-main-fields {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .job-row-actions {
        grid-template-columns: 64px minmax(92px, 1fr) minmax(82px, 0.8fr);
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 520px) {
    .job-row {
        grid-template-columns: 1fr;
    }

    .job-row-identity {
        grid-template-columns: 24px 48px;
        padding: 0 0 8px;
    }

    .job-image-preview {
        width: 48px;
        height: 48px;
    }

    .job-row-actions {
        grid-template-columns: 62px 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .job-row-actions .button-danger {
        grid-column: auto;
    }
}

/* Identité de la Linkshell */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    background: none;
    color: var(--text);
    -webkit-background-clip: initial;
}

.brand-name {
    max-width: 280px;
    overflow: hidden;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: linear-gradient(90deg, var(--primary-a), var(--primary-b));
    -webkit-background-clip: text;
    color: transparent;
}

.brand-avatar,
.linkshell-settings-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--border);
    object-fit: cover;
}

.brand-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.linkshell-settings-avatar {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.linkshell-avatar-placeholder {
    color: #ffffff;
    background: #5b616d;
    font-weight: 900;
    text-transform: uppercase;
}

.linkshell-settings-card {
    display: grid;
    gap: 24px;
    margin-bottom: 30px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.linkshell-settings-header {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.linkshell-avatar-preview {
    display: inline-grid;
    width: 96px;
    flex: 0 0 96px;
}

.linkshell-avatar-preview-image {
    grid-area: 1 / 1;
}

.linkshell-identity-copy {
    min-width: 0;
}

.linkshell-identity-copy h2 {
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.linkshell-identity-copy p {
    max-width: 760px;
    margin-bottom: 0;
}

.linkshell-settings-form {
    display: grid;
    gap: 20px;
}

.linkshell-settings-fields,
.linkshell-media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.linkshell-settings-fields label,
.linkshell-media-input {
    min-width: 0;
}

.linkshell-media-card {
    min-width: 0;
    min-height: 100%;
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.035);
}

.linkshell-media-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.linkshell-media-card-header > div {
    min-width: 0;
}

.linkshell-media-title {
    color: var(--text);
    font-size: 0.94rem;
    font-weight: 800;
}

.linkshell-media-note {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
}

.linkshell-media-card-header .button {
    flex: 0 0 auto;
    max-width: 180px;
    min-height: 38px;
    line-height: 1.2;
    white-space: normal;
}

.linkshell-media-input {
    align-self: end;
}

.linkshell-settings-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
}

.linkshell-settings-actions .button {
    min-width: 220px;
}

.member-background-preview {
    min-height: 132px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: rgba(7, 9, 20, 0.48);
}

.member-background-preview-image {
    width: 100%;
    height: 132px;
    display: block;
    object-fit: cover;
}

.member-background-preview-image[hidden] {
    display: none;
}

.checkbox-label {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-a);
}

.members-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 16px;
}

.members-section-heading h2,
.members-section-heading p {
    margin-bottom: 0;
}

.members-count {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

@media (max-width: 900px) {
    .linkshell-settings-fields,
    .linkshell-media-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .brand-name {
        max-width: 210px;
    }

    .linkshell-settings-card {
        gap: 20px;
        padding: 18px;
    }

    .linkshell-settings-header {
        align-items: flex-start;
    }

    .linkshell-settings-avatar {
        width: 76px;
        height: 76px;
        border-radius: 18px;
    }

    .linkshell-avatar-preview {
        width: 76px;
        flex-basis: 76px;
    }

    .linkshell-media-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .linkshell-media-card-header .button,
    .linkshell-settings-actions .button {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .members-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Création et aperçu des événements */
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(7, 9, 20, 0.72);
    color: var(--text);
    font: inherit;
    line-height: 1.55;
    resize: vertical;
    outline: none;
}

textarea:focus {
    border-color: rgba(141, 92, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(141, 92, 255, 0.16);
}

.admin-hero-actions {
    justify-content: flex-end;
    margin-top: 0;
}

.event-page-heading {
    align-items: flex-start;
}

.event-create-card {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.event-create-form {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
    gap: 28px;
    align-items: start;
}

.event-form-main,
.event-form-side {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.event-title-field input,
.event-list-field select,
.event-date-grid input {
    min-height: 48px;
}

.event-description-field textarea {
    min-height: 224px;
}

.event-form-side {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
}

.event-image-field input[type="file"] {
    min-height: auto;
    padding: 8px;
}

.event-image-field input[type="file"]::file-selector-button {
    min-height: 34px;
    margin-right: 10px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    color: var(--text);
    background: rgba(141, 92, 255, 0.25);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.event-image-field small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.45;
}

.event-date-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.event-timezone-note {
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.82rem;
}

.event-submit-button {
    width: 100%;
    min-height: 50px;
}

.events-created-section {
    margin-top: 34px;
}

.event-empty-state {
    color: var(--muted);
    text-align: center;
}

.event-admin-list {
    display: grid;
    gap: 16px;
}

.event-admin-card {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 20px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.event-admin-image-wrap {
    min-width: 0;
}

.event-admin-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
}

.event-image-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.event-admin-content {
    min-width: 0;
}

.event-admin-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.event-admin-title-row h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.event-list-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    color: #e7ddff;
    background: rgba(141, 92, 255, 0.17);
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.event-admin-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 12px 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.event-admin-content p {
    display: -webkit-box;
    margin-bottom: 0;
    overflow: hidden;
    color: var(--muted);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

@media (max-width: 950px) {
    .event-create-form {
        grid-template-columns: 1fr;
    }

    .event-form-side {
        grid-template-columns: 1fr 1fr;
        align-items: end;
    }

    .event-image-field,
    .event-date-grid {
        grid-column: 1 / -1;
    }

    .event-timezone-note,
    .event-submit-button {
        min-height: 50px;
    }
}

@media (max-width: 760px) {
    .event-create-card {
        padding: 18px;
    }

    .event-form-side {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .event-image-field,
    .event-date-grid,
    .event-timezone-note,
    .event-submit-button {
        grid-column: auto;
    }

    .event-admin-card {
        grid-template-columns: 150px minmax(0, 1fr);
        gap: 14px;
    }

    .event-admin-title-row {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .admin-hero-actions {
        width: 100%;
        justify-content: stretch;
    }

    .admin-hero-actions .button {
        width: 100%;
    }

    .event-admin-card {
        grid-template-columns: 1fr;
    }

    .event-admin-image-wrap {
        max-width: none;
    }
}

/* Page membre : réponses aux événements */
.member-events-heading {
    align-items: flex-start;
}

.member-events-empty {
    max-width: 720px;
    margin: 28px auto 0;
    padding: 42px 28px;
    text-align: center;
}

.member-event-list {
    display: grid;
    gap: 22px;
}

/*
 * La partie haute conserve une bannière compacte à gauche.
 * La zone de réponse passe ensuite sur toute la largeur de la carte :
 * il n’y a donc plus de grande colonne vide sous l’image.
 */
.member-event-card {
    display: grid;
    grid-template-columns: clamp(230px, 25vw, 300px) minmax(0, 1fr);
    grid-template-areas:
        "cover title"
        "cover dates"
        "cover description"
        "responses responses"
        "response response";
    column-gap: 24px;
    align-items: start;
    padding: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.member-event-cover-wrap {
    position: relative;
    grid-area: cover;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.member-event-cover {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.member-event-state {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 850;
    backdrop-filter: blur(12px);
}

.member-event-state.is-live {
    color: #dcfff0;
    background: rgba(38, 151, 105, 0.82);
}

.member-event-state.is-upcoming {
    color: #f0e9ff;
    background: rgba(92, 61, 173, 0.82);
}

/* Aplatit uniquement le conteneur afin que ses sections participent à la grille. */
.member-event-body {
    display: contents;
}

.member-event-title-row {
    grid-area: title;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
}

.member-event-title-row > div:first-child {
    min-width: 0;
}

.member-event-title-row h2 {
    margin-bottom: 9px;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.response-saved-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    color: #ddfff0;
    background: rgba(100, 215, 165, 0.15);
    font-size: 0.74rem;
    font-weight: 850;
    white-space: nowrap;
}

.member-event-dates {
    grid-area: dates;
    display: flex;
    flex-wrap: wrap;
    gap: 7px 20px;
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.86rem;
}

.member-event-description {
    grid-area: description;
    min-width: 0;
    color: var(--muted);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.member-event-responses-section {
    grid-area: responses;
    width: 100%;
    min-width: 0;
    margin-top: 20px;
}

.member-response-section {
    grid-area: response;
    width: 100%;
    min-width: 0;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.member-response-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 15px;
}

.member-response-heading h3,
.member-response-heading p {
    margin-bottom: 0;
}

.current-response-text {
    color: var(--muted);
    font-size: 0.84rem;
    text-align: right;
}

.current-response-summary {
    display: grid;
    justify-items: end;
    gap: 5px;
}

.current-response-positions {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 800;
}

.job-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 58px);
    gap: 10px;
    justify-content: start;
}

.job-choice {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.job-choice:hover {
    border-color: rgba(141, 92, 255, 0.55);
    background: rgba(141, 92, 255, 0.08);
    transform: translateY(-1px);
}

.job-choice:has(input:checked) {
    border-color: rgba(141, 92, 255, 0.9);
    background: rgba(141, 92, 255, 0.14);
    box-shadow: 0 0 0 2px rgba(141, 92, 255, 0.12);
}

.job-choice input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 1px;
    opacity: 0;
    pointer-events: none;
}

.job-choice img,
.job-choice-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.job-choice-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-weight: 900;
}

.position-choice-section {
    margin: 2px 0 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.position-choice-section legend {
    padding: 0 7px;
    font-weight: 800;
}

.position-choice-section p {
    margin: 0 0 10px;
    font-size: 0.84rem;
}

.position-choice-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(48px, 1fr));
    gap: 8px;
}

.position-choice {
    position: relative;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    font-weight: 900;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.position-choice:hover {
    border-color: rgba(141, 92, 255, 0.55);
    background: rgba(141, 92, 255, 0.08);
    transform: translateY(-1px);
}

.position-choice:has(input:checked) {
    border-color: rgba(141, 92, 255, 0.9);
    background: rgba(141, 92, 255, 0.16);
    box-shadow: 0 0 0 2px rgba(141, 92, 255, 0.12);
}

.position-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 1px;
    opacity: 0;
    pointer-events: none;
}

.member-response-form {
    display: grid;
    gap: 15px;
}

.member-response-actions {
    display: flex;
    justify-content: flex-end;
}

.remove-response-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 9px;
}

.alert-warning {
    color: #fff1cc;
    border-color: rgba(255, 204, 106, 0.4);
    background: rgba(255, 204, 106, 0.12);
}

@media (max-width: 920px) {
    .member-event-card {
        grid-template-columns: 220px minmax(0, 1fr);
        column-gap: 18px;
        padding: 17px;
    }
}

@media (max-width: 720px) {
    .member-event-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "cover"
            "title"
            "dates"
            "description"
            "responses"
            "response";
        gap: 0;
        padding: 14px;
    }

    .member-event-cover-wrap {
        margin-bottom: 18px;
    }

    .member-event-cover {
        max-height: 190px;
    }

    .member-event-title-row,
    .member-response-heading {
        flex-direction: column;
    }

    .current-response-text {
        text-align: left;
    }

    .job-choice-grid {
        grid-template-columns: repeat(auto-fill, 58px);
    }

    .member-response-actions,
    .remove-response-form {
        justify-content: stretch;
    }

    .member-response-actions .button,
    .remove-response-form .button {
        width: 100%;
    }
}

@media (max-width: 460px) {
    .job-choice-grid {
        grid-template-columns: repeat(auto-fill, 58px);
    }

    .member-event-state {
        top: 10px;
        right: 10px;
    }
}

/* Actions des événements côté administration */
.event-admin-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.event-admin-actions form {
    margin: 0;
}

.event-current-image {
    display: grid;
    gap: 8px;
}

.event-current-image > span {
    font-size: 0.92rem;
    font-weight: 700;
}

.event-current-image img,
.event-current-image .event-image-missing {
    display: block;
    width: min(100%, 360px);
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border);
    border-radius: 14px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
}

/* Page membre : événements en cours et réponses */
.live-events-heading,
.linkshell-members-heading {
    align-items: flex-start;
}

.live-event-list {
    display: grid;
    gap: 24px;
}

.live-event-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.live-event-summary {
    display: grid;
    grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
    gap: 22px;
    padding: 20px;
}

.live-event-image-wrap {
    position: relative;
    align-self: start;
}

.live-event-image-wrap img,
.live-event-image-wrap .event-image-missing {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
}

.live-event-info {
    min-width: 0;
}

.live-event-info h2 {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.live-event-info p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.live-responses-section {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.025);
}

.compact-heading {
    margin-bottom: 16px;
}

.compact-heading h3,
.compact-heading p {
    margin-bottom: 0;
}

.live-responses-empty {
    padding: 20px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

.participant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.participant-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.035);
}

.participant-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.participant-identity {
    display: grid;
    min-width: 0;
}

.participant-identity strong,
.participant-identity small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-identity small {
    color: var(--muted);
}

.participant-positions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.participant-positions span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 7px;
    border: 1px solid rgba(141, 92, 255, 0.3);
    border-radius: 999px;
    background: rgba(141, 92, 255, 0.1);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
}

.participant-job {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px 9px;
    border-radius: 12px;
    background: rgba(141, 92, 255, 0.1);
    font-size: 0.82rem;
    font-weight: 800;
}

.participant-job img,
.participant-job-placeholder {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.participant-job-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.participant-job > span:last-child {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Annuaire des membres de la Linkshell */
.linkshell-member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.linkshell-member-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.linkshell-member-avatar {
    width: 82px;
    height: 82px;
    border-radius: 18px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.linkshell-member-info {
    min-width: 0;
}

.linkshell-member-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.linkshell-member-name-row h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.linkshell-member-info .character-world {
    margin: 7px 0 12px;
}

@media (max-width: 820px) {
    .live-event-summary {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .live-event-image-wrap {
        width: 100%;
        max-width: none;
    }

    .live-event-image-wrap img,
    .live-event-image-wrap .event-image-missing {
        width: 100%;
        max-height: 240px;
        object-fit: cover;
    }

    .participant-card {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .participant-avatar {
        width: 44px;
        height: 44px;
    }

    .participant-job {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .participant-job > span:last-child {
        max-width: none;
    }
}

@media (max-width: 650px) {
    .live-event-summary {
        padding: 14px;
    }

    .live-event-image-wrap img,
    .live-event-image-wrap .event-image-missing {
        max-height: 190px;
        border-radius: 13px;
    }

    .live-event-info .event-admin-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .live-event-info h2 {
        font-size: 1.35rem;
    }

    .live-responses-section {
        padding: 16px;
    }

    .linkshell-member-grid {
        grid-template-columns: 1fr;
    }

    .linkshell-member-card {
        grid-template-columns: 68px minmax(0, 1fr);
        padding: 15px;
    }

    .linkshell-member-avatar {
        width: 68px;
        height: 68px;
        border-radius: 15px;
    }
}

@media (max-width: 430px) {
    .participant-grid {
        grid-template-columns: 1fr;
    }

    .event-admin-actions,
    .event-admin-actions form,
    .event-admin-actions .button {
        width: 100%;
    }
}

/* Navigation simplifiée et actions de retour */
.page-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.page-heading-actions-stacked {
    align-items: flex-end;
    flex-direction: column;
}

.main-nav {
    justify-content: flex-end;
    gap: 10px;
}

.main-nav a {
    min-height: 40px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 11px;
}

.main-nav a:hover {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.055);
}

/* Événements disponibles : l’icône du job suffit */
.participant-card {
    grid-template-columns: 48px minmax(0, 1fr) 44px;
}

.participant-job {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(141, 92, 255, 0.22);
    border-radius: 12px;
    background: rgba(141, 92, 255, 0.1);
}

.participant-job img,
.participant-job-placeholder {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
}

/* Annuaire compact sous forme de liste */
.member-directory {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.member-directory-header,
.member-directory-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) minmax(150px, 0.8fr) minmax(145px, 0.65fr) 120px;
    gap: 20px;
    align-items: center;
}

.member-directory-header {
    min-height: 48px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.member-directory-list {
    display: grid;
}

.member-directory-row {
    min-height: 76px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.member-directory-row:last-child {
    border-bottom: 0;
}

.member-directory-row:hover {
    background: rgba(255, 255, 255, 0.028);
}

.member-directory-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.member-directory-identity > div {
    display: grid;
    min-width: 0;
}

.member-directory-identity strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-directory-identity strong {
    font-size: 1rem;
}


.member-directory-avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border: 1px solid var(--border);
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.member-directory-world {
    min-width: 0;
    overflow: hidden;
    color: #c9dcff;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-directory-role {
    display: flex;
    align-items: center;
}

.member-directory-action {
    display: flex;
    justify-content: flex-end;
}

.member-directory-action .button {
    width: 100%;
}

@media (max-width: 880px) {
    .page-heading {
        align-items: flex-start;
    }

    .page-heading-actions {
        justify-content: flex-start;
    }

    .page-heading-actions-stacked {
        align-items: flex-start;
    }

    .member-directory-header {
        display: none;
    }

    .member-directory-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 18px;
        padding: 16px;
    }

    .member-directory-identity {
        grid-column: 1 / -1;
    }

    .member-directory-world,
    .member-directory-role {
        display: grid;
        gap: 3px;
    }

    .member-directory-world::before,
    .member-directory-role::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 850;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .member-directory-action {
        grid-column: 2;
        grid-row: 2 / span 2;
        align-self: center;
    }
}

@media (max-width: 650px) {
    .main-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .page-heading-actions,
    .page-heading-actions .button {
        width: 100%;
    }

    .page-heading-actions .members-count,
    .page-heading-actions .jobs-total {
        width: 100%;
    }

    .participant-card {
        grid-template-columns: 44px minmax(0, 1fr) 42px;
    }

    .participant-job {
        grid-column: auto;
        justify-self: end;
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    .member-directory-row {
        grid-template-columns: 1fr;
    }

    .member-directory-action {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
    }

    .member-directory-action .button {
        width: 100%;
    }
}

.member-role-text {
    font-size: 0.86rem;
    font-weight: 800;
}

.member-role-text.is-admin {
    color: #cdbdff;
}

.member-role-text.is-member {
    color: #b9dcff;
}


.member-admin-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.member-admin-actions .inline-form {
    min-width: 0;
}

.member-admin-actions .button {
    min-height: 38px;
    padding-inline: 12px;
}

@media (max-width: 760px) {
    .member-admin-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .member-admin-actions .button {
        width: 100%;
    }
}

/* Types d'événements et Polls */
[hidden] {
    display: none !important;
}

.event-type-field select,
.event-response-config select {
    min-height: 48px;
}

.event-response-config {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.poll-admin-config textarea {
    min-height: 168px;
}

.event-type-field small,
.event-response-config small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.45;
}

.event-list-badge.is-poll {
    color: #dff7ff;
    background: rgba(54, 169, 255, 0.17);
}

.poll-option-summary {
    width: fit-content;
    margin-top: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.055);
    font-size: 0.76rem;
    font-weight: 750;
}

.poll-choice-list {
    display: grid;
    gap: 10px;
}

.poll-choice {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.poll-choice:hover {
    border-color: rgba(141, 92, 255, 0.48);
    background: rgba(141, 92, 255, 0.075);
}

.poll-choice:has(input:checked) {
    border-color: rgba(54, 169, 255, 0.65);
    background: rgba(54, 169, 255, 0.1);
}

.poll-choice input {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    accent-color: var(--primary-a);
}

.poll-choice span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.poll-results {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.poll-results-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
}

.poll-results-heading h3,
.poll-results-heading p {
    margin-bottom: 0;
}

.poll-result-list {
    display: grid;
    gap: 14px;
}

.poll-result-list-large {
    max-width: 920px;
}

.poll-result-row {
    display: grid;
    gap: 7px;
}

.poll-result-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    font-size: 0.9rem;
}

.poll-result-label span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.poll-result-label strong {
    flex: 0 0 auto;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.poll-result-track {
    position: relative;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.poll-result-track > span {
    display: block;
    width: 0;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: var(--poll-color, var(--primary-a));
    box-shadow: 0 0 18px color-mix(in srgb, var(--poll-color, var(--primary-a)) 45%, transparent);
    transition: width 280ms ease;
}

@media (max-width: 650px) {
    .event-response-config {
        padding: 13px;
    }

    .poll-choice {
        padding: 10px 12px;
    }

    .poll-result-label {
        align-items: flex-start;
        gap: 10px;
    }

    .poll-results {
        margin-top: 20px;
        padding-top: 18px;
    }
}

.language-selector {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.language-selector label {
    display: block;
}

.language-selector select {
    width: auto;
    min-width: 68px;
    min-height: 38px;
    padding: 0 30px 0 11px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 650px) {
    .language-selector {
        position: absolute;
        top: 18px;
        right: 16px;
    }

    .site-header {
        position: relative;
        padding-right: 92px;
    }
}


/* Bilingual custom file chooser ----------------------------------------- */
.custom-file-control {
    position: relative;
    min-width: 0;
    min-height: 44px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(7, 9, 20, 0.72);
    cursor: pointer;
}

.custom-file-control:focus-within {
    border-color: rgba(141, 92, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(141, 92, 255, 0.16);
}

.custom-file-native {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.custom-file-button {
    min-height: 42px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
    color: var(--text);
    background: rgba(141, 92, 255, 0.22);
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.custom-file-name {
    min-width: 0;
    padding: 0 12px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-file-control.has-file .custom-file-name {
    color: var(--text);
}

.job-row .custom-file-control {
    min-height: 40px;
    height: 40px;
}

.job-row .custom-file-button {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 0.74rem;
}

.job-row .custom-file-name {
    padding-inline: 9px;
    font-size: 0.74rem;
}

.event-image-field .custom-file-control {
    width: 100%;
}

@media (max-width: 560px) {
    .custom-file-control {
        grid-template-columns: 1fr;
    }

    .custom-file-button {
        min-height: 38px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .custom-file-name {
        min-height: 38px;
        display: flex;
        align-items: center;
    }

    .job-row .custom-file-control {
        height: auto;
    }
}


/* Home page: member area and information side by side. */
.home-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
    align-items: stretch;
    gap: 20px;
}

.home-top-grid .hero-card,
.home-info-card {
    height: 100%;
}

.home-info-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-info-card .profile-list {
    margin-top: 8px;
}

.home-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .home-top-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .home-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .home-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Drag & drop ordering for job lists */
.job-row-identity {
    grid-template-columns: 28px 24px 52px;
}

.job-drag-handle {
    width: 28px;
    min-width: 28px;
    height: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.055);
    font: inherit;
    font-weight: 900;
    line-height: 1;
    cursor: grab;
    touch-action: none;
}

.job-drag-handle:hover,
.job-drag-handle:focus-visible {
    color: var(--text);
    background: rgba(141, 92, 255, 0.16);
}

.job-drag-handle:active {
    cursor: grabbing;
}

.job-list.is-dragging-list {
    user-select: none;
}

.job-row.is-dragging {
    opacity: 0.54;
    outline: 2px solid rgba(141, 92, 255, 0.58);
    outline-offset: 2px;
}

@media (max-width: 760px) {
    .job-row-identity {
        grid-template-columns: 26px 22px 46px;
    }

    .job-drag-handle {
        width: 26px;
        min-width: 26px;
        height: 32px;
        min-height: 32px;
        border-radius: 8px;
    }
}

@media (max-width: 520px) {
    .job-row-identity {
        grid-template-columns: 26px 24px 48px;
    }
}

.job-row {
    grid-template-columns: 120px minmax(0, 1fr);
}

@media (max-width: 760px) {
    .job-row {
        grid-template-columns: 108px minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .job-row {
        grid-template-columns: 1fr;
    }
}

.job-row {
    scroll-margin-top: 96px;
}

/* Administration des règles Discord */
.rules-page-heading {
    align-items: flex-start;
}

.rules-information-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.rules-information-card p {
    margin-bottom: 0;
}

.rules-json-summary {
    min-width: min(100%, 300px);
    display: grid;
    gap: 5px;
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(7, 9, 20, 0.58);
}

.rules-json-summary span,
.rules-json-summary small {
    color: var(--muted);
}

.rules-json-summary code {
    overflow-wrap: anywhere;
    color: #d9ceff;
    font-size: 0.95rem;
}

.rules-editor-form {
    display: grid;
    gap: 20px;
}

.rules-toolbar,
.rules-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.rules-toolbar {
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.rules-toolbar h2,
.rules-toolbar p {
    margin-bottom: 0;
}

.rules-list {
    display: grid;
    gap: 18px;
}

.rule-editor-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    transition: opacity 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.rule-editor-card.is-dragging {
    opacity: 0.55;
    transform: scale(0.992);
    border-color: rgba(141, 92, 255, 0.75);
}

.rule-editor-header,
.rule-editor-heading,
.rule-editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rule-editor-header {
    justify-content: space-between;
    margin-bottom: 20px;
}

.rule-editor-heading {
    min-width: 0;
}

.rule-editor-heading > div {
    display: grid;
    gap: 2px;
}

.rule-editor-heading small {
    color: var(--muted);
}

.rule-number {
    font-weight: 900;
}

.rule-drag-handle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font: inherit;
    font-weight: 900;
    letter-spacing: -0.15em;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.rule-drag-handle:active {
    cursor: grabbing;
}

.rule-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 22px;
    align-items: start;
}

.rule-fields {
    display: grid;
    gap: 17px;
    user-select: text;
    -webkit-user-select: text;
}

.rule-fields input:not([type="file"]),
.rule-fields textarea {
    position: relative;
    z-index: 1;
}

.rule-fields label {
    position: relative;
}

.rule-fields textarea {
    min-height: 230px;
}

.field-counter {
    justify-self: end;
    color: var(--muted);
    font-weight: 600;
}

.rule-markdown-note {
    margin: -6px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.rule-discord-preview {
    position: sticky;
    top: 18px;
    min-width: 0;
}

.rule-preview-label {
    display: block;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rule-preview-embed {
    position: relative;
    min-height: 180px;
    padding: 16px 18px 17px 21px;
    overflow: hidden;
    border-radius: 4px;
    background: #2b2d31;
    color: #dbdee1;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.rule-preview-embed::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-a), var(--primary-b));
}

.rule-preview-embed strong {
    display: block;
    margin-bottom: 9px;
    color: #f2f3f5;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.rule-preview-embed div {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
    line-height: 1.45;
}

.rules-empty-state {
    padding: 36px 24px;
    border: 1px dashed rgba(141, 92, 255, 0.46);
    border-radius: 22px;
    text-align: center;
    background: rgba(141, 92, 255, 0.06);
}

.rules-empty-state[hidden] {
    display: none;
}

.rules-empty-state .button {
    margin-top: 10px;
}

.rules-save-bar {
    position: sticky;
    bottom: 14px;
    z-index: 5;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(18, 20, 40, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

@media (min-width: 1180px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .rules-information-card,
    .rules-toolbar,
    .rules-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .rule-editor-grid {
        grid-template-columns: 1fr;
    }

    .rule-discord-preview {
        position: static;
    }
}

@media (max-width: 620px) {
    .rule-editor-card {
        padding: 17px;
    }

    .rule-editor-header {
        align-items: stretch;
        flex-direction: column;
    }

    .rule-editor-actions {
        width: 100%;
    }

    .rule-editor-actions .button-danger {
        flex: 1;
    }

    .rules-toolbar .button,
    .rules-save-bar .button {
        width: 100%;
    }
}

.rule-preview-embed code {
    padding: 1px 4px;
    border-radius: 4px;
    background: #1e1f22;
    color: #e3e5e8;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

@media (min-width: 851px) and (max-width: 1179px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Administration des guides Discord */
.guide-editor-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.guide-fields textarea {
    min-height: 190px;
}

.guide-image-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.guide-image-fields label {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.025);
}

.guide-image-fields small {
    color: var(--muted);
    line-height: 1.4;
}

.guide-image-fields input[type="file"] {
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px dashed rgba(141, 92, 255, 0.48);
    border-radius: 12px;
    background: rgba(141, 92, 255, 0.06);
    color: var(--muted);
}

.guide-remove-image {
    justify-self: start;
}

.guide-preview-embed {
    min-height: 250px;
}

.guide-preview-embed > a[data-preview-title] {
    display: block;
    margin-bottom: 9px;
    color: #00a8fc;
    font-size: 1rem;
    font-weight: 800;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.guide-preview-embed > a[data-preview-title]:hover {
    text-decoration: underline;
}

.guide-preview-embed img {
    display: block;
    width: 100%;
    max-height: 360px;
    margin-top: 15px;
    border-radius: 5px;
    object-fit: cover;
    background: #1e1f22;
}

.guide-preview-embed img[hidden] {
    display: none;
}

.guide-preview-link {
    display: block;
    margin-top: 11px;
    overflow: hidden;
    color: #949ba4;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 1380px) {
    .dashboard-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .guide-editor-grid,
    .guide-image-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .guide-remove-image {
        width: 100%;
    }
}

/* Accueils membre et administration : toujours 3 colonnes en mode PC. */
@media (min-width: 851px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Bouton de déconnexion mis en évidence dans la navigation principale. */
.main-nav .nav-logout {
    color: #ffe5e9;
    border-color: rgba(255, 82, 111, 0.58);
    background: linear-gradient(135deg, rgba(193, 35, 62, 0.9), rgba(124, 18, 38, 0.94));
    box-shadow: 0 8px 22px rgba(131, 18, 39, 0.22);
    font-weight: 800;
}

.main-nav .nav-logout:hover,
.main-nav .nav-logout:focus-visible {
    color: #ffffff;
    border-color: rgba(255, 130, 149, 0.9);
    background: linear-gradient(135deg, #dc3654, #9f1833);
    box-shadow: 0 10px 26px rgba(173, 27, 54, 0.34);
}

/* Bouton Discord placé à côté du bouton de déconnexion. */
.main-nav .nav-discord {
    gap: 7px;
    color: #ffffff;
    border-color: rgba(142, 152, 255, 0.55);
    background: #5865f2;
    box-shadow: 0 8px 20px rgba(88, 101, 242, 0.24);
    font-weight: 800;
}

.main-nav .nav-discord svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.main-nav .nav-discord:hover,
.main-nav .nav-discord:focus-visible {
    color: #ffffff;
    border-color: rgba(190, 196, 255, 0.9);
    background: #6d78f5;
    box-shadow: 0 10px 24px rgba(88, 101, 242, 0.38);
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
}


/* Administration des macros Discord : même présentation que les guides, sans lien web. */
.macro-editor-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.macro-fields textarea {
    min-height: 190px;
}

.macro-image-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.macro-image-fields label {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.025);
}

.macro-image-fields small {
    color: var(--muted);
    line-height: 1.4;
}

.macro-image-fields input[type="file"] {
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px dashed rgba(141, 92, 255, 0.48);
    border-radius: 12px;
    background: rgba(141, 92, 255, 0.06);
    color: var(--muted);
}

.macro-remove-image {
    justify-self: start;
}

.macro-preview-embed {
    min-height: 250px;
}

.macro-preview-embed > strong[data-preview-title] {
    display: block;
    margin-bottom: 9px;
    color: #f2f3f5;
    font-size: 1rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.macro-preview-embed img {
    display: block;
    width: 100%;
    max-height: 360px;
    margin-top: 15px;
    border-radius: 5px;
    object-fit: cover;
    background: #1e1f22;
}

.macro-preview-embed img[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .macro-editor-grid,
    .macro-image-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .macro-remove-image {
        width: 100%;
    }
}

/* Réinitialisation du mot de passe */
.auth-help-link {
    margin-top: 18px;
    text-align: center;
}

.auth-help-link a {
    color: #c9bcff;
    font-weight: 800;
    text-underline-offset: 4px;
}

.auth-help-link a:hover,
.auth-help-link a:focus-visible {
    color: var(--text);
}

.password-reset-heading {
    margin-bottom: 24px;
}

.password-reset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.password-reset-card {
    position: relative;
    min-width: 0;
}

.password-reset-card h2 {
    padding-right: 48px;
}

.password-reset-step {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(141, 92, 255, 0.45);
    border-radius: 50%;
    color: #e5ddff;
    background: rgba(141, 92, 255, 0.18);
    font-weight: 900;
}

.reset-code-input {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 850;
}

.password-reset-admin-card {
    margin-bottom: 28px;
}

.password-reset-admin-code {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.password-reset-admin-code code {
    padding: 8px 12px;
    border: 1px solid rgba(100, 215, 165, 0.45);
    border-radius: 10px;
    color: #ddfff0;
    background: rgba(100, 215, 165, 0.12);
    font-size: 1rem;
    letter-spacing: 0.12em;
}

.password-reset-request-meta {
    display: grid;
    gap: 3px;
}

@media (max-width: 820px) {
    .password-reset-grid {
        grid-template-columns: 1fr;
    }
}

/* Recherche assistée de l'ID Lodestone */
.lodestone-lookup {
    display: grid;
    gap: 14px;
    margin: 20px 0;
    padding: 16px;
    border: 1px solid rgba(141, 92, 255, 0.34);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(141, 92, 255, 0.09), rgba(255, 255, 255, 0.025));
}

.lodestone-lookup-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lodestone-lookup-heading strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.98rem;
}

.lodestone-lookup-heading p {
    margin: 0;
    line-height: 1.45;
}

.lodestone-lookup-panel {
    display: grid;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lodestone-lookup-panel[hidden] {
    display: none;
}

.lodestone-lookup-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.lodestone-lookup-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.lodestone-lookup-help {
    flex: 1 1 240px;
    font-size: 0.79rem;
    line-height: 1.45;
}

.lodestone-lookup-status {
    min-height: 1.35em;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.lodestone-lookup-status:empty {
    display: none;
}

.lodestone-lookup-status.is-error {
    color: #ff9aac;
}

.lodestone-lookup-status.is-success {
    color: #87e7bd;
}

.lodestone-lookup-results {
    display: grid;
    gap: 12px;
}

.lodestone-result-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(141, 92, 255, 0.28);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(12, 13, 24, 0.94), rgba(8, 9, 15, 0.78));
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.lodestone-result-identity {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    gap: 16px;
}

.lodestone-result-avatar {
    width: 76px;
    height: 76px;
    border: 1px solid rgba(141, 92, 255, 0.55);
    border-radius: 18px;
    object-fit: cover;
    background: rgba(141, 92, 255, 0.12);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.lodestone-result-avatar-placeholder {
    display: grid;
    place-items: center;
    color: #eee8ff;
    font-size: 1.35rem;
    font-weight: 900;
}

.lodestone-result-details {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.lodestone-result-details strong {
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.25;
    overflow-wrap: break-word;
}

.lodestone-result-details .muted {
    font-size: 0.91rem;
    line-height: 1.35;
    overflow-wrap: break-word;
}

.lodestone-result-id {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    margin-top: 2px;
    padding: 5px 9px;
    border: 1px solid rgba(141, 92, 255, 0.3);
    border-radius: 8px;
    color: #ded6ff;
    background: rgba(141, 92, 255, 0.1);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.lodestone-result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 190px));
    justify-content: end;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lodestone-result-actions .button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    text-align: center;
}

input.is-lodestone-filled {
    border-color: rgba(100, 215, 165, 0.82) !important;
    box-shadow: 0 0 0 3px rgba(100, 215, 165, 0.14) !important;
}

@media (max-width: 720px) {
    .lodestone-lookup-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .lodestone-lookup-heading .button,
    .lodestone-result-actions .button {
        width: 100%;
    }

    .lodestone-lookup-fields {
        grid-template-columns: 1fr;
    }

    .lodestone-result-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }
}

@media (max-width: 520px) {
    .lodestone-result-card {
        padding: 15px;
    }

    .lodestone-result-identity {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 12px;
    }

    .lodestone-result-avatar {
        width: 64px;
        height: 64px;
        border-radius: 15px;
    }

    .lodestone-result-actions {
        grid-template-columns: 1fr;
    }
}

/* Event position choices */
@media (max-width: 850px) {
    .position-choice-grid {
        grid-template-columns: repeat(4, minmax(52px, 1fr));
    }
}

@media (max-width: 480px) {
    .position-choice-grid {
        grid-template-columns: repeat(2, minmax(70px, 1fr));
    }

    .current-response-summary {
        justify-items: start;
    }
}

/* Galerie de sélection des événements côté membre */
.member-event-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.member-event-gallery-card {
    display: block;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.member-event-gallery-card:hover,
.member-event-gallery-card:focus-visible {
    border-color: rgba(141, 92, 255, 0.62);
    background: rgba(141, 92, 255, 0.055);
    transform: translateY(-3px);
}

.member-event-gallery-card:focus-visible {
    outline: 3px solid rgba(141, 92, 255, 0.28);
    outline-offset: 3px;
}

.member-event-gallery-image-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.04);
}

.member-event-gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-event-gallery-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 16px 17px 17px;
}

.member-event-gallery-title-row h2 {
    min-width: 0;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.member-event-gallery-title-row .response-saved-badge {
    flex-shrink: 0;
}

.member-event-detail-list {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 980px) {
    .member-event-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .member-event-gallery {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .member-event-gallery-title-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Event answer page: status + saved response grouped on the event image. */
.member-event-status-stack {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
    max-width: calc(100% - 24px);
}

.member-event-status-stack .member-event-state-inline {
    position: static;
    top: auto;
    right: auto;
}

.response-saved-badge-overlay {
    min-height: 30px;
    border: 1px solid rgba(218, 255, 239, 0.22);
    color: #ddfff0;
    background: rgba(31, 101, 76, 0.88);
    backdrop-filter: blur(12px);
}

.member-event-gallery-title-row {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
}

.member-event-gallery-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.member-event-gallery-dates span {
    min-width: 0;
}

@media (max-width: 460px) {
    .member-event-status-stack {
        top: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
}

/* Member home: keep the remaining menu cards on two columns on desktop. */
@media (min-width: 651px) {
    .dashboard-grid.home-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Bibliothèque d'images réutilisables pour les événements et sondages */
.event-image-picker {
    display: grid;
    gap: 12px;
}

.event-image-field select {
    width: 100%;
    min-height: 48px;
}

.event-image-picker-preview {
    overflow: hidden;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.event-image-picker-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-image-picker-empty {
    padding: 18px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
    text-align: center;
}
