:root {
    --bg: #f8faff;
    --surface: #ffffff;
    --surface-soft: #f4f6ff;
    --line: #e5ebf6;
    --line-strong: #dbe3f2;
    --text: #101735;
    --muted: #66718f;
    --muted-strong: #465373;
    --primary: #5862ff;
    --primary-strong: #3944e7;
    --primary-soft: #eef0ff;
    --green: #13a05f;
    --green-soft: #e8f8ef;
    --blue: #2567ff;
    --blue-soft: #eaf1ff;
    --purple: #6557ff;
    --purple-soft: #f0eeff;
    --orange: #d98216;
    --orange-soft: #fff2df;
    --amber: #c98212;
    --amber-soft: #fff5df;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --shadow: 0 18px 42px rgba(36, 50, 105, 0.08);
    --shadow-soft: 0 10px 26px rgba(36, 50, 105, 0.06);
    --radius: 8px;
    --radius-lg: 12px;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg);
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 78% 4%, rgba(88, 98, 255, 0.07), transparent 26rem),
        linear-gradient(180deg, #fbfcff 0%, var(--bg) 46%, #ffffff 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon,
.section-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
}

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

.app-shell {
    display: grid;
    grid-template-columns: 266px minmax(0, 1fr) 330px;
    grid-template-rows: 80px minmax(0, 1fr);
    min-height: 100vh;
}

.app-shell--without-right-rail {
    grid-template-columns: 266px minmax(0, 1fr);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 266px minmax(360px, 544px) minmax(320px, 1fr);
    align-items: center;
    gap: 24px;
    height: 80px;
    padding: 0 22px 0 18px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.brand-block {
    display: flex;
    align-items: center;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-logo {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--primary);
    background: #ffffff;
    border: 1px solid #dbe0ff;
    border-radius: 8px;
    box-shadow: inset 0 0 0 2px rgba(88, 98, 255, 0.08), 0 8px 22px rgba(88, 98, 255, 0.14);
}

.brand-logo .icon {
    width: 28px;
    height: 28px;
}

.brand strong {
    display: block;
    color: #081129;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: 0;
}

.brand small {
    display: block;
    margin-top: 4px;
    color: #62708d;
    font-size: 13px;
    white-space: nowrap;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 10px;
    color: var(--muted-strong);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.searchbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    height: 44px;
    padding: 0 10px 0 16px;
    color: #526180;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 24px rgba(32, 46, 90, 0.05);
}

.searchbar .icon {
    width: 20px;
    height: 20px;
}

.searchbar input {
    min-width: 0;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
}

.searchbar input::placeholder {
    color: #65718e;
    opacity: 1;
}

.shortcut-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 30px;
    padding: 0 8px;
    color: #61708f;
    background: #f8faff;
    border: 1px solid var(--line);
    border-radius: 7px;
    cursor: pointer;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    min-width: 0;
}

.dashboard-link,
.icon-button,
.profile-button,
.auth-link {
    color: #2f3c5f;
}

.dashboard-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.icon-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    color: #ffffff;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.28);
}

.push-permission-prompt {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 120;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 10px;
    width: min(420px, calc(100vw - 28px));
    padding: 12px;
    color: #17213d;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.push-permission-prompt[hidden] {
    display: none;
}

.push-permission-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 12px;
}

.push-permission-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.push-permission-copy strong {
    font-size: 13px;
    font-weight: 900;
}

.push-permission-copy small {
    color: #66718f;
    font-size: 12px;
    line-height: 1.3;
}

.push-permission-primary {
    min-height: 34px;
    padding: 0 12px;
    color: #ffffff;
    background: var(--primary);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.push-permission-close {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #8a94ab;
    background: transparent;
    cursor: pointer;
}

.push-permission-close .icon {
    width: 18px;
    height: 18px;
}

@media (max-width: 560px) {
    .push-permission-prompt {
        right: 12px;
        bottom: 12px;
        grid-template-columns: 34px minmax(0, 1fr) 28px;
        width: calc(100vw - 24px);
    }

    .push-permission-primary {
        grid-column: 1 / -1;
        width: 100%;
    }

    .push-permission-icon {
        width: 34px;
        height: 34px;
    }
}

.profile-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    cursor: pointer;
}

.profile-menu {
    position: relative;
    flex: 0 0 auto;
}

.profile-button .profile-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #1723a9;
    font-weight: 800;
    background: var(--primary-soft);
    border-radius: 50%;
}

.profile-button strong {
    max-width: 138px;
    overflow: hidden;
    color: #17213d;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 80;
    display: none;
    min-width: 236px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.profile-menu.is-open .profile-popover {
    display: grid;
    gap: 6px;
}

.profile-email {
    overflow: hidden;
    padding: 8px 10px 10px;
    color: #66718f;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid #eef1f7;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    font-weight: 800;
    border-radius: var(--radius);
}

.auth-link {
    white-space: nowrap;
}

.auth-link-primary {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 10px 22px rgba(88, 98, 255, 0.18);
}

.auth-link.auth-link-primary:hover {
    color: #ffffff;
    background: var(--primary-strong);
}

.sidebar {
    position: sticky;
    top: 80px;
    z-index: 35;
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    padding: 30px 18px 18px;
    background: rgba(255, 255, 255, 0.86);
    border-right: 1px solid var(--line);
}

.new-debate-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    color: #ffffff;
    font-weight: 800;
    background: linear-gradient(135deg, #4e6bff 0%, #7358ff 100%);
    border-radius: var(--radius);
    box-shadow: 0 14px 28px rgba(88, 98, 255, 0.25);
    cursor: pointer;
}

.primary-nav {
    display: grid;
    gap: 6px;
    margin-top: 24px;
}

.nav-item,
.theme-pill {
    display: flex;
    align-items: center;
    min-width: 0;
    color: #182443;
    font-weight: 700;
}

.nav-item {
    gap: 14px;
    height: 44px;
    padding: 0 14px;
    border-radius: var(--radius);
}

.nav-item .icon,
.theme-pill .icon {
    color: #647292;
}

.nav-item.is-active {
    color: #2432bf;
    background: linear-gradient(90deg, #eef1ff 0%, rgba(246, 247, 255, 0.5) 100%);
}

.nav-item.is-active .icon {
    color: var(--primary);
}

.theme-nav {
    margin-top: 54px;
}

.theme-nav h2 {
    margin: 0 0 14px;
    color: #66718f;
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
}

.theme-list {
    display: grid;
    gap: 8px;
}

.theme-pill {
    gap: 12px;
    height: 40px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding: 22px 4px 0;
    color: #697693;
    border-top: 1px solid rgba(229, 235, 246, 0.8);
}

.sidebar-footer strong {
    color: #56617e;
    font-weight: 600;
}

.sidebar-footer a,
.sidebar-footer span {
    font-size: 12px;
}

.page-content {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    padding: 20px 32px 16px;
}

.welcome-panel {
    position: relative;
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 190px;
    gap: 18px;
    min-height: 146px;
    overflow: hidden;
    padding: 22px 24px;
    background:
        radial-gradient(circle at 98% 10%, rgba(115, 88, 255, 0.14), transparent 15rem),
        linear-gradient(135deg, #ffffff 0%, #ffffff 62%, #f5f4ff 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.welcome-panel::after {
    position: absolute;
    inset: auto 68px -92px auto;
    width: 330px;
    height: 220px;
    content: "";
    border: 1px solid rgba(207, 213, 246, 0.8);
    border-radius: 50%;
    transform: rotate(-25deg);
}

.welcome-emoji {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    font-size: 38px;
    background: linear-gradient(180deg, #f7f8ff 0%, #eef1ff 100%);
    border-radius: 50%;
}

.welcome-content {
    min-width: 0;
}

.welcome-content h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
    letter-spacing: 0;
}

.welcome-content p {
    margin: 8px 0 14px;
    color: #485574;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(138px, 1fr));
    gap: 22px;
    max-width: 560px;
}

.stat-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    min-height: 52px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.stat-icon {
    display: grid;
    grid-row: 1 / 3;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 50%;
}

.stat-card strong {
    font-size: 18px;
    line-height: 1.1;
}

.stat-card span:not(.stat-icon) {
    color: #66718f;
    font-size: 12px;
}

.welcome-art {
    position: relative;
    min-width: 160px;
}

.chat-bubble {
    position: absolute;
    right: 22px;
    top: 18px;
    display: grid;
    gap: 9px;
    width: 78px;
    height: 58px;
    padding: 17px 17px 0;
    background: linear-gradient(135deg, #bfc4ff 0%, #aeb5ff 100%);
    border-radius: 29px 29px 29px 8px;
    box-shadow: 0 16px 34px rgba(88, 98, 255, 0.22);
}

.chat-bubble span {
    display: block;
    height: 4px;
    background: rgba(255, 255, 255, 0.82);
    border-radius: 999px;
}

.chat-bubble span:last-child {
    width: 70%;
}

.welcome-art i {
    position: absolute;
    display: block;
    width: 9px;
    height: 9px;
    background: rgba(255, 255, 255, 0.9);
    clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%);
}

.welcome-art i:nth-child(2) {
    top: 34px;
    left: 12px;
}

.welcome-art i:nth-child(3) {
    top: 12px;
    left: 54px;
}

.welcome-art i:nth-child(4) {
    bottom: 22px;
    left: 38px;
}

.content-section {
    margin-top: 16px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 32px;
}

.section-heading h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: 0;
}

.section-icon {
    color: #d98216;
}

.section-link {
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.debate-grid,
.premium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.debate-grid {
    margin-top: 8px;
}

.debate-card,
.premium-card,
.feature-card,
.metric-card,
.mini-panel,
.recommendation-panel,
.mediator-panel,
.category-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.debate-card {
    position: relative;
    min-height: 184px;
    overflow: hidden;
    padding: 12px 12px 44px;
}

[data-card-href] {
    cursor: pointer;
}

.debate-card::before,
.premium-card::before {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
    background:
        radial-gradient(circle at 68% 22%, rgba(88, 98, 255, 0.14), transparent 0.18rem),
        radial-gradient(circle at 87% 12%, rgba(88, 98, 255, 0.08), transparent 0.16rem);
}

.debate-copy {
    position: relative;
    z-index: 1;
    max-width: 61%;
    min-width: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    border-radius: 7px;
}

.badge-green {
    color: #0a8d4f;
    background: var(--green-soft);
}

.badge-blue {
    color: var(--blue);
    background: var(--blue-soft);
}

.badge-purple {
    color: var(--purple);
    background: var(--purple-soft);
}

.badge-orange {
    color: var(--orange);
    background: var(--orange-soft);
}

.debate-card h3,
.premium-card h3,
.recommendation-item strong,
.feature-card h3 {
    color: #101735;
    letter-spacing: 0;
}

.debate-card h3 {
    margin: 10px 0 7px;
    font-size: 14px;
    line-height: 1.22;
}

.debate-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #33405f;
    font-size: 11px;
    line-height: 1.38;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.debate-sides {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 18px;
    color: #4f5c7a;
    font-size: 10px;
    font-weight: 700;
}

.debate-sides span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.debate-sides .icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.debate-sides strong {
    color: #77829b;
    font-size: 9px;
}

.debate-illustration {
    position: absolute;
    top: 0px;
    right: 0px;
    z-index: 0;
    width: 70%;
    max-width: 219px;
    height: 175px;
    object-fit: contain;
    object-position: right center;
}

.card-footer {
    position: absolute;
    right: 12px;
    bottom: 10px;
    left: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #5f6b88;
    font-size: 10px;
    font-weight: 700;
}

.card-footer span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.card-footer .icon {
    width: 14px;
    height: 14px;
}

.trust {
    color: var(--green);
}

.open-button,
.premium-footer button,
.premium-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    height: 26px;
    margin-left: auto;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #dce3ff;
    border-radius: 7px;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(88, 98, 255, 0.07);
}

.premium-section {
    margin-top: 14px;
}

.premium-grid {
    margin-top: 8px;
}

.premium-card {
    position: relative;
    min-height: 154px;
    overflow: hidden;
    padding: 12px 12px 42px;
    border-color: #ffd9a3;
    background:
        radial-gradient(circle at 75% 28%, rgba(255, 196, 113, 0.16), transparent 7rem),
        #ffffff;
}

.premium-copy {
    position: relative;
    z-index: 1;
    max-width: 62%;
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 4px 9px;
    color: #f08016;
    font-size: 11px;
    font-weight: 800;
    background: var(--orange-soft);
    border-radius: 7px;
}

.premium-badge .icon {
    width: 14px;
    height: 14px;
}

.premium-card h3 {
    margin: 10px 0 7px;
    font-size: 15px;
    line-height: 1.18;
}

.premium-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #33405f;
    font-size: 11px;
    line-height: 1.38;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.premium-illustration {
    position: absolute;
    top: 22px;
    right: 7px;
    width: 45%;
    max-width: 176px;
    height: 94px;
    object-fit: contain;
    object-position: right center;
}

.premium-footer {
    position: absolute;
    right: 12px;
    bottom: 10px;
    left: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #77829b;
    font-size: 10px;
}

.premium-footer strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #273453;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.premium-footer strong .icon {
    width: 18px;
    height: 18px;
}

.premium-footer button,
.premium-footer a {
    min-width: 72px;
    background: #f4f1ff;
    border-color: transparent;
}

.categories-section {
    margin-top: 12px;
}

.explore-content {
    padding-bottom: 42px;
}

.explore-hero .welcome-emoji .icon {
    width: 32px;
    height: 32px;
}

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

.explore-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) repeat(4, minmax(136px, 1fr));
    gap: 10px;
    align-items: end;
    margin-top: 14px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.explore-search,
.explore-filter {
    min-width: 0;
}

.explore-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    background: #f8faff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.explore-search .icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.explore-search input {
    width: 100%;
    min-width: 0;
    color: #16213d;
    background: transparent;
    border: 0;
    outline: 0;
}

.explore-filter {
    display: grid;
    gap: 5px;
}

.explore-filter span {
    color: #66718f;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.explore-filter select {
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    color: #16213d;
    background: #f8faff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-weight: 750;
}

.explore-section {
    scroll-margin-top: 92px;
}

.explore-section-heading {
    align-items: baseline;
}

.explore-results-count {
    color: #66718f;
    font-size: 13px;
    font-weight: 800;
}

.explore-premium-grid,
.explore-public-grid {
    margin-top: 10px;
}

.explore-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 28px 18px;
    color: #66718f;
    text-align: center;
    background: #f8faff;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
}

.explore-empty strong {
    color: #16213d;
}

.explore-load-sentinel {
    display: flex;
    justify-content: center;
    min-height: 58px;
    padding: 18px 0 0;
}

.explore-load-sentinel[hidden] {
    display: none;
}

.category-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(118px, 1fr)) 42px;
    gap: 14px;
    margin-top: 8px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    height: 52px;
    padding: 9px 12px;
}

.category-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.category-purple {
    color: var(--purple);
    background: var(--purple-soft);
}

.category-green {
    color: var(--green);
    background: var(--green-soft);
}

.category-amber {
    color: var(--amber);
    background: var(--amber-soft);
}

.category-blue {
    color: var(--blue);
    background: var(--blue-soft);
}

.category-card span:last-child {
    display: grid;
    min-width: 0;
}

.category-card strong {
    overflow: hidden;
    color: #17213d;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-card small {
    color: #65718e;
    font-size: 11px;
}

.round-next {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    align-self: center;
    color: #101735;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.categories-content {
    gap: 16px;
}

.category-catalog {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.category-catalog-card {
    display: grid;
    grid-template-rows: 138px minmax(0, 1fr) auto;
    overflow: hidden;
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.category-catalog-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f3f5ff;
    border-bottom: 1px solid var(--line);
}

.category-catalog-copy {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
}

.category-catalog-copy .category-icon {
    width: 42px;
    height: 42px;
}

.category-catalog-copy h2 {
    margin: 0 0 6px;
    color: #16213d;
    font-size: 16px;
    line-height: 1.2;
}

.category-catalog-copy p {
    margin: 0;
    color: #53607d;
    font-size: 13px;
    line-height: 1.45;
}

.category-catalog-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
}

.category-catalog-footer span {
    color: #66718f;
    font-size: 12px;
    font-weight: 800;
}

.category-catalog-footer .open-button {
    height: 30px;
    margin-left: auto;
}

.right-rail {
    grid-column: 3;
    grid-row: 2;
    min-width: 0;
    padding: 20px 22px 16px 0;
}

.rail-panel {
    display: grid;
    gap: 14px;
    padding: 18px 12px 12px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.rail-panel h2 {
    margin: 0 0 2px 12px;
    font-size: 18px;
    letter-spacing: 0;
}

.feature-card,
.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    padding: 16px;
}

.eyebrow {
    display: block;
    color: #17213d;
    font-size: 12px;
    font-weight: 800;
}

.feature-card .badge {
    margin-top: 12px;
}

.feature-card h3 {
    max-width: 220px;
    margin: 11px 0 8px;
    font-size: 14px;
    line-height: 1.25;
}

.feature-card p {
    margin: 0;
    color: #596681;
    font-weight: 600;
}

.feature-orb {
    position: absolute;
    right: 24px;
    top: 58px;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    color: var(--green);
    background: #dcf6e8;
    border-radius: 50%;
}

.feature-orb .icon {
    width: 24px;
    height: 24px;
}

.metric-card {
    min-height: 140px;
}

.metric-card strong {
    display: block;
    margin-top: 16px;
    color: var(--green);
    font-size: 26px;
    line-height: 1;
}

.metric-card span:not(.eyebrow) {
    display: block;
    margin-top: 6px;
    color: #66718f;
    font-weight: 600;
}

.metric-card small {
    display: block;
    margin-top: 18px;
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
}

.metric-line {
    position: absolute;
    right: 10px;
    bottom: 26px;
    width: 156px;
    height: 74px;
    overflow: visible;
}

.metric-line path {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    filter: drop-shadow(0 10px 14px rgba(88, 98, 255, 0.16));
}

.metric-line circle {
    fill: var(--primary);
}

.mini-panel {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 16px;
}

.premium-token {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: #c97910;
    background: var(--orange-soft);
    border-radius: 50%;
}

.mini-panel strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
    line-height: 1;
}

.mini-panel p {
    margin: 5px 0 0;
    color: #66718f;
}

.mini-panel > a {
    color: #526180;
}

.recommendation-panel {
    padding: 14px 16px 4px;
}

.recommendation-panel h3 {
    margin: 0 0 8px;
    font-size: 13px;
}

.recommendation-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    min-height: 74px;
    border-top: 1px solid var(--line);
}

.recommendation-item:first-of-type {
    border-top: 0;
}

.recommendation-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.recommendation-item span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.recommendation-item .badge {
    width: fit-content;
    min-height: 20px;
    padding: 4px 8px;
    font-size: 10px;
}

.recommendation-item strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.recommendation-item small {
    color: #65718e;
    font-weight: 700;
}

.mediator-panel {
    position: relative;
    min-height: 158px;
    padding: 18px 18px 16px;
    background:
        radial-gradient(circle at 22px 22px, rgba(88, 98, 255, 0.12), transparent 2.8rem),
        linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
}

.mediator-panel > span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--primary);
    vertical-align: middle;
}

.mediator-panel h3 {
    display: inline-block;
    margin: 0 0 0 8px;
    font-size: 14px;
}

.mediator-panel p {
    margin: 12px 0 14px;
    color: #24304f;
    line-height: 1.55;
}

.mediator-panel a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-weight: 800;
}

.mediator-panel a .icon {
    width: 16px;
    height: 16px;
}

.is-hidden {
    display: none !important;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 14px;
    color: #ffffff;
    font-weight: 700;
    background: #17213d;
    border-radius: var(--radius);
    box-shadow: 0 18px 40px rgba(16, 23, 53, 0.22);
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: hover) {
    .nav-item,
    .theme-pill,
    .dashboard-link,
    .profile-button,
    .auth-link,
    .category-card,
    .recommendation-item,
    .section-link,
    .mediator-panel a {
        transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
    }

    .debate-card,
    .premium-card,
    .feature-card,
    .metric-card,
    .mini-panel,
    .category-card {
        transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    }

    .nav-item:hover,
    .theme-pill:hover,
    .category-card:hover,
    .recommendation-item:hover {
        color: var(--primary);
    }

    .debate-card:hover,
    .premium-card:hover,
    .category-card:hover {
        border-color: #cfd7ff;
        box-shadow: var(--shadow);
        transform: translateY(-2px);
    }

    .icon-button:hover,
    .shortcut-key:hover,
    .profile-popover-link:hover,
    .auth-link:hover,
    .open-button:hover,
    .premium-footer button:hover,
    .premium-footer a:hover,
    .round-next:hover {
        background: var(--primary-soft);
    }
}

@media (max-width: 1420px) {
    .app-shell {
        grid-template-columns: 246px minmax(0, 1fr) 306px;
    }

    .app-shell--without-right-rail {
        grid-template-columns: 246px minmax(0, 1fr);
    }

    .topbar {
        grid-template-columns: 246px minmax(320px, 500px) minmax(280px, 1fr);
    }

    .page-content {
        padding-inline: 24px;
    }

    .debate-grid,
    .premium-grid {
        gap: 10px;
    }

    .card-footer {
        gap: 8px;
    }
}

@media (max-width: 1220px) {
    .app-shell {
        grid-template-columns: 240px minmax(0, 1fr);
        grid-template-rows: 80px auto auto;
    }

    .topbar {
        grid-template-columns: 240px minmax(280px, 1fr) auto;
    }

    .right-rail {
        grid-column: 2;
        grid-row: 3;
        padding: 0 24px 24px;
    }

    .rail-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .rail-panel h2,
    .headline-panel h2 {
        grid-column: 1 / -1;
    }

    .mediator-panel {
        grid-column: 1 / -1;
    }

    .dashboard-link span {
        display: none;
    }

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

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

    .explore-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1020px) {
    .debate-grid,
    .premium-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .welcome-panel {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .welcome-art {
        display: none;
    }

    .category-row {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .category-card {
        flex: 0 0 160px;
    }

    .round-next {
        flex: 0 0 42px;
    }
}

@media (max-width: 860px) {
    .app-shell {
        display: block;
    }

    .topbar {
        position: sticky;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        grid-template-rows: auto;
        align-items: center;
        height: auto;
        min-height: 80px;
        gap: 12px;
        padding: 12px 16px;
    }

    /* On éclate le bloc marque pour placer chaque élément dans la grille :
       menu à gauche, logo centré, actions à droite. */
    .brand-block {
        display: contents;
    }

    .brand {
        grid-column: 2;
        justify-self: center;
    }

    .brand strong {
        font-size: 19px;
    }

    .brand small,
    .dashboard-link {
        display: none;
    }

    .sidebar-toggle {
        display: inline-flex;
        grid-column: 1;
        justify-self: start;
    }

    .searchbar {
        display: none;
    }

    .shortcut-key {
        display: none;
    }

    .top-actions {
        grid-column: 3;
        justify-self: end;
        justify-content: flex-end;
        gap: 6px;
    }

    .debate-header-illustration {
        display: none;
    }

    .icon-button {
        width: 36px;
        height: 36px;
    }

    .profile-button .profile-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .profile-button strong,
    .auth-link-primary {
        display: none;
    }

    .profile-button > .icon {
        display: none;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 70;
        width: min(280px, calc(100vw - 42px));
        height: 100vh;
        background: #ffffff;
        transform: translateX(-105%);
        box-shadow: 26px 0 60px rgba(16, 23, 53, 0.22);
        transition: transform 180ms ease;
    }

    .sidebar.debate-nav {
        background: #ffffff;
    }

    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .app-shell.sidebar-open::after {
        position: fixed;
        inset: 0;
        z-index: 60;
        content: "";
        background: rgba(16, 23, 53, 0.36);
    }

    .page-content,
    .right-rail {
        padding: 18px 16px;
    }

    .welcome-panel {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 14px;
        padding: 18px;
    }

    .welcome-emoji {
        width: 56px;
        height: 56px;
        font-size: 30px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

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

    .stat-card {
        grid-template-columns: 1fr;
        justify-items: start;
        padding: 10px;
    }

    .stat-icon {
        grid-row: auto;
        width: 30px;
        height: 30px;
        margin-bottom: 6px;
    }

    .rail-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 660px) {
    .debate-grid,
    .premium-grid {
        grid-template-columns: 1fr;
    }

    .explore-toolbar {
        grid-template-columns: 1fr;
    }

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

    .category-catalog {
        grid-template-columns: 1fr;
    }

    .category-catalog-card {
        grid-template-rows: 126px minmax(0, 1fr) auto;
    }

    .welcome-panel {
        display: block;
    }

    .welcome-emoji {
        margin-bottom: 12px;
    }

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

    .stat-card {
        grid-template-columns: 36px minmax(0, 1fr);
        justify-items: stretch;
    }

    .stat-icon {
        grid-row: 1 / 3;
        margin-bottom: 0;
    }

    .debate-copy,
    .premium-copy {
        max-width: 64%;
    }

    .card-footer {
        flex-wrap: wrap;
    }

    .open-button {
        min-width: 100%;
        margin-left: 0;
    }

    .debate-card {
        min-height: 214px;
    }

    .premium-card {
        min-height: 178px;
    }

    .premium-footer {
        flex-wrap: wrap;
    }

    .premium-footer button,
    .premium-footer a {
        margin-left: 0;
    }
}

@media (max-width: 460px) {
    .brand-logo {
        width: 34px;
        height: 34px;
    }

    .brand strong {
        overflow: hidden;
        max-width: 108px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .debate-copy,
    .premium-copy {
        max-width: 100%;
    }

    .debate-illustration,
    .premium-illustration {
        opacity: 0.22;
        right: -12px;
        width: 52%;
    }

    .metric-line {
        width: 130px;
        opacity: 0.8;
    }
}

/* Debate room */
.debate-shell {
    --composer-dock-left: calc(276px + 34px);
    --composer-dock-right: calc(330px + 34px);
    grid-template-columns: 276px minmax(0, 1fr) 330px;
}

.debate-content {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    padding: 32px 34px var(--debate-content-bottom, 16px);
}

.debate-content--with-composer {
    --debate-content-bottom: 116px;
}

.debate-summary {
    grid-column: 3;
    grid-row: 2;
    min-width: 0;
    padding: 26px 22px 16px 0;
}

.debate-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.debate-header h1,
.create-hero h1 {
    margin: 0;
    color: #111936;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: 0;
}

.debate-header p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 0;
    color: #66718f;
    font-weight: 600;
}

.debate-header p .icon {
    width: 15px;
    height: 15px;
}

.debate-participant-links {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.debate-participant-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #34405f;
    font-weight: 850;
    text-decoration: none;
}

.debate-participant-link > span {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: #4e35cc;
    background: var(--primary-soft);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 900;
}

.debate-participant-link:hover,
.debate-participant-link:focus-visible {
    color: var(--primary);
    text-decoration: underline;
    outline: none;
}

.debate-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.debate-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.debate-tabs-list {
    display: none;
    gap: 6px;
}

.debate-tabs-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.debate-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
}

.debate-tab .icon {
    width: 16px;
    height: 16px;
}

.debate-tab.is-active {
    color: var(--primary);
    background: var(--primary-soft);
}

.outline-button,
.icon-button.framed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    color: #34405f;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.outline-button {
    gap: 8px;
    padding: 0 14px;
    font-weight: 800;
}

.icon-button.framed {
    width: 38px;
}

.debate-options {
    position: relative;
}

.debate-options-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 85;
    min-width: 220px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.debate-options-menu[hidden] {
    display: none;
}

.danger-menu-item,
.menu-note {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--radius);
    font-weight: 800;
    text-align: left;
}

.danger-menu-item {
    color: #b42318;
    background: transparent;
    cursor: pointer;
}

.danger-menu-item:hover,
.danger-menu-item:focus {
    background: #fff1f0;
    outline: 0;
}

.menu-note {
    color: #66718f;
    font-size: 12px;
    line-height: 1.35;
}

/* --- Lien de partage (menu burger) --- */
.share-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--radius);
    color: var(--primary);
    background: transparent;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.share-menu-item:hover,
.share-menu-item:focus {
    background: var(--primary-soft);
    outline: 0;
}

.share-menu-item .icon {
    width: 18px;
    height: 18px;
}

.share-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin: 6px 4px 8px;
}

.share-result[hidden] {
    display: none;
}

.share-result input {
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 12px;
    color: #34405f;
    background: #f7f8ff;
}

.share-copy-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.share-copy-button:hover {
    background: #e2e6ff;
}

.share-copy-button .icon {
    width: 16px;
    height: 16px;
}

.share-hint {
    grid-column: 1 / -1;
    margin: 0;
    color: #66718f;
    font-size: 11px;
    line-height: 1.35;
}

/* --- Modale de partage --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(20, 27, 56, 0.55);
    backdrop-filter: blur(3px);
}

.modal-overlay[hidden] {
    display: none;
}

.modal-card {
    width: min(480px, 100%);
    padding: 22px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(20, 27, 56, 0.35);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-head h2 {
    margin: 0;
    font-size: 18px;
    color: #16213d;
}

.modal-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: #8a94ab;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.modal-close:hover {
    background: #f1f3fb;
    color: #16213d;
}

.modal-close .icon {
    width: 22px;
    height: 22px;
}

.modal-text {
    margin: 10px 0 16px;
    color: #66718f;
    line-height: 1.45;
}

.share-copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.share-copy-row input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 13px;
    color: #34405f;
    background: #f7f8ff;
}

.share-copy-row .share-copy-button {
    width: 44px;
    height: 44px;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
}

.danger-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

.danger-button {
    color: #b42318;
    background: #fff1f0;
    border: 1px solid #ffd7d2;
}

.danger-button:hover {
    background: #ffe4e1;
}

.danger-button .icon {
    width: 17px;
    height: 17px;
}

.ghost-button {
    color: #34405f;
    background: #f1f3fb;
    border: 1px solid var(--line);
}

.ghost-button:hover {
    background: #e7eaf6;
}

/* --- Page publique de partage --- */
.share-shell {
    min-height: 100vh;
    background: #f5f6fb;
}

.share-topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.share-brand-text {
    display: grid;
    line-height: 1.15;
}

.share-brand-text strong {
    font-size: 18px;
    color: #16213d;
}

.share-brand-text small {
    color: #8a94ab;
    font-size: 12px;
}

.share-main {
    width: min(900px, 100%);
    margin: 0 auto;
    padding: 28px 18px 64px;
}

.share-main--centered {
    display: grid;
    place-items: center;
    min-height: 60vh;
}

.share-debate-header {
    margin-bottom: 22px;
}

.share-debate-header h1 {
    margin: 12px 0 6px;
    font-size: 26px;
    color: #16213d;
}

.share-debate-header p {
    margin: 0;
    color: #66718f;
    font-weight: 600;
}

.share-debate-header p span {
    margin: 0 6px;
}

.share-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 12px;
    font-weight: 800;
}

.share-badge .icon {
    width: 15px;
    height: 15px;
}

.share-thread {
    gap: 10px;
}

.share-footer {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.share-footer p {
    margin: 0 0 14px;
    color: #66718f;
}

.share-missing {
    max-width: 420px;
    text-align: center;
}

.share-missing-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 50%;
}

.share-missing-icon .icon {
    width: 26px;
    height: 26px;
}

.share-missing h1 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #16213d;
}

.share-missing p {
    margin: 0 0 18px;
    color: #66718f;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    color: #ffffff;
    background: var(--primary);
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.primary-button:hover {
    background: #4751f5;
}

/* --- Landing publique Rejoins-nous --- */
body.join-body {
    background: #f7f9fc;
}

.join-page {
    min-height: 100vh;
    color: #111936;
    background: #f7f9fc;
}

.join-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 72px;
    padding: 14px max(24px, calc((100vw - 1180px) / 2));
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(219, 227, 242, 0.86);
    backdrop-filter: blur(14px);
}

.join-brand,
.join-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #16213d;
}

.join-brand span:last-child,
.join-footer-logo span:last-child {
    display: grid;
    gap: 2px;
}

.join-brand strong,
.join-footer-logo strong {
    font-size: 18px;
}

.join-brand small {
    color: #66718f;
    font-size: 12px;
    font-weight: 650;
}

.join-nav,
.join-actions,
.join-final-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.join-nav a,
.join-primary,
.join-secondary,
.join-share-link,
.join-inline-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: var(--radius);
    font-weight: 850;
}

.join-nav a {
    color: #111936;
    background: #ffffff;
    border: 1px solid #dbe3f2;
}

.join-nav a:hover,
.join-nav a:focus-visible {
    color: #111936;
    background: #f3f6ff;
    border-color: #bdc8e8;
    outline: none;
}

.join-nav a.join-nav-cta,
.join-primary,
.join-share-link {
    color: #ffffff;
    background: var(--primary);
    border: 1px solid var(--primary);
    box-shadow: 0 14px 30px rgba(88, 98, 255, 0.22);
}

.join-nav a.join-nav-cta:hover,
.join-nav a.join-nav-cta:focus-visible,
.join-primary:hover,
.join-primary:focus-visible,
.join-share-link:hover,
.join-share-link:focus-visible {
    color: #ffffff;
    background: var(--primary-strong);
    border-color: var(--primary-strong);
    outline: none;
}

.join-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 560px;
    height: calc(100vh - 104px);
    height: calc(100svh - 104px);
    max-height: 720px;
    padding: 76px max(24px, calc((100vw - 1180px) / 2)) 88px;
    color: #ffffff;
    background: linear-gradient(135deg, #0b1028 0%, #26327a 46%, #0f766e 100%);
}

.join-hero::before,
.join-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.join-hero::before {
    background-image: var(--join-hero-image);
    background-position: center;
    background-size: cover;
    filter: saturate(1.1) contrast(1.04);
    opacity: 0.36;
}

.join-hero::after {
    background:
        linear-gradient(105deg, rgba(8, 13, 31, 0.98) 0%, rgba(31, 45, 112, 0.9) 48%, rgba(12, 112, 104, 0.76) 100%),
        linear-gradient(180deg, rgba(88, 98, 255, 0.26) 0%, rgba(19, 160, 95, 0.22) 100%);
}

.join-hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 18px;
    width: min(810px, 100%);
}

.join-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    padding: 7px 12px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 850;
}

.join-kicker .icon,
.join-primary .icon,
.join-secondary .icon,
.join-share-link .icon,
.join-inline-link .icon {
    width: 17px;
    height: 17px;
}

.join-hero h1 {
    max-width: 780px;
    margin: 0;
    color: #ffffff;
    font-size: 62px;
    line-height: 1.02;
    letter-spacing: 0;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.34);
}

.join-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 20px;
    line-height: 1.55;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.28);
}

.join-actions {
    margin-top: 6px;
}

.join-primary,
.join-secondary {
    min-height: 50px;
    padding: 0 22px;
}

.join-secondary {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.42);
}

.join-secondary:hover,
.join-secondary:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.26);
    outline: none;
}

.join-reassurance {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 13px !important;
    font-weight: 780;
}

.join-section,
.join-final-cta {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 74px 24px 0;
}

.join-section-head {
    display: grid;
    gap: 8px;
    max-width: 820px;
    margin-bottom: 24px;
}

.join-section-head--split {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    max-width: none;
    gap: 18px;
}

.join-section-head span {
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
}

.join-section-head h2,
.join-final-cta h2 {
    margin: 0;
    color: #16213d;
    font-size: 34px;
    line-height: 1.14;
    letter-spacing: 0;
}

.join-section-head p,
.join-final-cta p {
    max-width: 780px;
    margin: 0;
    color: #465373;
    font-size: 15px;
    line-height: 1.65;
}

.join-step-grid,
.join-example-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.join-step-card,
.join-use-card,
.join-example-card {
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.join-step-card {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 22px;
}

.join-step-number {
    color: #99a5c0;
    font-size: 12px;
    font-weight: 900;
}

.join-step-icon,
.join-use-card > span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: var(--radius);
}

.join-step-icon .icon,
.join-use-card > span .icon {
    width: 21px;
    height: 21px;
}

.join-step-card h3,
.join-use-card strong,
.join-example-card h3 {
    margin: 0;
    color: #16213d;
    font-size: 18px;
    line-height: 1.25;
}

.join-step-card p,
.join-use-card p,
.join-example-card p {
    margin: 0;
    color: #465373;
    line-height: 1.58;
}

.join-difference-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 18px;
    align-items: stretch;
}

.join-before-after {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, #101735 0%, #26327a 52%, #0f766e 100%);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.join-before-after div {
    display: grid;
    gap: 8px;
    min-height: 142px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
}

.join-before-after > span {
    display: grid;
    place-items: center;
    color: #ffffff;
}

.join-before-after .icon {
    width: 23px;
    height: 23px;
}

.join-before-after strong {
    font-size: 16px;
}

.join-before-after p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.55;
}

.join-benefit-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 18px;
    list-style: none;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.join-benefit-list li {
    display: flex;
    gap: 10px;
    color: #27324d;
    font-weight: 720;
    line-height: 1.45;
}

.join-benefit-list .icon {
    flex: none;
    width: 18px;
    height: 18px;
    color: #13a05f;
    margin-top: 1px;
}

.join-use-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.join-use-card {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 188px;
    padding: 18px;
    color: #16213d;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.join-use-card:hover,
.join-use-card:focus-visible {
    border-color: #cfd7ff;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    outline: none;
}

.join-inline-link {
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid rgba(88, 98, 255, 0.2);
}

.join-inline-link:hover,
.join-inline-link:focus-visible {
    color: #ffffff;
    background: var(--primary);
    outline: none;
}

.join-example-card {
    overflow: hidden;
    display: grid;
    grid-template-rows: 170px minmax(0, 1fr);
}

.join-example-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #eef2fb;
}

.join-example-copy {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 16px;
}

.join-example-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.join-example-meta span {
    padding: 4px 8px;
    color: #0f766e;
    background: #dcf7ef;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.join-share-link {
    width: 100%;
    min-height: 48px;
    margin-top: 2px;
}

.join-ai-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.join-ai-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 14px 16px;
    color: #27324d;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    font-weight: 820;
}

.join-ai-feature .icon {
    flex: none;
    width: 17px;
    height: 17px;
    color: var(--primary);
}

.join-final-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    margin-top: 74px;
    padding-top: 32px;
    padding-bottom: 32px;
    color: #ffffff;
    background: linear-gradient(135deg, #101735 0%, #26327a 58%, #0f766e 100%);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.join-final-cta h2,
.join-final-cta p {
    color: #ffffff;
}

.join-final-cta > div:first-child {
    display: grid;
    gap: 10px;
}

.join-secondary--dark {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.38);
}

.join-footer {
    margin-top: 74px;
    color: #dce4f5;
    background: #101735;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.join-footer-inner,
.join-footer-bottom {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding-right: 24px;
    padding-left: 24px;
}

.join-footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr);
    gap: 48px;
    padding-top: 44px;
    padding-bottom: 34px;
}

.join-footer-brand {
    display: grid;
    align-content: start;
    gap: 14px;
}

.join-footer-logo {
    justify-self: start;
    color: #ffffff;
}

.join-footer-logo strong {
    color: #ffffff;
}

.join-footer-logo small,
.join-footer-brand p {
    color: #aeb8d0;
}

.join-footer-brand p {
    max-width: 430px;
    margin: 0;
    line-height: 1.65;
}

.join-footer-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.join-footer-links div {
    display: grid;
    align-content: start;
    gap: 10px;
}

.join-footer-links strong {
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

.join-footer-links a {
    color: #c4cde2;
    font-weight: 650;
}

.join-footer-links a:hover,
.join-footer-links a:focus-visible,
.join-footer-bottom a:hover,
.join-footer-bottom a:focus-visible {
    color: #ffffff;
    outline: none;
}

.join-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 18px;
    padding-bottom: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aeb8d0;
}

.join-footer-bottom a {
    color: #ffffff;
    font-weight: 850;
}

@media (max-width: 1080px) {
    .join-use-grid,
    .join-ai-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .join-difference-layout,
    .join-final-cta,
    .join-footer-inner {
        grid-template-columns: 1fr;
    }

    .join-final-actions {
        justify-content: start;
    }
}

@media (max-width: 900px) {
    .join-step-grid,
    .join-example-grid {
        grid-template-columns: 1fr;
    }

    .join-example-card {
        grid-template-columns: 220px minmax(0, 1fr);
        grid-template-rows: auto;
    }

    .join-section-head--split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .join-topbar {
        min-height: auto;
        padding: 12px 16px;
    }

    .join-brand small {
        display: none;
    }

    .join-nav {
        gap: 6px;
    }

    .join-nav a {
        min-height: 38px;
        padding: 0 11px;
        font-size: 13px;
    }

    .join-hero {
        min-height: 560px;
        height: auto;
        padding: 70px 18px 48px;
    }

    .join-hero h1 {
        font-size: 38px;
    }

    .join-hero p {
        font-size: 16px;
    }

    .join-actions,
    .join-final-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .join-primary,
    .join-secondary,
    .join-inline-link {
        width: 100%;
    }

    .join-section,
    .join-final-cta {
        padding-right: 16px;
        padding-left: 16px;
    }

    .join-section {
        padding-top: 52px;
    }

    .join-section-head h2,
    .join-final-cta h2 {
        font-size: 25px;
    }

    .join-before-after {
        grid-template-columns: 1fr;
    }

    .join-before-after > span {
        transform: rotate(90deg);
    }

    .join-use-grid,
    .join-ai-grid {
        grid-template-columns: 1fr;
    }

    .join-example-card {
        grid-template-columns: 1fr;
        grid-template-rows: 168px auto;
    }

    .join-footer-inner,
    .join-footer-bottom {
        padding-right: 16px;
        padding-left: 16px;
    }

    .join-footer-links {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .join-footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
}

html[data-theme="dark"] body.join-body,
html[data-theme="dark"] .join-page {
    background: var(--bg);
}

html[data-theme="dark"] .join-topbar,
html[data-theme="dark"] .join-step-card,
html[data-theme="dark"] .join-use-card,
html[data-theme="dark"] .join-example-card,
html[data-theme="dark"] .join-benefit-list,
html[data-theme="dark"] .join-ai-feature {
    background: var(--surface);
    border-color: var(--line);
}

html[data-theme="dark"] .join-brand,
html[data-theme="dark"] .join-section-head h2,
html[data-theme="dark"] .join-step-card h3,
html[data-theme="dark"] .join-use-card strong,
html[data-theme="dark"] .join-example-card h3 {
    color: var(--text);
}

html[data-theme="dark"] .join-brand small,
html[data-theme="dark"] .join-section-head p,
html[data-theme="dark"] .join-step-card p,
html[data-theme="dark"] .join-use-card p,
html[data-theme="dark"] .join-example-card p,
html[data-theme="dark"] .join-benefit-list li,
html[data-theme="dark"] .join-ai-feature {
    color: var(--muted);
}

html[data-theme="dark"] .join-nav a:not(.join-nav-cta) {
    color: var(--text);
    background: var(--surface-soft);
    border-color: var(--line);
}

html[data-theme="dark"] .join-nav a:not(.join-nav-cta):hover,
html[data-theme="dark"] .join-nav a:not(.join-nav-cta):focus-visible {
    color: #ffffff;
    background: #27324d;
    border-color: rgba(255, 255, 255, 0.18);
}

.message-thread {
    display: grid;
    gap: 8px;
}

.empty-thread,
.history-empty,
.history-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.empty-thread {
    display: grid;
    gap: 6px;
    padding: 18px;
    color: #53607d;
}

.empty-thread strong {
    color: #16213d;
}

.thread-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.participant-avatar,
.ai-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-weight: 900;
}

.avatar-purple {
    color: #4e35cc;
    background: linear-gradient(180deg, #e7dcff 0%, #cdb9ff 100%);
}

.avatar-orange {
    color: #b26109;
    background: linear-gradient(180deg, #ffe7c0 0%, #ffd49b 100%);
}

.ai-avatar {
    color: var(--primary);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.thread-body {
    min-width: 0;
}

.thread-meta {
    display: flex;
    align-items: baseline;
    gap: 16px;
    min-height: 22px;
}

.thread-meta strong {
    color: #16213d;
    font-size: 13px;
}

.thread-meta time {
    color: #8a94ab;
    font-size: 12px;
    font-weight: 600;
}

.message-delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #8a94ab;
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.message-delete-button:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.message-delete-button .icon {
    width: 15px;
    height: 15px;
}

.message-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #8a94ab;
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.message-edit-button:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.message-edit-button .icon {
    width: 15px;
    height: 15px;
}

/* Éditeur inline d'une phrase (remplace la bulle le temps de la correction). */
.message-edit-form {
    display: grid;
    gap: 10px;
    width: min(860px, 100%);
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #aeb6ff;
    border-radius: var(--radius);
    box-shadow: 0 0 0 4px rgba(88, 98, 255, 0.08);
}

.self-thread-row .message-edit-form {
    margin-left: auto;
}

.message-edit-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 240px;
    resize: none;
    overflow-y: auto;
    padding: 8px 10px;
    color: var(--text);
    font-size: 14px;
    background: #f9fbff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: 0;
}

.message-edit-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.message-edit-actions .message-edit-save {
    width: auto;
    min-width: 0;
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
}

.chat-message {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    width: min(860px, 100%);
    min-height: 66px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(29, 41, 83, 0.08);
}

.chat-message p {
    margin: 0;
    color: #17213d;
    font-size: 14px;
}

.is-deleted-message .chat-message {
    grid-template-columns: minmax(0, 1fr);
    min-height: 52px;
    color: #8a94ab;
    background: #f7f8fc;
    border-style: dashed;
    box-shadow: none;
}

.is-deleted-message .chat-message p {
    color: #8a94ab;
    font-style: italic;
}

/* Messages du participant qui consulte le fil : alignés à droite (style WhatsApp).
   L'interlocuteur reste à gauche, comme avant. */
.self-thread-row {
    grid-template-columns: minmax(0, 1fr) 46px;
    /* léger décalage pour démarquer nos bulles du bord */
    padding-left: 48px;
}

.self-thread-row .participant-avatar,
.self-thread-row .ai-avatar {
    grid-column: 2;
    grid-row: 1;
}

.self-thread-row .thread-body,
.self-thread-row .ai-analysis-card {
    grid-column: 1;
    grid-row: 1;
}

.self-thread-row .thread-meta {
    flex-direction: row-reverse;
}

/* La bulle utilisateur et son analyse IA se calent à droite. */
.self-thread-row .chat-message,
.self-thread-row .ai-analysis-card {
    margin-left: auto;
}

@media (max-width: 720px) {
    .self-thread-row {
        padding-left: 0;
    }
}

.truth-badge,
.score-pill,
.form-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.truth-green,
.score-pill.score-green {
    color: var(--green);
    background: var(--green-soft);
}

.truth-orange,
.score-pill.score-orange {
    color: var(--orange);
    background: var(--orange-soft);
}

.truth-pending {
    color: var(--primary);
    background: var(--primary-soft);
}

/* Score de véracité « non applicable » (sentinelle 9999) : rendu neutre. */
.truth-na,
.score-pill.score-na {
    color: #66718f;
    background: #eef0f6;
}

.ai-score-na {
    display: block;
    margin: 8px 0;
    font-size: 16px;
    font-weight: 800;
    color: #66718f;
}

.ai-analysis-card.is-pending {
    border-style: dashed;
    background: linear-gradient(135deg, #ffffff 0%, #f4f6ff 100%);
}

.ai-analysis-card.is-pending .ai-analysis-content {
    grid-template-columns: minmax(0, 1fr);
}

.is-pending-analysis .ai-avatar {
    color: var(--primary);
    background: var(--primary-soft);
}

.ai-analysis-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(860px, 100%);
    min-height: 124px;
    padding: 16px 18px;
    background: #e8edf6;
    border: 1px solid #d2dbeb;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.ai-analysis-head {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 24px;
}

.ai-analysis-head strong {
    color: #2432bf;
    font-size: 15px;
}

.ai-analysis-head time {
    color: #8a94ab;
    font-size: 12px;
    font-weight: 600;
}

.analysis-toggle {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--primary);
    background: var(--primary-soft);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.analysis-toggle:hover {
    background: #e2e6ff;
}

.analysis-toggle .icon {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.ai-analysis-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.ai-analysis-actions .analysis-toggle {
    margin-left: 0;
}

.analysis-details-button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--primary);
    background: var(--primary-soft);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.analysis-details-button:hover {
    background: #e2e6ff;
}

.analysis-details-button .icon {
    width: 16px;
    height: 16px;
}

.ai-analysis-card.is-collapsed .analysis-toggle .icon {
    transform: rotate(-90deg);
}

.ai-analysis-card.is-collapsed {
    min-height: 0;
}

.ai-analysis-card.is-collapsed .ai-analysis-content {
    display: none;
}

.ai-analysis-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px minmax(220px, 270px);
    gap: 22px;
}

.analysis-spinner {
    margin-left: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2.5px solid var(--primary-soft);
    border-top-color: var(--primary);
    animation: analysis-spin 0.7s linear infinite;
}

@keyframes analysis-spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Analyse en échec --- */
.ai-analysis-card.is-failed {
    border-color: #f3c9c4;
    background: linear-gradient(135deg, #ffffff 0%, #fff5f4 100%);
}

.ai-analysis-card.is-failed .ai-analysis-content {
    grid-template-columns: minmax(0, 1fr);
}

.is-failed-analysis .ai-avatar {
    color: #b42318;
    background: #fff1f0;
}

.analysis-failed-badge {
    display: grid;
    place-items: center;
    margin-left: auto;
    color: #b42318;
}

.analysis-failed-badge .icon {
    width: 20px;
    height: 20px;
}

.ai-analysis-failed-copy p {
    margin: 0;
    color: #8a3b34;
}

.ai-analysis-failed-copy p:first-child {
    font-weight: 800;
    color: #b42318;
}

.ai-analysis-error-detail {
    margin-top: 4px !important;
    font-size: 12px;
    color: #9a7b78 !important;
    word-break: break-word;
}

.analysis-retry-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    min-height: 34px;
    padding: 0 14px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
}

.analysis-retry-button:hover {
    background: #e2e6ff;
}

.analysis-retry-button .icon {
    width: 16px;
    height: 16px;
}

.ai-analysis-copy,
.ai-score {
    min-width: 0;
}

.ai-analysis-copy .thread-meta strong {
    color: #2432bf;
    font-size: 15px;
}

.ai-analysis-copy p {
    margin: 6px 0 0;
    color: #263351;
}

.ai-score,
.ai-sources {
    border-left: 1px solid #d9def0;
    padding-left: 22px;
}

.ai-score span,
.ai-sources strong {
    color: #34405f;
    font-size: 12px;
    font-weight: 800;
}

.ai-score strong {
    display: block;
    margin: 8px 0;
    font-size: 18px;
    line-height: 1;
}

.score-green {
    color: var(--green);
}

.score-orange {
    color: var(--orange);
}

.ai-score .score-pill {
    min-height: 24px;
    padding: 4px 9px;
    font-size: 11px;
}

.ai-sources ul,
.summary-list ul,
.sources-list ol {
    margin: 6px 0 0;
    padding-left: 18px;
    color: #263351;
}

.ai-sources li,
.summary-list li {
    margin-top: 3px;
}

.ai-sources a,
.sources-list a {
    display: inline-block;
    margin-top: 6px;
    color: var(--primary);
    font-weight: 800;
}

.debate-close-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 16px 0 4px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.debate-close-panel.is-closed {
    background: #f3f6ff;
    border-color: #dfe5ff;
}

.debate-close-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.debate-close-copy strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #16213d;
    font-size: 14px;
}

.debate-close-copy .icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.debate-close-copy span {
    color: #66718f;
    font-size: 13px;
    line-height: 1.45;
}

.debate-close-panel > input[type="hidden"] {
    display: none;
}

.debate-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    color: #ffffff;
    background: var(--primary);
    border: 0;
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.debate-close-button:hover,
.debate-close-button:focus {
    background: #4a48d8;
}

.debate-close-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.debate-close-button .icon {
    width: 18px;
    height: 18px;
}

.composer-dock {
    position: fixed;
    right: var(--composer-dock-right);
    bottom: 10px;
    bottom: calc(env(safe-area-inset-bottom) + 10px);
    left: var(--composer-dock-left);
    z-index: 45;
    display: grid;
    gap: 6px;
    pointer-events: none;
}

.composer-dock > * {
    pointer-events: auto;
}

.message-composer {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    /* Ancre le bouton d'envoi en bas quand la zone de saisie grandit. */
    align-items: end;
    gap: 8px;
    min-height: 48px;
    margin-top: 0;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 38px rgba(29, 41, 83, 0.12);
    backdrop-filter: blur(16px);
}

/* Saisie : bouton emoji et fenetre de selection. */
.composer-input-wrap {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 4px;
    align-items: end;
    min-width: 0;
}

.emoji-toggle {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #66718f;
    background: #f7f8ff;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
}

.emoji-toggle .icon {
    width: 18px;
    height: 18px;
}

.emoji-toggle:hover,
.emoji-toggle:focus-visible,
.emoji-toggle[aria-expanded="true"] {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #d8ddff;
}

.emoji-picker[hidden] {
    display: none;
}

.emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 24;
    width: min(316px, calc(100vw - 40px));
    padding: 8px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.emoji-picker button {
    display: grid;
    place-items: center;
    width: 100%;
    height: 32px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.emoji-picker button:hover,
.emoji-picker button:focus-visible {
    background: var(--primary-soft);
}

/* Debat simule : selecteur de la personne qui ecrit (A / B), au-dessus du champ. */
.composer-persona {
    grid-column: 1 / -1;
    order: -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0 2px 2px;
    border: 0;
}

.composer-persona-label {
    color: #66718f;
    font-size: 12px;
    font-weight: 800;
}

.persona-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    color: #34405f;
    font-size: 13px;
    font-weight: 700;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

.persona-option input {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.persona-a:has(input:checked) {
    border-color: #8b78e8;
    box-shadow: 0 0 0 2px #ece7ff;
}

.persona-b:has(input:checked) {
    border-color: #eab463;
    box-shadow: 0 0 0 2px #fdeecf;
}

.message-composer textarea {
    width: 100%;
    min-height: 32px;
    /* La hauteur suit le contenu (auto-grow JS) jusqu'à ce plafond, puis scroll interne. */
    max-height: 220px;
    resize: none;
    overflow-y: auto;
    padding: 6px 8px;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
}

.message-composer textarea::placeholder {
    color: #9aa3b8;
}

.ai-request-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px;
    color: var(--primary);
    font-weight: 900;
    background: var(--primary-soft);
    border-radius: var(--radius);
    cursor: pointer;
}

.send-button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #ffffff;
    background: linear-gradient(135deg, #5c6cff 0%, #6d57ff 100%);
    border-radius: 50%;
    box-shadow: 0 14px 30px rgba(88, 98, 255, 0.28);
    cursor: pointer;
}

.composer-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #8a94ab;
    font-size: 11px;
    font-weight: 700;
}

.composer-note .icon {
    width: 14px;
    height: 14px;
}

.composer-note-top,
.composer-note-stack {
    margin: 0 0 12px;
}

.composer-note-stack {
    display: grid;
    gap: 6px;
}

.debate-shell + .toast {
    bottom: 126px;
}

.summary-panel {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.summary-panel h2 {
    margin: 0;
    padding: 20px 24px;
    font-size: 18px;
    border-bottom: 1px solid var(--line);
}

.summary-block,
.summary-list,
.debate-mediator-panel {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

.summary-block h3,
.summary-list h3 {
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
}

.consensus-block {
    text-align: center;
}

.consensus-block h3 {
    text-align: left;
}

.consensus-gauge {
    --value: 62;
    --gauge: calc(var(--value) * 1%);
    position: relative;
    display: grid;
    place-items: center;
    width: 156px;
    height: 86px;
    margin: 18px auto 4px;
    overflow: hidden;
}

.consensus-gauge-62 {
    --value: 62;
}

.consensus-gauge::before {
    position: absolute;
    inset: 0;
    content: "";
    border: 12px solid #e8ebf4;
    border-bottom: 0;
    border-radius: 156px 156px 0 0;
}

.consensus-gauge::after {
    position: absolute;
    inset: 0;
    content: "";
    border: 12px solid var(--primary);
    border-right-color: transparent;
    border-bottom: 0;
    border-radius: 156px 156px 0 0;
    transform: rotate(calc((var(--value) - 50) * 1.8deg));
    transform-origin: 50% 100%;
}

.consensus-gauge span {
    position: relative;
    z-index: 1;
    align-self: end;
    color: #121a37;
    font-size: 28px;
    font-weight: 900;
}

.consensus-block p {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    color: #34405f;
    font-weight: 800;
}

.reliability-block {
    position: relative;
    min-height: 138px;
}

.reliability-block strong {
    display: block;
    margin-top: 16px;
    color: var(--green);
    font-size: 26px;
    line-height: 1;
}

.summary-line {
    position: absolute;
    right: 20px;
    bottom: 22px;
    width: 128px;
    height: 72px;
    overflow: visible;
}

.summary-line path {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
}

.summary-line circle {
    fill: var(--primary);
}

.summary-list header {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
}

.summary-list header > span {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
}

.summary-agreements header > span {
    color: var(--green);
}

.summary-disagreements header > span {
    color: var(--orange);
}

.sources-list header {
    grid-template-columns: 24px minmax(0, 1fr);
}

.sources-list ol {
    padding-left: 20px;
}

.sources-list li {
    margin-top: 7px;
}

.debate-mediator-panel {
    margin: 18px 14px;
    border: 1px solid var(--line);
}

.debate-nav .theme-nav {
    display: none;
}

.debate-nav .new-debate-button {
    flex: 0 0 46px;
    min-height: 46px;
    height: 46px;
    padding: 0 14px;
}

.debate-list-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.debate-list-section h2 {
    margin: 0 0 14px;
    color: #66718f;
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
}

.debate-list-card {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 16px 14px;
    background: linear-gradient(135deg, #f2f0ff 0%, #ffffff 100%);
    border: 1px solid var(--line);
    box-shadow: inset 3px 0 0 rgba(88, 98, 255, 0.38);
    border-radius: var(--radius);
}

.debate-list-card strong,
.other-debate-list strong {
    color: #16213d;
    font-size: 13px;
}

.debate-list-card span,
.other-debate-list span {
    color: #66718f;
    font-weight: 600;
}

.debate-list-card i {
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    transform: translateY(-50%);
}

.other-debate-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}

.other-debate-list a {
    display: grid;
    gap: 6px;
    padding: 12px 2px;
    border-bottom: 1px solid var(--line);
    transition: color 0.15s ease, background 0.15s ease;
}

.other-debate-list a:hover,
.other-debate-list a:focus {
    background: rgba(88, 98, 255, 0.05);
}

.view-all-debates {
    display: inline-block;
    margin-top: 20px;
    color: #34405f;
    font-weight: 700;
}

/* Debate creation */
.create-shell {
    grid-template-columns: 266px minmax(0, 1fr);
}

.create-content {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    padding: 28px 34px 36px;
}

.create-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: stretch;
    padding: 26px;
    background:
        radial-gradient(circle at 88% 18%, rgba(88, 98, 255, 0.12), transparent 16rem),
        linear-gradient(135deg, #ffffff 0%, #f6f8ff 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

/* Hero allégé (sans encart latéral) : contenu empilé sur une colonne. */
.create-hero--slim {
    grid-template-columns: 1fr;
    padding: 22px 26px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 900;
}

.create-hero h1 {
    margin-top: 12px;
    font-size: 28px;
}

.create-hero p {
    max-width: 680px;
    margin: 10px 0 0;
    color: #53607d;
    font-size: 15px;
}

.create-guardrails {
    display: grid;
    align-content: center;
    gap: 12px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.create-guardrails span {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #2b3654;
    font-weight: 800;
}

.create-guardrails .icon {
    color: var(--green);
}

.create-debate-form {
    margin-top: 18px;
}

.create-alert,
.debate-alert {
    margin-top: 16px;
}

.debate-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    border: 0;
}

.debate-type-card {
    position: relative;
    display: grid;
    gap: 12px;
    min-height: 232px;
    padding: 20px;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.debate-type-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-check {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: #c8cfdf;
}

.option-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 50%;
}

.debate-type-card strong {
    color: #111936;
    font-size: 17px;
}

.debate-type-card > span:not(.option-check):not(.option-icon) {
    color: #53607d;
}

.debate-type-card ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    color: #34405f;
    list-style: none;
}

.debate-type-card li {
    position: relative;
    padding-left: 16px;
    font-size: 12px;
    font-weight: 800;
}

.debate-type-card li::before {
    position: absolute;
    top: 0.62em;
    left: 0;
    width: 6px;
    height: 6px;
    content: "";
    background: var(--primary);
    border-radius: 50%;
}

.debate-type-card:has(input:checked) {
    border-color: #aeb6ff;
    box-shadow: 0 18px 44px rgba(88, 98, 255, 0.15);
}

.debate-type-card:has(input:checked) .option-check {
    color: var(--primary);
}

.create-form-panel {
    margin-top: 18px;
    padding: 22px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.form-status {
    color: var(--green);
    background: var(--green-soft);
}

.debate-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0 0;
    padding: 10px;
    background: #f8faff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.debate-mode-switch legend {
    grid-column: 1 / -1;
    padding: 0 0 2px;
    color: #34405f;
    font-weight: 900;
}

.mode-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 0;
    padding: 12px;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.mode-option input {
    width: 17px;
    height: 17px;
    margin-top: 3px;
    accent-color: var(--primary);
}

.mode-option span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.mode-option strong {
    color: #111936;
    font-size: 14px;
}

.mode-option small {
    color: #66718f;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.mode-option:has(input:checked) {
    border-color: #aeb6ff;
    box-shadow: 0 12px 28px rgba(88, 98, 255, 0.12);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.create-mode-panel[hidden] {
    display: none !important;
}

.live-panel {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}

.field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.field-wide {
    grid-column: 1 / -1;
}

.field span,
.toggle-row span {
    color: #34405f;
    font-weight: 800;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    color: var(--text);
    background: #f9fbff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: 0;
}

.field input,
.field select {
    height: 42px;
    padding: 0 12px;
}

.field textarea {
    resize: vertical;
    min-height: 108px;
    padding: 12px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: #aeb6ff;
    box-shadow: 0 0 0 4px rgba(88, 98, 255, 0.1);
}

.current-user-card,
.selected-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    background: #f9fbff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.current-user-card .profile-avatar,
.user-result-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    color: #1723a9;
    font-weight: 900;
    background: var(--primary-soft);
    border-radius: 50%;
}

.current-user-card span:last-child,
.selected-user-card span:last-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.current-user-card small,
.selected-user-card small,
.user-result small {
    overflow: hidden;
    color: #66718f;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.current-user-card strong,
.selected-user-card strong,
.user-result strong {
    overflow: hidden;
    color: #111936;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.current-user-card em {
    overflow: hidden;
    color: #66718f;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-autocomplete {
    position: relative;
    min-width: 0;
}

.user-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 75;
    display: grid;
    gap: 4px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.user-results[hidden] {
    display: none;
}

.user-result {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 9px;
    text-align: left;
    cursor: pointer;
    background: transparent;
    border-radius: var(--radius);
}

.user-result:hover,
.user-result:focus {
    background: #f3f5ff;
    outline: 0;
}

.user-results-empty {
    padding: 11px 10px;
    color: #66718f;
    font-weight: 800;
}

.selected-user-card {
    margin-top: 10px;
}

.context-field {
    margin-top: 16px;
}

.mediation-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 220px;
    gap: 14px;
    align-items: end;
    margin-top: 16px;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    background: #f9fbff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.toggle-row input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
}

.compact-field {
    align-self: stretch;
}

.create-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
}

.ghost-link {
    color: #53607d;
    font-weight: 800;
}

.create-submit {
    width: auto;
    min-width: 172px;
    padding: 0 18px;
}

/* Mode avancé : réglages fins repliés par défaut (disclosure natif <details>). */
.advanced-settings {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcff;
}

.advanced-settings-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.advanced-settings-summary::-webkit-details-marker {
    display: none;
}

.advanced-settings-summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    border-radius: var(--radius);
}

.advanced-settings-label {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.advanced-settings-label strong {
    color: #16213d;
    font-weight: 800;
}

.advanced-settings-label small {
    color: #66718f;
    font-size: 12px;
    font-weight: 600;
}

.advanced-settings-chevron {
    flex: none;
    margin-left: auto;
    color: #66718f;
    transition: transform 0.15s ease;
}

.advanced-settings[open] .advanced-settings-chevron {
    transform: rotate(180deg);
}

.advanced-settings-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--line);
}

/* Debate history */
.history-content {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 18px 24px 24px;
}

.history-hero {
    grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    background: #ffffff;
    box-shadow: none;
}

.history-hero .hero-kicker {
    font-size: 12px;
}

.history-hero h1 {
    margin-top: 6px;
    font-size: 24px;
    line-height: 1.15;
}

.history-hero p {
    max-width: 760px;
    margin-top: 5px;
    font-size: 13px;
}

.history-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.history-stats span {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-height: 0;
    padding: 7px 10px;
    color: #53607d;
    font-size: 12px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.history-stats strong {
    color: #111936;
    font-size: 17px;
    line-height: 1;
}

.history-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 8px;
    align-items: end;
    padding: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
}

.history-search-row {
    min-width: 0;
}

.history-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px;
    color: #53607d;
    background: #f9fbff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.history-filter-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    color: #53607d;
    font-size: 12px;
    font-weight: 900;
    background: #f9fbff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.history-filter-toggle .icon {
    width: 16px;
    height: 16px;
}

.history-filter-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(118px, 150px));
    gap: 8px;
    align-items: end;
    min-width: 0;
}

.history-search input {
    min-width: 0;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
}

.history-filter {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.history-filter span {
    color: #53607d;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.history-filter select {
    width: 100%;
    height: 36px;
    padding: 0 9px;
    color: var(--text);
    font-size: 13px;
    background: #f9fbff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: 0;
}

.history-filter-toggle:focus-visible,
.history-filter select:focus,
.history-search:focus-within {
    border-color: #aeb6ff;
    box-shadow: 0 0 0 4px rgba(88, 98, 255, 0.1);
}

.history-bulk-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.history-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #34405f;
    font-size: 13px;
    font-weight: 850;
}

.history-select-all input,
.history-card-select input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.history-bulk-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.history-bulk-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.history-bulk-button .icon {
    width: 15px;
    height: 15px;
}

.history-list {
    display: grid;
    gap: 8px;
}

.history-empty {
    display: grid;
    gap: 10px;
    justify-items: start;
    padding: 16px;
    color: #53607d;
}

/* Le display:grid ci-dessus écrase le [hidden] de l'UA : on le rétablit explicitement. */
.history-empty[hidden] {
    display: none;
}

.history-empty strong {
    color: #16213d;
    font-size: 18px;
}

.history-new-button {
    width: auto;
    min-width: 170px;
    padding: 0 18px;
}

.history-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px 14px;
    overflow: visible;
    box-shadow: none;
}

.history-card-select {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
}

@media (max-width: 720px) {
    .history-bulk-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .history-bulk-form,
    .history-bulk-button {
        width: 100%;
    }

    .history-bulk-button {
        justify-content: center;
    }
}

.history-card-main {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 0;
}

.history-card-main header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.history-card-main header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.history-role-pill,
.history-kind-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    color: #34405f;
    font-size: 11px;
    font-weight: 900;
    background: #f3f5ff;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.history-kind-pill {
    color: #2e5b38;
    background: var(--green-soft);
    border-color: #ceebd9;
}

.favorite-toggle-form {
    flex: 0 0 auto;
}

.favorite-button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: #7b849d;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.favorite-button.is-active {
    color: #c98212;
    background: var(--amber-soft);
    border-color: #f0d59a;
}

.favorite-button:hover,
.favorite-button:focus {
    color: #c98212;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(201, 130, 18, 0.12);
}

.history-card h2 {
    margin: 0;
    color: #111936;
    font-size: 16px;
    line-height: 1.25;
}

.history-card p {
    margin: 0;
    color: #53607d;
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.history-card small {
    color: #66718f;
    font-size: 12px;
    font-weight: 700;
}

.history-card footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0;
    color: #53607d;
    font-size: 12px;
    font-weight: 800;
    background: transparent;
    border-left: 0;
    white-space: normal;
}

.history-card footer span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 0 9px;
    white-space: nowrap;
    background: #f8faff;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.history-card footer .icon {
    width: 14px;
    height: 14px;
}

.history-card footer .open-button {
    width: auto;
    min-width: 84px;
    height: 30px;
    margin-top: 0;
    margin-left: auto;
    font-size: 11px;
}

.history-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.history-card-actions .open-button {
    margin-left: 0;
}

.history-delete-form {
    display: flex;
    margin: 0;
}

.card-delete-button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--danger);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.card-delete-button:hover,
.card-delete-button:focus {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.card-delete-button .icon {
    width: 15px;
    height: 15px;
}

@media (max-width: 1220px) {
    .debate-shell {
        --composer-dock-left: calc(240px + 34px);
        --composer-dock-right: 34px;
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .debate-summary {
        grid-column: 2;
        grid-row: 3;
        padding: 0 24px 24px;
    }

    .summary-panel {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-panel h2,
    .debate-mediator-panel {
        grid-column: 1 / -1;
    }

    .create-hero {
        grid-template-columns: 1fr;
    }

    .mediation-settings {
        grid-template-columns: 1fr;
    }

    .history-toolbar {
        grid-template-columns: 1fr;
    }

    .history-stats {
        justify-content: flex-start;
    }

    .history-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1020px) {
    .ai-analysis-content {
        grid-template-columns: 1fr;
    }

    .ai-score,
    .ai-sources {
        border-left: 0;
        border-top: 1px solid #d9def0;
        padding: 14px 0 0;
    }

    .debate-type-grid {
        grid-template-columns: 1fr;
    }

    .debate-mode-switch,
    .live-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .debate-content,
    .debate-summary,
    .create-content {
        padding: 18px 16px;
    }

    .debate-shell {
        --composer-dock-left: 16px;
        --composer-dock-right: 16px;
    }

    .debate-content {
        padding-bottom: var(--debate-content-bottom, 18px);
    }

    .debate-header {
        display: grid;
    }

    .debate-header-actions {
        justify-content: flex-start;
    }

    /* Barre d'onglets responsive : collée sous la topbar, toujours visible. */
    .debate-tabs {
        position: sticky;
        top: var(--debate-tabs-top, 0px);
        z-index: 30;
        margin: -18px -16px 14px;
        padding: 10px 16px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
    }

    .debate-tabs-list {
        display: flex;
    }

    /* Onglet « Messages » : on masque le résumé. */
    [data-active-tab="messages"] .debate-summary {
        display: none;
    }

    /* Onglet « Résumé » : on masque le fil, le composer et les alertes du fil. */
    [data-active-tab="summary"] .debate-content {
        padding-bottom: 0;
    }

    [data-active-tab="summary"] .debate-content > :not(.debate-tabs) {
        display: none;
    }

    [data-active-tab="summary"] .debate-tabs {
        margin-bottom: 0;
    }

    [data-active-tab="summary"] .debate-summary {
        display: block;
        padding: 0 16px 18px;
    }

    .summary-panel {
        grid-template-columns: 1fr;
    }

    .create-shell {
        display: block;
    }

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

    .history-card footer {
        min-width: 0;
        border-left: 0;
        border-top: 0;
    }

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

    .history-search-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 42px;
        gap: 8px;
        align-items: end;
    }

    .history-filter-toggle {
        display: inline-flex;
        width: 42px;
        padding: 0;
    }

    .history-filter-toggle span {
        display: none;
    }

    .history-filter-panel {
        display: none;
        grid-template-columns: 1fr;
        padding-top: 8px;
        border-top: 1px solid var(--line);
    }

    .history-toolbar.is-filter-open .history-filter-panel {
        display: grid;
    }

    .history-content {
        gap: 10px;
        padding: 14px 12px 18px;
    }

    .history-hero,
    .history-toolbar,
    .history-card {
        padding: 12px;
    }

    .history-search {
        grid-column: auto;
    }
}

@media (max-width: 660px) {
    .debate-content--with-composer {
        --debate-content-bottom: 132px;
    }

    .thread-row {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
    }

    .self-thread-row {
        grid-template-columns: minmax(0, 1fr) 34px;
    }

    .participant-avatar,
    .ai-avatar {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .chat-message {
        grid-template-columns: 1fr;
    }

    .truth-badge {
        width: fit-content;
    }

    .debate-close-panel {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        margin-top: 12px;
    }

    .debate-close-button {
        width: 100%;
    }

    .message-composer {
        grid-template-columns: minmax(0, 1fr) 36px;
    }

    .ai-request-button {
        grid-column: 1 / -1;
        order: 4;
    }

    .composer-note {
        margin-left: 0;
    }

    .debate-shell + .toast {
        bottom: 116px;
    }

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

    .create-actions {
        display: grid;
        justify-items: stretch;
    }

    .create-submit {
        width: 100%;
    }
}

/* Authentication */
body.auth-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #fbfcff 0%, #f4f7ff 56%, #ffffff 100%);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(360px, 480px) minmax(0, 520px);
    gap: 28px;
    align-items: stretch;
    justify-content: center;
    min-height: 100vh;
    padding: 42px 24px;
}

.auth-panel,
.auth-preview {
    align-self: center;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.auth-panel {
    display: grid;
    gap: 22px;
    padding: 30px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
}

.auth-brand strong {
    display: block;
    color: #081129;
    font-size: 22px;
    line-height: 1.1;
}

.auth-brand small {
    display: block;
    margin-top: 4px;
    color: #62708d;
    font-size: 13px;
}

.auth-heading h1 {
    margin: 12px 0 0;
    color: #111936;
    font-size: 30px;
    line-height: 1.12;
}

.auth-alert {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    color: #9a3512;
    background: #fff2df;
    border: 1px solid #ffd7a4;
    border-radius: var(--radius);
}

.auth-alert p {
    margin: 0;
    font-weight: 800;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form .field input {
    height: 46px;
    background: #f9fbff;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    color: #ffffff;
    font-weight: 900;
    background: linear-gradient(135deg, #4e6bff 0%, #7358ff 100%);
    border-radius: var(--radius);
    box-shadow: 0 14px 28px rgba(88, 98, 255, 0.25);
    cursor: pointer;
}

.auth-switch {
    margin: 0;
    color: #53607d;
    font-weight: 700;
    text-align: center;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 900;
}

.auth-preview {
    display: grid;
    grid-template-rows: minmax(220px, 300px) auto;
    overflow: hidden;
    min-height: 560px;
}

.auth-preview img {
    width: 100%;
    height: 100%;
    padding: 30px;
    object-fit: contain;
    background: linear-gradient(135deg, #eef1ff 0%, #ffffff 100%);
}

.auth-preview div {
    padding: 26px;
    border-top: 1px solid var(--line);
}

.auth-preview h2 {
    margin: 14px 0 8px;
    color: #111936;
    font-size: 24px;
    line-height: 1.18;
}

.auth-preview p {
    margin: 0;
    color: #53607d;
    font-size: 15px;
}

@media (max-width: 920px) {
    .auth-shell {
        grid-template-columns: minmax(0, 520px);
        padding: 24px 16px;
    }

    .auth-preview {
        display: none;
    }
}

@media (max-width: 520px) {
    .auth-shell {
        min-height: auto;
        padding: 16px;
    }

    .auth-panel {
        padding: 22px;
    }

    .auth-heading h1 {
        font-size: 26px;
    }
}

/* ===== Illustrations de débat (tags d'image) ===== */

/* Sélecteur de tag à la création */
.illustration-picker {
    margin: 0;
    padding: 14px 16px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcff;
}

.illustration-picker > legend {
    padding: 0 6px;
    color: #16213d;
    font-weight: 800;
}

.illustration-help {
    margin: 0 0 12px;
    color: #53607d;
    font-size: 13px;
}

.illustration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
    gap: 10px;
}

.illustration-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.illustration-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f3f5ff;
}

.illustration-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.illustration-label {
    color: #34405f;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.illustration-option:hover {
    border-color: var(--primary);
}

.illustration-option:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.illustration-option:has(input:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Vignette sur les cartes de liste (historique, mes débats, favoris) */
.history-card {
    grid-template-columns: 88px minmax(0, 1fr);
    column-gap: 14px;
}

.history-card-illustration {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f3f5ff;
}

.history-card-main,
.history-card footer {
    grid-column: 2;
}

/* Illustration en tête de la page débat */
.debate-header-illustration {
    flex: none;
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #f3f5ff;
}

.debate-header > div:not(.debate-header-actions) {
    margin-right: auto;
}

/* Illustration sur la page de partage public */
.share-debate-illustration {
    display: block;
    width: 104px;
    height: 104px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #f3f5ff;
    margin-bottom: 12px;
}

@media (max-width: 540px) {
    .history-card {
        grid-template-columns: 64px minmax(0, 1fr);
        column-gap: 10px;
    }

    .history-card-illustration {
        width: 64px;
        height: 64px;
    }
}

/* ===== Pages compte : profil, tableau de bord, notifications, aide ===== */
.account-content {
    gap: 14px;
}

.page-hero {
    padding: 22px 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f6f8ff 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.page-hero .hero-kicker {
    font-size: 13px;
}

.page-hero h1 {
    margin: 10px 0 6px;
    font-size: 26px;
    color: #16213d;
}

.page-hero p {
    max-width: 720px;
    margin: 0;
    color: #66718f;
}

.top-actions .icon-button {
    color: #53607d;
}

.account-card {
    padding: 22px 24px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.account-card-title {
    margin: 0 0 16px;
    font-size: 17px;
    color: #16213d;
}

.account-note {
    margin: 16px 0 0;
    color: #8a94ab;
    font-size: 13px;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.profile-identity {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-identity-avatar {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 900;
    color: #4e35cc;
    background: linear-gradient(180deg, #e7dcff 0%, #cdb9ff 100%);
}

.profile-identity-main h2 {
    margin: 0;
    font-size: 20px;
    color: #16213d;
}

.profile-identity-main p {
    margin: 4px 0 0;
    color: #66718f;
}

.profile-identity-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.account-info-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.account-info-list dt {
    color: #8a94ab;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.account-info-list dd {
    margin: 4px 0 0;
    color: #16213d;
    font-weight: 700;
    word-break: break-word;
}

.account-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.account-stat {
    display: grid;
    gap: 6px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.account-stat-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 12px;
}

.account-stat-icon .icon {
    width: 20px;
    height: 20px;
}

.account-stat strong {
    font-size: 26px;
    line-height: 1;
    color: #16213d;
}

.account-stat-label {
    color: #66718f;
    font-size: 13px;
    font-weight: 700;
}

.account-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.account-help-card {
    display: grid;
    gap: 8px;
    align-content: start;
}

.account-help-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 12px;
}

.account-help-icon .icon {
    width: 20px;
    height: 20px;
}

.account-help-card h2 {
    margin: 4px 0 0;
    font-size: 17px;
    color: #16213d;
}

.account-help-card p {
    margin: 0;
    color: #66718f;
}

.account-help-card .ghost-button {
    justify-self: start;
    margin-top: 6px;
}

.faq-list {
    display: grid;
    gap: 8px;
}

.faq-item {
    padding: 14px 16px;
    background: #f8faff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.faq-item summary {
    color: #16213d;
    font-weight: 800;
    cursor: pointer;
}

.faq-item p {
    margin: 10px 0 0;
    color: #53607d;
}

.account-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 40px 24px;
    text-align: center;
}

.account-empty-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 50%;
}

.account-empty-icon .icon {
    width: 24px;
    height: 24px;
}

.account-empty strong {
    font-size: 17px;
    color: #16213d;
}

.account-empty span {
    color: #66718f;
}

.notification-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.notification-head .account-card-title {
    margin: 0;
}

.notification-clear-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.notification-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.notification-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 10px;
    color: #53607d;
    background: #f8faff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.notification-tab .icon {
    width: 15px;
    height: 15px;
}

.notification-tab strong {
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    color: #66718f;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 11px;
}

.notification-tab.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: rgba(88, 98, 255, 0.28);
}

.notification-tab.is-active strong {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.notification-filter-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 28px 16px;
    color: #66718f;
    text-align: center;
    background: #f8faff;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.notification-filter-empty strong {
    color: #16213d;
}

.notification-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.notification-item.is-unread {
    background: #f3f5ff;
    border-color: #d9def9;
}

.notification-item-link {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;
}

a.notification-item-link:hover {
    background: rgba(88, 98, 255, 0.06);
}

.notification-delete-form {
    display: flex;
    align-items: center;
    padding-right: 10px;
}

.notification-delete-button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: var(--danger);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.notification-delete-button:hover,
.notification-delete-button:focus {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.notification-delete-button .icon {
    width: 15px;
    height: 15px;
}

.notification-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 12px;
}

.notification-item strong {
    display: block;
    color: #16213d;
}

.notification-type {
    display: inline-flex;
    margin-bottom: 3px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notification-item p {
    margin: 2px 0 0;
    color: #53607d;
}

.notification-item small {
    color: #8a94ab;
}

@media (max-width: 560px) {
    .notification-head {
        align-items: stretch;
        flex-direction: column;
    }

    .notification-clear-button {
        width: 100%;
        justify-content: center;
    }

    .notification-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notification-tab {
        justify-content: center;
    }

    .notification-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .notification-delete-form {
        justify-content: flex-end;
        padding: 0 10px 10px;
    }
}

.profile-popover-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 34px;
    padding: 8px 10px;
    color: #34405f;
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-weight: 750;
    text-align: left;
}

.profile-popover-link:hover {
    background: #f4f6ff;
    color: #1723a9;
}

.profile-popover-link .icon {
    width: 17px;
    height: 17px;
    color: #66718f;
}

.profile-popover-list {
    display: grid;
    gap: 2px;
}

.profile-popover-form {
    margin: 0;
}

.profile-popover-action {
    appearance: none;
    cursor: pointer;
    font: inherit;
}

.profile-popover-action:hover {
    color: #b04444;
}

@media (max-width: 860px) {
    .account-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-card-grid,
    .account-info-list {
        grid-template-columns: 1fr;
    }
}

/* ===== Page tarifs / Premium ===== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 22px 24px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.pricing-card.is-featured {
    border-color: var(--primary);
    box-shadow: 0 18px 44px rgba(88, 98, 255, 0.18);
}

.pricing-badge {
    position: absolute;
    top: -13px;
    left: 22px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    background: var(--primary);
    border-radius: 999px;
}

.pricing-badge .icon {
    width: 14px;
    height: 14px;
}

.pricing-card-head h2 {
    margin: 0;
    color: #16213d;
    font-size: 20px;
}

.pricing-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 10px 0 6px;
}

.pricing-price strong {
    color: #111936;
    font-size: 30px;
    font-weight: 900;
}

.pricing-price small {
    color: #66718f;
    font-size: 13px;
    font-weight: 700;
}

.pricing-tagline {
    margin: 0;
    color: #53607d;
    font-size: 14px;
}

.pricing-includes {
    margin: 0;
    color: #34405f;
    font-size: 13px;
    font-weight: 800;
}

.pricing-features {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 1 1 auto;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #2b3654;
    font-size: 14px;
    font-weight: 600;
}

.pricing-features .icon {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--green, #2e9e6b);
}

.pricing-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    color: #16213d;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    background: #f3f5ff;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.pricing-cta:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.pricing-cta .icon {
    width: 16px;
    height: 16px;
}

.pricing-cta-primary {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.pricing-cta-primary:hover {
    background: #4650f0;
}

.pricing-cta-outline {
    background: transparent;
}

.pricing-b2b {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 18px;
    padding: 22px;
    background: linear-gradient(135deg, #f6f8ff 0%, #eef0ff 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.pricing-b2b-copy {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.pricing-b2b-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    color: var(--primary);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.pricing-b2b-copy h2 {
    margin: 0 0 4px;
    color: #16213d;
    font-size: 18px;
}

.pricing-b2b-copy p {
    margin: 0;
    max-width: 620px;
    color: #53607d;
    font-size: 14px;
}

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

/* ===== TEMPORAIRE : bouton « Demander l'avis de l'IA » masqué =====
   Pour le réafficher, supprimer ce bloc. */
.ai-request-button {
    display: none;
}

/* Le composer garde seulement le champ de saisie et le bouton d'envoi. */
@media (min-width: 661px) {
    .message-composer {
        grid-template-columns: minmax(0, 1fr) 36px;
    }
}

/* ===== Modale « Analyse détaillée » (format paysage) ===== */
.analysis-modal-card {
    position: relative;
    width: min(960px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.analysis-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}

.analysis-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-right: 44px;
}

.analysis-modal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.analysis-modal-kicker .icon {
    width: 16px;
    height: 16px;
}

.analysis-modal-heading h2 {
    margin: 8px 0 0;
    font-size: 22px;
    color: #16213d;
}

.analysis-modal-score-card {
    flex-shrink: 0;
    display: grid;
    gap: 4px;
    min-width: 150px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    text-align: right;
}

.analysis-modal-score-caption {
    color: #8a94ab;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.analysis-modal-score-value {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 2px;
    color: #2432bf;
}

.analysis-modal-score-value strong {
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
}

.analysis-modal-score-value small {
    color: #8a94ab;
    font-size: 13px;
    font-weight: 800;
}

.analysis-modal-score-label {
    justify-self: end;
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 11px;
    font-weight: 800;
}

.analysis-modal-score-na {
    color: #66718f;
    font-size: 16px;
    font-weight: 800;
}

.analysis-modal-body {
    overflow-y: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 16px;
    padding-right: 4px;
}

.analysis-modal-main,
.analysis-modal-side {
    display: grid;
    gap: 12px;
    align-content: start;
}

.analysis-modal-highlight {
    padding: 16px 18px;
    border-left: 4px solid var(--primary);
    border-radius: 0 14px 14px 0;
    background: linear-gradient(135deg, #f6f7ff 0%, #eef0ff 100%);
}

.analysis-modal-highlight-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.analysis-modal-highlight-text {
    margin: 0;
    color: #1d2748;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.analysis-modal-block {
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.analysis-modal-block-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 800;
    color: #16213d;
}

.analysis-modal-block--accent {
    background: linear-gradient(135deg, #f3f0ff 0%, #e9e5ff 100%);
    border-color: #dcd6ff;
}

.analysis-modal-block--accent .analysis-modal-block-title {
    color: #4e35cc;
}

.analysis-modal-block--outline {
    background: #f8faff;
}

.analysis-modal-block--warning {
    background: #fff7ed;
    border-color: #f5d9b0;
}

.analysis-modal-block--warning .analysis-modal-block-title {
    color: #b26109;
}

.analysis-modal-block--sources {
    background: #f7fbf8;
    border-color: #cfe8d8;
}

.analysis-modal-block--sources .analysis-modal-block-title {
    color: #236b45;
}

.analysis-modal-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.analysis-modal-list-item {
    color: #263351;
    line-height: 1.5;
}

.analysis-modal-list-item::marker {
    color: #d08324;
}

.analysis-modal-source-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.analysis-modal-source-item {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.analysis-modal-source-title {
    color: #1f5d3a;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-decoration: none;
}

a.analysis-modal-source-title:hover {
    text-decoration: underline;
}

.analysis-modal-source-meta {
    color: #66718f;
    font-size: 12px;
    line-height: 1.35;
}

.analysis-modal-source-empty {
    margin: 0;
    color: #66718f;
    font-size: 13px;
    line-height: 1.45;
}

.analysis-modal-text {
    margin: 0;
    color: #263351;
    line-height: 1.55;
    white-space: pre-line;
}

.analysis-modal-empty {
    grid-column: 1 / -1;
    margin: 0;
    color: #8a94ab;
}

@media (max-width: 720px) {
    .analysis-modal-head {
        flex-direction: column;
        padding-right: 44px;
    }

    .analysis-modal-score-card {
        text-align: left;
    }

    .analysis-modal-score-value {
        justify-content: flex-start;
    }

    .analysis-modal-score-label {
        justify-self: start;
    }

    .analysis-modal-body {
        grid-template-columns: 1fr;
    }
}

/* ===== Page Paramètres : rangées, sélecteur de thème, interrupteur ===== */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.settings-row-text strong {
    display: block;
    color: var(--text);
    font-size: 15px;
}

.settings-row-text p {
    max-width: 520px;
    margin: 4px 0 0;
    color: var(--muted);
}

.settings-note-inline {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.theme-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.theme-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
}

.theme-option .icon {
    width: 16px;
    height: 16px;
}

.theme-option.is-active {
    color: var(--primary);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.switch {
    position: relative;
    display: inline-flex;
    flex: none;
    cursor: pointer;
}

.switch input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.switch-track {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: var(--line-strong);
    transition: background 0.2s ease;
}

.switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.switch input:checked + .switch-track {
    background: var(--primary);
}

.switch input:checked + .switch-track::after {
    transform: translateX(20px);
}

.switch input:disabled + .switch-track {
    opacity: 0.5;
    cursor: not-allowed;
}

.switch input:focus-visible + .switch-track {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== Thème sombre ===== */
html[data-theme="dark"] {
    --bg: #0f1421;
    --surface: #171e2e;
    --surface-soft: #1e2740;
    --line: #2a3550;
    --line-strong: #384566;
    --text: #e8edf8;
    --muted: #9aa7c2;
    --muted-strong: #bcc7de;
    --primary-soft: #232c4a;
    --green-soft: #12311f;
    --orange-soft: #3a2a14;
    --amber-soft: #3a2f14;
    --danger-soft: #3a1c1c;
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background: var(--bg);
    color: var(--text);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 {
    color: var(--text);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .brand-logo,
html[data-theme="dark"] .shortcut-key,
html[data-theme="dark"] .profile-popover,
html[data-theme="dark"] .debate-options-menu,
html[data-theme="dark"] .chat-message,
html[data-theme="dark"] .ai-avatar,
html[data-theme="dark"] .summary-panel,
html[data-theme="dark"] .message-composer,
html[data-theme="dark"] .emoji-picker,
html[data-theme="dark"] .persona-option,
html[data-theme="dark"] .empty-thread,
html[data-theme="dark"] .account-card,
html[data-theme="dark"] .account-stat,
html[data-theme="dark"] .category-catalog-card,
html[data-theme="dark"] .explore-toolbar,
html[data-theme="dark"] .debate-type-card,
html[data-theme="dark"] .create-guardrails,
html[data-theme="dark"] .history-hero,
html[data-theme="dark"] .history-card,
html[data-theme="dark"] .history-empty,
html[data-theme="dark"] .history-bulk-actions,
html[data-theme="dark"] .history-card-select,
html[data-theme="dark"] .favorite-button,
html[data-theme="dark"] .card-delete-button,
html[data-theme="dark"] .illustration-picker,
html[data-theme="dark"] .illustration-option,
html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] .pricing-cta,
html[data-theme="dark"] .pricing-b2b-icon,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .analysis-modal-score-card,
html[data-theme="dark"] .analysis-modal-block,
html[data-theme="dark"] .notification-item,
html[data-theme="dark"] .push-permission-prompt,
html[data-theme="dark"] .debate-close-panel,
html[data-theme="dark"] .composer-dock,
html[data-theme="dark"] .toast {
    background: var(--surface);
    border-color: var(--line);
}

html[data-theme="dark"] .debate-close-panel.is-closed {
    background: #182236;
    border-color: #2d3a58;
}

html[data-theme="dark"] .ai-analysis-card,
html[data-theme="dark"] .ai-analysis-card.is-pending,
html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .create-hero,
html[data-theme="dark"] .analysis-modal-highlight,
html[data-theme="dark"] .history-toolbar,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .account-empty,
html[data-theme="dark"] .account-info-list,
html[data-theme="dark"] .profile-popover-link {
    background: var(--surface);
    border-color: var(--line);
}

html[data-theme="dark"] .analysis-modal-block--accent,
html[data-theme="dark"] .ai-analysis-card.is-failed {
    background: var(--surface-soft);
    border-color: var(--line-strong);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .searchbar,
html[data-theme="dark"] .history-search,
html[data-theme="dark"] .history-filter-toggle,
html[data-theme="dark"] .emoji-toggle,
html[data-theme="dark"] .explore-search,
html[data-theme="dark"] .explore-filter select,
html[data-theme="dark"] .share-copy-row input {
    background: var(--surface-soft);
    border-color: var(--line);
    color: var(--text);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: var(--muted);
}

html[data-theme="dark"] .message-composer textarea {
    background: transparent;
    border: 0;
}

html[data-theme="dark"] .emoji-picker button {
    color: var(--text);
}

html[data-theme="dark"] .settings-row-text strong,
html[data-theme="dark"] .chat-message p,
html[data-theme="dark"] .thread-meta strong,
html[data-theme="dark"] .summary-block h3,
html[data-theme="dark"] .summary-list h3,
html[data-theme="dark"] .consensus-gauge span,
html[data-theme="dark"] .consensus-block p,
html[data-theme="dark"] .ai-score span,
html[data-theme="dark"] .ai-sources strong,
html[data-theme="dark"] .empty-thread strong,
html[data-theme="dark"] .ai-analysis-copy p,
html[data-theme="dark"] .debate-type-card strong,
html[data-theme="dark"] .debate-type-card ul,
html[data-theme="dark"] .advanced-settings-label strong,
html[data-theme="dark"] .account-info-list dd,
html[data-theme="dark"] .history-empty strong,
html[data-theme="dark"] .history-card h2,
html[data-theme="dark"] .history-select-all,
html[data-theme="dark"] .persona-option,
html[data-theme="dark"] .analysis-modal-text,
html[data-theme="dark"] .notification-item strong,
html[data-theme="dark"] .debate-participant-link,
html[data-theme="dark"] .debate-close-copy strong,
html[data-theme="dark"] .brand strong,
html[data-theme="dark"] .profile-button strong,
html[data-theme="dark"] .category-catalog-copy h2,
html[data-theme="dark"] .illustration-picker > legend,
html[data-theme="dark"] .illustration-label,
html[data-theme="dark"] .pricing-card-head h2,
html[data-theme="dark"] .pricing-price strong,
html[data-theme="dark"] .pricing-cta,
html[data-theme="dark"] .pricing-b2b-copy h2,
html[data-theme="dark"] .push-permission-copy strong,
html[data-theme="dark"] .account-card-title,
html[data-theme="dark"] .history-stats strong {
    color: var(--text);
}

html[data-theme="dark"] .category-catalog-copy p,
html[data-theme="dark"] .category-catalog-footer span,
html[data-theme="dark"] .illustration-help,
html[data-theme="dark"] .pricing-price small,
html[data-theme="dark"] .pricing-features li,
html[data-theme="dark"] .pricing-b2b-copy p,
html[data-theme="dark"] .brand small,
html[data-theme="dark"] .push-permission-copy small,
html[data-theme="dark"] .push-permission-close,
html[data-theme="dark"] .profile-email,
html[data-theme="dark"] .debate-header p,
html[data-theme="dark"] .menu-note,
html[data-theme="dark"] .share-hint,
html[data-theme="dark"] .modal-text,
html[data-theme="dark"] .history-stats span,
html[data-theme="dark"] .history-filter span,
html[data-theme="dark"] .explore-filter span,
html[data-theme="dark"] .explore-results-count,
html[data-theme="dark"] .page-hero p,
html[data-theme="dark"] .account-note,
html[data-theme="dark"] .account-info-list dt {
    color: var(--muted);
}

html[data-theme="dark"] .summary-block,
html[data-theme="dark"] .summary-list,
html[data-theme="dark"] .debate-mediator-panel,
html[data-theme="dark"] .summary-panel h2,
html[data-theme="dark"] .ai-score,
html[data-theme="dark"] .ai-sources,
html[data-theme="dark"] .debate-tabs,
html[data-theme="dark"] .category-catalog-footer,
html[data-theme="dark"] .advanced-settings-body,
html[data-theme="dark"] .history-role-pill,
html[data-theme="dark"] .history-kind-pill,
html[data-theme="dark"] .history-card footer span {
    border-color: var(--line);
}

html[data-theme="dark"] .outline-button,
html[data-theme="dark"] .icon-button.framed,
html[data-theme="dark"] .ghost-button {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text);
}

html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .theme-pill,
html[data-theme="dark"] .theme-nav h2,
html[data-theme="dark"] .sidebar-footer strong {
    color: var(--text);
}

html[data-theme="dark"] .nav-item .icon,
html[data-theme="dark"] .theme-pill .icon {
    color: var(--muted);
}

html[data-theme="dark"] .nav-item.is-active {
    color: var(--primary);
    background: var(--primary-soft);
}

html[data-theme="dark"] .nav-item.is-active .icon {
    color: var(--primary);
}

html[data-theme="dark"] .welcome-panel,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .debate-card,
html[data-theme="dark"] .premium-card,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .mini-panel,
html[data-theme="dark"] .recommendation-panel,
html[data-theme="dark"] .mediator-panel,
html[data-theme="dark"] .category-card,
html[data-theme="dark"] .rail-panel,
html[data-theme="dark"] .round-next,
html[data-theme="dark"] .open-button,
html[data-theme="dark"] .premium-footer a,
html[data-theme="dark"] .create-form-panel,
html[data-theme="dark"] .debate-mode-switch,
html[data-theme="dark"] .mode-option,
html[data-theme="dark"] .advanced-settings,
html[data-theme="dark"] .toggle-row,
html[data-theme="dark"] .current-user-card,
html[data-theme="dark"] .selected-user-card,
html[data-theme="dark"] .user-results,
html[data-theme="dark"] .notification-delete-button,
html[data-theme="dark"] .auth-panel,
html[data-theme="dark"] .auth-preview {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow-soft);
}

html[data-theme="dark"] .welcome-emoji,
html[data-theme="dark"] .stat-icon,
html[data-theme="dark"] .category-icon,
html[data-theme="dark"] .category-catalog-image,
html[data-theme="dark"] .feature-orb,
html[data-theme="dark"] .option-icon,
html[data-theme="dark"] .account-stat-icon,
html[data-theme="dark"] .account-help-icon,
html[data-theme="dark"] .account-empty-icon,
html[data-theme="dark"] .notification-icon,
html[data-theme="dark"] .debate-participant-link > span,
html[data-theme="dark"] .analysis-modal-score-label,
html[data-theme="dark"] .illustration-thumb,
html[data-theme="dark"] .history-card-illustration,
html[data-theme="dark"] .debate-header-illustration,
html[data-theme="dark"] .share-debate-illustration {
    background: var(--primary-soft);
}

html[data-theme="dark"] .mode-option:has(input:checked),
html[data-theme="dark"] .persona-option:has(input:checked),
html[data-theme="dark"] .theme-option.is-active,
html[data-theme="dark"] .user-result:hover,
html[data-theme="dark"] .user-result:focus,
html[data-theme="dark"] .notification-item.is-unread {
    background: var(--surface-soft);
    border-color: var(--line-strong);
}

html[data-theme="dark"] .debate-card h3,
html[data-theme="dark"] .premium-card h3,
html[data-theme="dark"] .recommendation-item strong,
html[data-theme="dark"] .feature-card h3,
html[data-theme="dark"] .category-card strong,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .mode-option strong,
html[data-theme="dark"] .field span,
html[data-theme="dark"] .toggle-row span,
html[data-theme="dark"] .current-user-card strong,
html[data-theme="dark"] .selected-user-card strong,
html[data-theme="dark"] .user-result strong,
html[data-theme="dark"] .profile-identity-main h2,
html[data-theme="dark"] .account-stat strong,
html[data-theme="dark"] .account-help-card h2,
html[data-theme="dark"] .faq-item summary,
html[data-theme="dark"] .account-empty strong,
html[data-theme="dark"] .analysis-modal-heading h2,
html[data-theme="dark"] .analysis-modal-block-title,
html[data-theme="dark"] .analysis-modal-highlight-text,
html[data-theme="dark"] .analysis-modal-list-item,
html[data-theme="dark"] .auth-brand strong,
html[data-theme="dark"] .auth-heading h1,
html[data-theme="dark"] .auth-preview h2 {
    color: var(--text);
}

html[data-theme="dark"] .welcome-content p,
html[data-theme="dark"] .stat-card span:not(.stat-icon),
html[data-theme="dark"] .debate-card p,
html[data-theme="dark"] .premium-card p,
html[data-theme="dark"] .debate-sides,
html[data-theme="dark"] .premium-footer,
html[data-theme="dark"] .category-card small,
html[data-theme="dark"] .feature-card p,
html[data-theme="dark"] .metric-card span:not(.eyebrow),
html[data-theme="dark"] .create-guardrails span,
html[data-theme="dark"] .debate-type-card > span:not(.option-check):not(.option-icon),
html[data-theme="dark"] .debate-mode-switch legend,
html[data-theme="dark"] .advanced-settings-label small,
html[data-theme="dark"] .advanced-settings-chevron,
html[data-theme="dark"] .ghost-link,
html[data-theme="dark"] .thread-meta time,
html[data-theme="dark"] .empty-thread,
html[data-theme="dark"] .ai-sources ul,
html[data-theme="dark"] .summary-list ul,
html[data-theme="dark"] .sources-list ol,
html[data-theme="dark"] .composer-persona-label,
html[data-theme="dark"] .composer-note,
html[data-theme="dark"] .mode-option small,
html[data-theme="dark"] .current-user-card small,
html[data-theme="dark"] .selected-user-card small,
html[data-theme="dark"] .current-user-card em,
html[data-theme="dark"] .user-result small,
html[data-theme="dark"] .user-results-empty,
html[data-theme="dark"] .profile-identity-main p,
html[data-theme="dark"] .account-stat-label,
html[data-theme="dark"] .account-help-card p,
html[data-theme="dark"] .faq-item p,
html[data-theme="dark"] .account-empty span,
html[data-theme="dark"] .history-empty,
html[data-theme="dark"] .history-card p,
html[data-theme="dark"] .history-card small,
html[data-theme="dark"] .history-card footer,
html[data-theme="dark"] .notification-item p,
html[data-theme="dark"] .notification-item small,
html[data-theme="dark"] .analysis-modal-score-caption,
html[data-theme="dark"] .analysis-modal-score-value small,
html[data-theme="dark"] .analysis-modal-score-na,
html[data-theme="dark"] .analysis-modal-source-meta,
html[data-theme="dark"] .analysis-modal-source-empty,
html[data-theme="dark"] .debate-close-copy span,
html[data-theme="dark"] .auth-brand small,
html[data-theme="dark"] .auth-switch,
html[data-theme="dark"] .auth-preview p {
    color: var(--muted);
}

html[data-theme="dark"] .notification-tab,
html[data-theme="dark"] .notification-filter-empty {
    color: var(--muted);
    background: var(--surface-soft);
    border-color: var(--line);
}

html[data-theme="dark"] .explore-empty {
    color: var(--muted);
    background: var(--surface-soft);
    border-color: var(--line);
}

html[data-theme="dark"] .explore-empty strong {
    color: var(--text);
}

html[data-theme="dark"] .notification-tab strong {
    color: var(--muted);
    background: var(--surface);
    border-color: var(--line);
}

html[data-theme="dark"] .notification-tab.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: rgba(126, 136, 255, 0.35);
}

html[data-theme="dark"] .notification-tab.is-active strong {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

html[data-theme="dark"] .notification-filter-empty strong {
    color: var(--text);
}

html[data-theme="dark"] .analysis-modal-highlight,
html[data-theme="dark"] .analysis-modal-block--outline,
html[data-theme="dark"] .analysis-modal-block--warning,
html[data-theme="dark"] .analysis-modal-block--sources {
    background: var(--surface-soft);
    border-color: var(--line-strong);
}

html[data-theme="dark"] .analysis-modal-block--warning .analysis-modal-block-title,
html[data-theme="dark"] .analysis-modal-block--sources .analysis-modal-block-title,
html[data-theme="dark"] .analysis-modal-source-title {
    color: var(--muted-strong);
}

html[data-theme="dark"] .is-deleted-message .chat-message,
html[data-theme="dark"] .history-role-pill,
html[data-theme="dark"] .history-card footer span,
html[data-theme="dark"] .history-stats span {
    background: var(--surface-soft);
    border-color: var(--line);
}

html[data-theme="dark"] .is-deleted-message .chat-message,
html[data-theme="dark"] .is-deleted-message .chat-message p {
    color: var(--muted);
}

html[data-theme="dark"] .history-kind-pill {
    color: #8fe0a9;
    background: var(--green-soft);
    border-color: rgba(34, 197, 94, 0.35);
}

html[data-theme="dark"] .category-catalog-image,
html[data-theme="dark"] .illustration-thumb,
html[data-theme="dark"] .history-card-illustration,
html[data-theme="dark"] .debate-header-illustration,
html[data-theme="dark"] .share-debate-illustration,
html[data-theme="dark"] .auth-preview img {
    background: var(--surface-soft);
    border-color: var(--line);
}

html[data-theme="dark"] .pricing-b2b {
    background: var(--surface-soft);
    border-color: var(--line);
}

html[data-theme="dark"] .pricing-cta-primary {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

html[data-theme="dark"] .favorite-button.is-active {
    border-color: rgba(245, 158, 11, 0.38);
}

html[data-theme="dark"] .debate-type-card:has(input:checked),
html[data-theme="dark"] .mode-option:has(input:checked),
html[data-theme="dark"] .illustration-option:has(input:checked) {
    border-color: rgba(139, 150, 255, 0.7);
    box-shadow: 0 0 0 2px rgba(88, 98, 255, 0.22);
}

html[data-theme="dark"] .persona-a:has(input:checked) {
    border-color: #8b78e8;
    box-shadow: 0 0 0 2px rgba(139, 120, 232, 0.24);
}

html[data-theme="dark"] .persona-b:has(input:checked) {
    border-color: #eab463;
    box-shadow: 0 0 0 2px rgba(234, 180, 99, 0.22);
}

html[data-theme="dark"] .consensus-gauge::before {
    border-color: var(--line-strong);
}

html[data-theme="dark"] .top-actions .icon-button,
html[data-theme="dark"] .profile-popover-link .icon {
    color: var(--muted);
}

html[data-theme="dark"] .profile-popover-link:hover {
    color: var(--text);
    background: var(--surface-soft);
}

html[data-theme="dark"] .profile-email {
    border-bottom-color: var(--line);
}

html[data-theme="dark"] .danger-menu-item:hover,
html[data-theme="dark"] .danger-menu-item:focus,
html[data-theme="dark"] .card-delete-button:hover,
html[data-theme="dark"] .card-delete-button:focus {
    background: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.45);
}

html[data-theme="dark"] .modal-close:hover,
html[data-theme="dark"] .share-copy-button:hover {
    color: var(--text);
    background: var(--surface-soft);
}

html[data-theme="dark"] .auth-alert {
    color: #ffc58b;
    background: var(--orange-soft);
    border-color: rgba(245, 158, 11, 0.32);
}

html[data-theme="dark"] body.auth-page {
    background: var(--bg);
}

/* ===== Navigation de debat : theme sombre ===== */
html[data-theme="dark"] .debate-list-card {
    background: var(--surface-soft);
    border-color: var(--line);
    box-shadow: inset 3px 0 0 rgba(88, 98, 255, 0.55);
}

html[data-theme="dark"] .debate-list-card strong,
html[data-theme="dark"] .other-debate-list strong {
    color: var(--text);
}

html[data-theme="dark"] .debate-list-section h2,
html[data-theme="dark"] .debate-list-card span,
html[data-theme="dark"] .other-debate-list span {
    color: var(--muted);
}

html[data-theme="dark"] .other-debate-list a:hover,
html[data-theme="dark"] .other-debate-list a:focus {
    background: rgba(88, 98, 255, 0.12);
}

/* ===== Page d'invitation a un debat ===== */
.invitation-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
    padding: 32px 20px;
    background: var(--bg);
}

.invitation-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.invitation-brand strong {
    font-size: 20px;
}

.invitation-card {
    width: min(520px, 100%);
    padding: 32px 28px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.invitation-illustration {
    display: block;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 16 / 10;
    margin: 0 auto 22px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--line);
}

.invitation-text {
    max-width: 420px;
    margin: 0 auto;
    color: var(--text);
    font-size: 17px;
    line-height: 1.5;
}

.invitation-question {
    display: block;
    margin-top: 10px;
    color: var(--muted-strong);
    font-weight: 800;
}

.invitation-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 26px;
}

.invitation-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 24px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.invitation-button .icon {
    width: 18px;
    height: 18px;
}

.invitation-accept {
    background: var(--green);
}

.invitation-accept:hover {
    background: #0f8a51;
}

.invitation-refuse {
    background: var(--danger);
}

.invitation-refuse:hover {
    background: #c01f1f;
}

/* Tag de statut d'invitation dans l'historique */
.history-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.history-status-refused {
    color: var(--danger);
    background: var(--danger-soft);
}

.history-status-pending {
    color: var(--amber);
    background: var(--amber-soft);
}

@media (max-width: 860px) {
    html[data-theme="dark"] .sidebar,
    .sidebar {
        background: #ffffff;
        background-image: none;
        opacity: 1;
    }
}

/* ===== Liens vers le profil public depuis le fil ===== */
.participant-avatar-link {
    text-decoration: none;
    transition: box-shadow 0.15s ease;
}

.participant-avatar-link:hover,
.participant-avatar-link:focus-visible {
    box-shadow: 0 0 0 3px var(--primary-soft);
    outline: none;
}

.thread-author-link {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.thread-author-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ===== Page profil public : liste des débats ===== */
.profile-debate-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.profile-debate-card {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    transition: border-color 0.15s ease;
}

.profile-debate-card:hover {
    border-color: var(--line-strong);
}

.profile-debate-illustration {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.profile-debate-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.profile-debate-main strong {
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-debate-main small {
    color: var(--muted);
}

.profile-debate-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 700;
}

.profile-debate-meta .icon {
    width: 14px;
    height: 14px;
}

.profile-debate-meta span {
    color: var(--muted);
}
