@font-face {
    font-family: "Nunito";
    src: url("assets/fonts/nunito.woff2") format("woff2");
    font-weight: 400 900;
    font-display: swap;
}
@font-face {
    font-family: "Pacifico";
    src: url("assets/fonts/pacifico.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Dancing Script";
    src: url("assets/fonts/dancingscript.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}
* { box-sizing: border-box; }
:root {
    color: #3a2e4d;
    background: #fbf5fa;
    font: 16px/1.45 "Nunito", "Segoe UI", system-ui, sans-serif;
    --line: #efe5f4;
    --card: #fff;
    --lavender: #efe7fd;
    --shadow: 0 8px 22px -12px #6e469659;
}
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at top, #fffaf7, transparent 70%); }
.banner {
    background: #f7e6ee url("assets/paysage.svg") center bottom / cover no-repeat;
    border-radius: 0 0 34px 34px;
    box-shadow: var(--shadow);
}
.banner-inner {
    max-width: 1100px; margin: auto; padding: 24px 20px 42px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand, .profile-switch { display: flex; align-items: center; gap: 10px; }
.brand h1 { margin: 0; font: 400 clamp(2rem, 4vw, 2.75rem)/1.15 "Pacifico", "Segoe Script", cursive; }
.brand p { margin: 5px 0 0; font-size: .875rem; }
main { max-width: 980px; margin: auto; padding: 16px 20px 48px; }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.tabs a {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    padding: 14px 8px; border-radius: 20px; border: 2px solid transparent;
    text-decoration: none; font-weight: 700; line-height: 1.15; text-align: center;
}
.tab-icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.famille { background: var(--lavender); color: #62429a; --tab-gradient: linear-gradient(135deg, #8f6bcd, #7551b8); }
.quotidien { background: #fde9e4; color: #92463e; --tab-gradient: linear-gradient(135deg, #af5b54, #9a4847); }
.couple { background: #fde6ef; color: #a03661; --tab-gradient: linear-gradient(135deg, #b94e7a, #a23963); }
button, input, textarea { font: inherit; color: inherit; }
button {
    min-height: 44px; padding: 8px 14px; border: 1px solid transparent;
    border-radius: 14px; background: #eadcf4; cursor: pointer; font-weight: 650;
}
:focus-visible { outline: 3px solid #72548d; outline-offset: 3px; }
.profile-switch { background: var(--card); border-color: var(--line); border-radius: 99px; box-shadow: var(--shadow); font-size: .875rem; text-align: left; }
.profile-switch .avatar { width: 30px; height: 30px; }
.profile-panel form { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-panel button { display: flex; align-items: center; gap: 8px; }
.avatar {
    display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
    border-radius: 50%; border: 2px solid #fff9; font-size: 1.2rem;
}
.profile-1 { background: #cfe5f7; color: #365b7e; }
.profile-2 { background: #f7cadc; color: #8b335c; }
.panel, .message {
    padding: 16px; border: 1px solid var(--line); border-radius: 22px;
    box-shadow: var(--shadow);
}
.panel { background: var(--card); }
.search, .compose { max-width: 720px; margin: 0 auto 14px; }
label { display: block; font-weight: 650; font-size: .875rem; margin-bottom: 5px; }
input, textarea {
    display: block; width: 100%; min-width: 0; padding: 9px 12px; border: 1px solid #d9c6d4;
    border-radius: 14px; background: #fffdfc;
}
input { min-height: 44px; }
textarea { resize: vertical; }
.compose-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; background: #d6bedc; width: 2px; inset: 0 auto 0 50%; }
.day { position: relative; display: flex; flex-direction: column; gap: 12px; padding-bottom: 14px; }
.day h2 {
    align-self: center; margin: 0; padding: 4px 14px; border-radius: 20px;
    font-size: .875rem; background: #eadcf0;
}
.message { position: relative; width: calc(50% - 18px); overflow-wrap: anywhere; }
.side1 { align-self: flex-start; background: #eaf4fb; --marker: #78a4c3; }
.side2 { align-self: flex-end; background: #fbe8f0; --marker: #c67da3; }
.message::before {
    content: ""; position: absolute; top: 22px; width: 10px; height: 10px;
    border-radius: 50%; background: #fffaf7; border: 2px solid var(--marker);
}
.side1::before { right: -26px; }
.side2::before { left: -24px; }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.message-meta time { margin-left: 4px; font-size: .8125rem; color: #5c4b68; }
.category { margin-left: auto; border-radius: 20px; padding: 3px 8px; font-size: .8125rem; font-weight: 650; }
.message p { margin: 8px 0; }
.reactions { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 2px; }
.reactions button { flex: 1 1 auto; padding: 6px 8px; font-size: .875rem; line-height: 1.2; }
.agree { background: #e6f6ec; color: #236640; }
.disagree { background: #fdecef; color: #932e46; }
.discuss { background: #fff2e5; color: #874416; }
.reactions [aria-pressed="true"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.status { display: inline-block; border-radius: 12px; padding: 5px 9px; font-size: .875rem; font-weight: 650; }
summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-weight: 650; font-size: .875rem; }
.comment { background: #fffcfa; padding: 8px 10px; border-radius: 12px; }
.comment-form button { margin-top: 6px; }
.empty { text-align: center; color: #5c4b68; }
[hidden] { display: none !important; }

@media (max-width: 650px) {
    .banner-inner { padding: 14px 12px 24px; }
    .brand img { width: 48px; height: 48px; }
    main { padding-inline: 12px; }
    .tabs { gap: 7px; }
    .tabs a { flex-direction: column; padding: 10px 4px; font-size: .875rem; }
    .timeline::before { left: 5px; }
    .day { padding-left: 16px; }
    .day h2 { align-self: flex-start; }
    .message { width: calc(100% - 12px); padding: 10px; }
    .side1::before { left: -18px; }
    .side2::before { left: -30px; }
}
@media (max-width: 360px) {
    .compose-controls { grid-template-columns: minmax(0, 1fr); }
    .compose-controls button { justify-self: end; }
}
/* Layout shared by the illustrated desktop and mobile interfaces. */
body {
    background:
        radial-gradient(1100px 600px at 0 0, #fcdeecb3, transparent 60%),
        radial-gradient(900px 600px at 100% 10%, #e8e0fdcc, transparent 60%),
        #fbf5fa;
    background-attachment: fixed;
}
.banner-inner { max-width: 1420px; min-height: 150px; align-items: center; padding: 20px clamp(15px, 3vw, 28px); }
.handwritten { font-family: "Dancing Script", "Segoe Script", cursive; font-weight: 700; }
.brand h1 { color: #4b2c57; }
.brand h1 span { color: #a94171; font: 700 .52em/1 system-ui, sans-serif; vertical-align: top; }
.brand p { color: #6d5374; }
.brand { color: inherit; text-decoration: none; }
.profile-switch span:last-child { font-size: .8125rem; }
.app { max-width: 1420px; padding-inline: clamp(12px, 3vw, 28px); }
.dashboard {
    display: grid;
    grid-template-columns: clamp(175px, 18vw, 250px) minmax(0, 1fr) clamp(185px, 19vw, 272px);
    align-items: start;
    gap: clamp(12px, 2vw, 25px);
}
.feed { min-width: 0; }
.tabs { max-width: 1040px; margin-inline: auto; margin-bottom: 22px; }
.tabs a { position: relative; min-height: 56px; border-radius: 20px; box-shadow: var(--shadow); }
.tabs a:hover { border-color: currentColor; }
.tabs a[aria-current] {
    color: #fff;
    background: var(--tab-gradient);
    border-color: transparent;
}
.tabs a[aria-current]::after {
    content: ""; position: absolute; inset: auto 20px -7px; height: 3px;
    border-radius: 99px; background: var(--tab-gradient); opacity: .55;
}
.icon {
    width: 22px; height: 22px; flex: none; vertical-align: middle;
    fill: none; stroke: currentColor; stroke-width: 1.65;
    stroke-linecap: round; stroke-linejoin: round;
}
.tabs .icon { width: 27px; height: 27px; }
.side-panel { margin-bottom: 16px; }
.side-panel h2, .history h2, .view-title { font-size: 1.06rem; margin: 0 0 12px; }
.side-panel h2 .icon, .history h2 .icon { color: #8155a0; margin-right: 3px; }
.side-panel p { font-size: .875rem; margin: 0 0 9px; }
.sidebar-profile, .together { display: flex; align-items: center; gap: 9px; }
.sidebar-profile { margin-bottom: 12px; overflow-wrap: anywhere; }
.sidebar-profile .avatar { width: 54px; height: 54px; }
.side-menu { display: grid; gap: 3px; }
.side-menu a {
    display: flex; align-items: center; gap: 9px; min-height: 42px;
    padding: 6px 8px; border-radius: 11px; color: inherit; text-decoration: none; font-size: .875rem;
}
.side-menu .icon { width: 19px; height: 19px; }
.side-menu a:hover, .side-menu a[aria-current] { background: var(--lavender); color: #62429a; }
.side-menu a[aria-current] { font-weight: 700; }
.account-card .sidebar-profile { gap: 12px; margin: 0 0 6px; padding: 4px 2px 15px; border-bottom: 1px solid var(--line); }
.account-card .sidebar-profile strong { display: block; font-size: 1.3rem; line-height: 1.15; }
.account-avatar { position: relative; flex: none; }
.account-card .account-avatar .avatar {
    display: block; width: clamp(58px, 6.5vw, 88px); height: clamp(58px, 6.5vw, 88px);
    border: 3px solid var(--card); box-shadow: var(--shadow);
}
.account-crown { position: absolute; top: -3px; left: 4px; font-size: .95rem; transform: rotate(-22deg); }
.account-online { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: .8125rem; font-weight: 650; }
.account-online::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #32a764; box-shadow: 0 0 0 3px #c9eed7; }
.account-card .side-menu a { min-height: 46px; gap: 10px; padding: 7px 10px; font-weight: 700; }
.account-card .side-menu a[aria-current] .icon { color: #7950bf; }
.sidebar-count { flex: 0 0 3ch; margin-left: auto; color: #6e6080; font-size: .8125rem; font-variant-numeric: tabular-nums; text-align: center; }
.sidebar-count-pending { padding-block: 2px; border-radius: 99px; background: #b92f5c; color: white; }
.extras-card .side-menu a { gap: 12px; min-height: 46px; padding: 8px 10px; font-weight: 700; }
.extras-card .side-menu a[href="?cat=idees"] .icon { color: #b56900; }
.extras-card .side-menu a[href="?vue=projets"] .icon { color: #c93e70; }
.extras-card .side-menu a[href="?vue=listes"] .icon { color: #8055c5; }
.extras-card .side-menu a[href="?vue=album"] .icon { color: #4674bf; }
[data-theme="dark"] .sidebar-count:not(.sidebar-count-pending) { color: #d0bddf; }
.side-panel .handwritten { color: #a44a70; font-size: 1.5rem; padding-bottom: 7px; border-bottom: 1px solid #f0d9e4; }
.together { gap: 12px; }
.together h2 { margin: 0; }
.together h2 span { color: #bd4d7b; }
.together .exchange-count { margin: 2px 0 0; color: #695977; font-size: .8125rem; font-weight: 750; }
[data-theme="dark"] .together .exchange-count { color: #d0bddf; }
.paired-avatars { display: flex; flex: none; }
.paired-avatars img + img { margin-left: -10px; }
.panel-link { color: #664587; font-weight: 650; font-size: .875rem; }
.activity-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.activity-counts span { padding: 7px 9px; border-radius: 10px; background: #efe3f7; font-size: .8125rem; }
.activity-counts span + span { background: #fce6e7; }
.history { margin-bottom: 14px; }
.week-nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.week-nav a { display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 50%; background: #f0e5f6; color: inherit; text-decoration: none; font-size: 1.5rem; }
.search-field { display: flex; align-items: center; gap: 4px; padding-left: 17px; border: 1px solid var(--line); border-radius: 99px; color: #674d7a; background: var(--card); box-shadow: var(--shadow); }
.search-field input { min-height: 46px; border: 0; background: transparent; border-radius: 99px; }
.compose { padding: 12px; }
.compose-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.compose-controls textarea { min-height: 44px; border-color: var(--line); background: #fffafd; border-radius: 17px; }
.compose-icon, .send { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--lavender); color: #62429a; }
.send { background: #7551b8; color: #fff; }
.send:hover { background: #62429a; }
.timeline::before { left: 6px; background: linear-gradient(#e8d9f9, var(--line)); }
.day { padding-left: 23px; }
.day h2 { align-self: center; background: var(--lavender); color: #62429a; }
.message { width: calc(100% - clamp(10px, 4vw, 48px)); border-radius: 24px; }
.message::before { left: -23px; right: auto; }
.side2::before { left: calc(-23px - clamp(10px, 4vw, 48px)); }
.side1 { background: #ebf3fe; border-color: #d5e5fa; }
.side2 { background: #fdebf2; border-color: #f8d4e3; }
.avatar { object-fit: cover; }
.message-meta .avatar { width: 44px; height: 44px; }
.category { display: inline-flex; align-items: center; gap: 4px; }
.category .icon { width: 14px; height: 14px; }
.reactions button { flex: 1 1 0; min-width: 0; border-radius: 99px; }
.message summary .icon { width: 17px; height: 17px; }
.comment { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.comment .avatar { width: 29px; height: 29px; }
.mobile-nav { display: none; }
@media (max-width: 1000px) {
    .dashboard { grid-template-columns: minmax(155px, 1fr) minmax(0, 3fr); }
    .right-sidebar { display: none; }
}
@media (max-width: 680px) {
    .dashboard { display: block; }
    .left-sidebar { display: none; }
    .app { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
    .banner-inner { min-height: 0; padding: 12px 12px 18px; }
    .brand img { width: 40px; height: 40px; }
    .brand h1 { font-size: 1.8rem; }
    .brand p { font-size: .75rem; }
    .profile-switch { gap: 4px; padding: 4px 7px; }
    .profile-switch span:last-child { font-size: .75rem; }
    .tabs { gap: 7px; margin-bottom: 14px; }
    .tabs a { flex-direction: column; gap: 3px; padding: 8px 4px; }
    .tabs .icon { width: 23px; height: 23px; }
    .day { padding-left: 16px; }
    .day h2 { align-self: flex-start; }
    .timeline::before { left: 5px; }
    .message { width: calc(100% - 10px); padding: 9px; }
    .side1::before { left: -18px; }
    .side2::before { left: -28px; }
    .category { font-size: .75rem; }
    .reactions button { padding: 5px; font-size: .8125rem; }
    .mobile-nav {
        position: fixed; z-index: 2; inset: auto 0 0;
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2px; padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
        background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 15px #5b3b5910;
    }
    .mobile-nav a {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        min-height: 48px; font-size: .75rem; line-height: 1; color: #51415e; text-decoration: none;
    }
    .mobile-nav a[aria-current] { color: #62429a; font-weight: 750; }
    .mobile-nav .mobile-add { justify-self: center; width: 47px; border-radius: 17px; background: #7551b8; color: #fff; }
    .mobile-nav .mobile-add .icon { width: 28px; height: 28px; }
    #body, #search, #changer-profil { scroll-margin: 12px 0 84px; }
}


.mobile-menu { display: none; }
@media (max-width: 680px) {
    .banner-inner { position: relative; }
    .mobile-menu { display: block; position: relative; margin-left: auto; }
    .mobile-menu summary { display: grid; place-items: center; width: 44px; border-radius: 50%; background: var(--card); color: #51365d; box-shadow: var(--shadow); }
    .mobile-menu summary::-webkit-details-marker { display: none; }
    .mobile-menu nav {
        position: absolute; z-index: 3; right: 0; top: calc(100% + 6px); min-width: 170px;
        display: grid; background: #fffbf9; border: 1px solid var(--line); border-radius: 14px;
        padding: 5px; box-shadow: 0 6px 15px #552a581a;
    }
    .mobile-menu a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px; color: inherit; text-decoration: none; }
    .banner-inner > form { order: 3; flex-basis: 100%; }
}

.editor-tools { display: flex; gap: 4px; align-items: center; }
.comment-form .editor-tools { margin-top: 6px; }
.comment-form .editor-tools button { margin-top: 0; }
.emoji-picker { position: relative; }
.emoji-picker summary {
    display: grid; place-items: center; width: 44px; padding: 0;
    border-radius: 50%; background: #f2e3f5; color: #6b437c; font-size: 1.35rem;
}
.emoji-picker summary::-webkit-details-marker { display: none; }
.emoji-options {
    display: grid; grid-template-columns: repeat(4, 44px); gap: 2px;
    position: absolute; z-index: 4; right: 0; top: calc(100% + 4px); padding: 6px;
    border: 1px solid var(--line); border-radius: 13px; background: #fffbfa;
    box-shadow: 0 6px 18px #522f5c26;
}
.emoji-options button { padding: 0; background: #fff5f3; font-size: 1.2rem; }
.activity-ring {
    position: relative; display: grid; place-items: center;
    width: 116px; height: 116px; margin: 10px auto 16px;
}
.activity-ring-chart { position: absolute; inset: 0; width: 100%; fill: none; stroke: var(--lavender); stroke-width: 16; }
.activity-ring-progress { stroke: #9563d2; stroke-linecap: round; }
.activity-heart { color: #d94d87; }
.activity-heart .icon { width: 31px; height: 31px; fill: currentColor; }
.activity-rate { position: absolute; right: -8px; bottom: 3px; padding: 0 4px; border-radius: 8px; background: var(--card); }
@media (max-width: 680px) {
    .comment-form .emoji-options { left: 0; right: auto; }
}

.image-picker {
    position: relative; display: grid; place-items: center; flex: none;
    width: 44px; height: 44px; margin: 0; border-radius: 50%; background: #e6edf9; color: #4d608a;
}
.image-picker input { position: absolute; inset: 0; opacity: 0; height: 100%; cursor: pointer; }
.image-picker:focus-within { outline: 3px solid #72548d; outline-offset: 3px; }
.file-selection:not(:empty) { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: .8125rem; }
.upload-preview:empty { display: none; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.upload-preview img {
    display: block;
    width: auto;
    max-width: min(100%, 10rem);
    max-height: 8rem;
    object-fit: contain;
    border-radius: 10px;
}
.discussion-image { display: block; width: fit-content; max-width: 100%; margin: 8px 0; }
.discussion-image img { display: block; max-width: 100%; max-height: 420px; border-radius: 12px; }
.comment > div { min-width: 0; }
.comment .discussion-image img { max-height: 250px; }
.upcoming { scroll-margin: 12px 0 90px; }
.upcoming ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.upcoming li { display: flex; align-items: baseline; gap: 5px; overflow-wrap: anywhere; font-size: .875rem; }
.upcoming time { padding: 3px 5px; border-radius: 6px; background: #efe3f7; white-space: nowrap; }
.upcoming input { margin-bottom: 8px; }
@media (max-width: 515px) {
    .compose-icon { display: none; }
    .compose-controls { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 1000px) {
    .right-sidebar:has(.upcoming) { display: block; grid-column: 2; }
    .right-sidebar > :not(.upcoming) { display: none; }
}
@media (max-width: 680px) {
    .right-sidebar:has(.upcoming) { margin-top: 16px; }
}

.idees { background: #f0e4f5; color: #542c69; --tab-gradient: linear-gradient(135deg, #8f6bcd, #7551b8); }
.couple-lock { max-width: 420px; margin: 0 auto; }
.couple-lock h2 { margin: 0 0 12px; }
.couple-lock button, .couple-relock { margin-top: 10px; }
.couple-relock { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.upcoming h2 { margin: 0 0 12px; }

.upcoming select {
    width: 100%; min-height: 44px; margin-bottom: 8px; padding: 8px 10px;
    border: 1px solid #d9c6d4; border-radius: 14px; background: #fffdfc; color: inherit; font: inherit;
}
.event-entry > div { min-width: 0; }
.event-icon { flex: none; font-size: 1.05rem; }
.event-gallery {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
    gap: 8px; margin: 6px 0 10px;
}
.event-gallery a { min-width: 0; }
.event-gallery img {
    display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 9px;
}
#event-images { max-width: 100%; font-size: .875rem; }

.idea-tabs, .idea-category-picker {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px; max-width: 430px; margin: 0 0 12px; padding: 0; border: 0; min-width: 0;
}
.idea-tabs a, .idea-category-picker label > span {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 54px; padding: 5px 2px; border: 2px solid transparent; border-radius: 14px;
    background: var(--idea-fill); color: var(--idea-ink); text-decoration: none;
    font-size: .75rem; font-weight: 650; text-align: center;
}
.idees { --idea-fill: #f2dff8; --idea-ink: #582b71; }
.idees-vacances { --idea-fill: #d6effb; --idea-ink: #215974; }
.idees-restaurant { --idea-fill: #ffe0c8; --idea-ink: #783a19; }
.idees-cadeau { --idea-fill: #f9d9eb; --idea-ink: #7d2c57; }
.category[class*="idees"] { background: var(--idea-fill); color: var(--idea-ink); }
.idea-tabs [aria-current], .idea-category-picker input:checked + span { border-color: currentColor; }
.idea-category-picker legend { padding: 0 0 5px; font-size: .875rem; font-weight: 650; }
.idea-category-picker label { position: relative; margin: 0; cursor: pointer; }
.idea-category-picker input {
    position: absolute; width: 1px; min-height: 0; height: 1px; margin: 0; padding: 0; opacity: 0;
}
.idea-category-picker input:focus-visible + span { outline: 3px solid #72548d; outline-offset: 2px; }
.comment-thread { display: flex; flex-direction: column; }
.comment-thread .comment { width: fit-content; max-width: 88%; overflow-wrap: anywhere; }
.comment-side1 { align-self: flex-start; background: #edf6fd; }
.comment-side2 { align-self: flex-end; flex-direction: row-reverse; background: #fbe9f2; }

.balance-panel h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.balance-label { text-align: center; font-weight: 750; }
.balance-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 10px 0; }
.balance-unanswered { background: #eadcec; color: #53435b; }
.pending-counts { display: grid; gap: 4px; margin: 8px 0 12px; padding: 0; list-style: none; font-size: .875rem; }
.pending-counts a { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 6px; border-radius: 9px; color: inherit; text-decoration: none; }
.pending-counts a:hover, .pending-counts [aria-current] { background: #f4e7f7; }
.pending-counts strong { min-width: 1.6em; border-radius: 99px; background: #efe3f7; text-align: center; }
.balance-counts div { display: flex; flex-direction: column-reverse; padding: 6px 3px; border-radius: 10px; background: var(--lavender); color: inherit; text-align: center; }
.balance-counts dt { font-size: .75rem; line-height: 1.15; overflow-wrap: anywhere; }
.balance-counts dd { margin: 2px 0 0; font-weight: 750; }

.banner-account { display: flex; align-items: center; gap: 8px; }
.profile-settings-link, .notifications > summary {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--line); border-radius: 50%; color: #51365d; background: var(--card);
    box-shadow: var(--shadow);
}
.notifications { position: relative; }
.notifications > summary::-webkit-details-marker { display: none; }
.notification-count {
    position: absolute; top: -4px; right: -3px; min-width: 20px; padding: 1px 4px;
    border: 2px solid #fff; border-radius: 99px; background: #ba285a; color: #fff;
    font-size: .75rem; font-weight: 750; text-align: center;
}
.notification-menu {
    position: absolute; z-index: 6; top: calc(100% + 7px); right: 0;
    width: min(255px, calc(100vw - 24px)); padding: 12px;
    border: 1px solid var(--line); border-radius: 14px; background: #fffbfa;
    box-shadow: 0 6px 18px #50305f24; font-size: .875rem;
}
.notification-menu p { margin: 6px 0 0; }
.notification-menu ul { list-style: none; margin: 6px 0; padding: 0; }
.notification-menu li a { display: flex; align-items: center; gap: 5px; min-height: 40px; color: #664587; }
.notification-menu button { width: 100%; }
.profile-editor form { margin: 10px 0; }
.profile-login { max-width: 420px; margin: 0 auto; }
.profile-login button, .profile-credentials button { margin: 10px 8px 0 0; }
.profile-credentials form { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
.profile-credentials h3 { margin: 0 0 10px; }
.profile-credentials input + label { margin-top: 8px; }
.profile-editor p { margin: 5px 0 8px; font-size: .875rem; }
.avatar-decoration { position: relative; display: inline-flex; flex: none; margin-inline: 5px; }
.avatar-decoration::before, .avatar-decoration::after {
    content: ""; position: absolute; width: 10px; height: 2px;
    border-radius: 99px; background: currentColor; pointer-events: none;
}
.profile-decoration-1 { color: #3885c1; }
.profile-decoration-2 { color: #c2487d; }
.profile-decoration-1::before { left: -7px; top: 3px; transform: rotate(30deg); }
.profile-decoration-1::after { left: -2px; top: -3px; transform: rotate(65deg); }
.profile-decoration-2::before { right: -7px; top: 3px; transform: rotate(-30deg); }
.profile-decoration-2::after { right: -2px; top: -3px; transform: rotate(-65deg); }
.avatar-heart {
    position: absolute; top: -8px; right: -15px; font-size: 1rem;
    font-weight: 750; line-height: 1; transform: rotate(14deg); pointer-events: none;
}
.daily-moods { display: grid; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.daily-moods li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: .8125rem; }
.daily-moods .avatar { width: 29px; height: 29px; }
.mood-options { display: flex; flex-wrap: wrap; gap: 4px; }
.mood-options button { width: 44px; padding: 0; background: #ffe9d6; font-size: 1.2rem; }
.mood-options button[aria-pressed="true"] { border: 2px solid #8257a5; background: #f0e0f4; }
.mood-clear { margin-top: 5px; font-size: .8125rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 680px) {
    .banner-account { order: 3; flex-basis: 100%; justify-content: flex-end; }
    .notification-menu { right: auto; left: 0; }
}
@media (max-width: 360px) {
    .notification-menu { left: -30px; }
}

.message-filters { max-width: 720px; margin: -8px auto 14px; }
.tab-count { padding: 2px 6px; border-radius: 99px; background: #aa315d; color: white; font-size: .75rem; }
#clear-search { flex: none; margin-right: 3px; padding: 0; width: 44px; border-radius: 50%; background: transparent; }
.compose-options [type="reset"] { margin-top: 8px; }
.message-filters > summary { width: fit-content; margin-left: auto; color: #62429a; }
.filter-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.filter-controls label { flex: 1 1 145px; margin: 0; min-width: 0; }
.filter-controls select {
    display: block; width: 100%; min-height: 44px; padding: 6px 10px;
    border: 1px solid var(--line); border-radius: 14px;
    font: inherit; color: inherit; background: var(--card);
}
.message-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.undo-action { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.message-actions button { background: var(--card); font-size: .8125rem; border-radius: 99px; }
.message-actions [aria-pressed="true"] { color: #80501d; background: #fff2e5; }
.message-kind { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--card); font-size: .8125rem; }
.message-link a, .upcoming a { overflow-wrap: anywhere; color: inherit; }
.message:target { outline: 2px solid #7551b8; }
.shared-lists { display: grid; gap: 12px; }
.shared-lists h3 { margin-top: 0; }
.shared-lists ul { padding: 0; list-style: none; }
.list-item, .list-add { display: flex; gap: 6px; align-items: center; }
.list-item .avatar { width: 28px; height: 28px; }
.list-item .list-toggle { flex: 1; text-align: left; background: none; overflow-wrap: anywhere; min-width: 0; }
.list-toggle[aria-pressed="true"] span:last-child { text-decoration: line-through; }
.list-clear { margin-top: 8px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; }
.album-grid figure { margin: 0; }
.album-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.album-grid figcaption { margin-top: 6px; overflow-wrap: anywhere; }
.album-grid a { color: inherit; }
.image-dialog { padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: inherit; }
.image-dialog::backdrop { background: #21182cbb; }
.image-dialog img { display: block; max-width: min(85vw, 1100px); max-height: 75vh; margin-top: 8px; object-fit: contain; }
.mobile-menu nav { max-height: 65vh; overflow: auto; }
.message { --bubble-fill: #ebf3fe; --bubble-line: #d5e5fa; padding: 16px 18px; }
.message.side2 { --bubble-fill: #fdebf2; --bubble-line: #f8d4e3; }
.message-meta { padding-right: 36px; }
.message-meta time { color: #746684; font-weight: 700; }
.message-meta .category { margin-left: 4px; background: var(--card); }
.message-menu { position: absolute; top: 4px; right: 11px; z-index: 1; }
.message-menu > summary { display: grid; place-items: center; width: 36px; padding: 0; font-size: 1.2rem; list-style: none; }
.message-menu > summary::-webkit-details-marker { display: none; }
.message-menu .message-actions {
    position: absolute; right: 0; top: 100%; margin: 0; padding: 5px; width: max-content;
    max-width: min(210px, 70vw); background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; box-shadow: var(--shadow);
}
.message-link a {
    display: flex; align-items: center; gap: 12px; width: min(100%, 420px); padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 16px; background: var(--card); text-decoration: none;
}
.message-link a:hover strong { text-decoration: underline; }
.message-link-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--lavender); }
.message-preview-image { flex: none; width: clamp(64px, 14vw, 132px); height: clamp(62px, 10vw, 84px); object-fit: cover; border-radius: 10px; }
.message-link a > span:nth-child(2) { flex: 1; min-width: 0; }
.message-link small { display: block; overflow-wrap: anywhere; }
.message-preview-description { display: block; margin: 2px 0; font-size: .875rem; }
.message-interactions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.message-interactions .reactions { margin: 0; gap: 7px; flex: 0 1 auto; }
.message-interactions .reactions button, .comment-toggle {
    flex: none; min-height: 36px; padding: 6px 11px; border-radius: 99px;
    background: var(--card); border: 1px solid var(--line); font-size: .8125rem; font-weight: 800;
}
.message-interactions .reactions button { border-color: currentColor; }
.message[data-status]:not([data-status="pending"]) .reactions button[aria-pressed="false"] { opacity: .58; }
.message[data-status]:not([data-status="pending"]) .reactions button[aria-pressed="false"]:is(:hover, :focus-visible) { opacity: 1; }
.message-interactions .reactions .agree[aria-pressed="true"] { background: #236640; color: #fff; }
.message-interactions .reactions .disagree[aria-pressed="true"] { background: #fdecef; color: #89364e; border-color: #dba5b4; box-shadow: none; }
[data-theme="dark"] .message-interactions .reactions .disagree[aria-pressed="true"] { background: #51313e; color: #ffd1db; border-color: #a16f80; }
.message-interactions .reactions .discuss[aria-pressed="true"] { background: #874416; color: #fff; }
.comment-toggle .icon { width: 16px; height: 16px; }
.comment-toggle[aria-expanded="true"] { background: var(--lavender); }
.message .awaiting-reaction { color: #a63e6a; font-weight: 800; font-size: .8125rem; margin-bottom: 0; }
.awaiting-reaction span { margin-right: 3px; }
.message .recorded-reaction { font-size: .8125rem; font-weight: 800; margin-bottom: 0; }
.message-comments[open] { margin-top: 10px; }
[data-theme="dark"] .message.side1 { --bubble-fill: #232f45; --bubble-line: #34476a; }
[data-theme="dark"] .message.side2 { --bubble-fill: #3e2639; --bubble-line: #5a3552; }
[data-theme="dark"] .message .awaiting-reaction { color: #ffafcf; }
[data-theme="dark"] .message-interactions button { background: var(--card); }
@media (min-width: 681px) {
    .message { width: calc(100% - 72px); }
    .message.side1 { margin-left: 72px; }
    .message.side2 { margin-right: 72px; }
    .message.side1::before { left: -95px; }
    .message.side2::before { left: -23px; }
    .message-avatar { position: absolute; top: 2px; }
    .side1 .message-avatar { right: calc(100% + 10px); }
    .side2 .message-avatar { left: calc(100% + 10px); }
    .message-avatar .avatar { width: 54px; height: 54px; border: 3px solid var(--card); }
    .message::after {
        content: ""; position: absolute; top: 25px; width: 14px; height: 14px;
        background: var(--bubble-fill); border: solid var(--bubble-line); transform: rotate(45deg);
    }
    .message.side1::after { left: -8px; border-width: 0 0 1px 1px; }
    .message.side2::after { right: -8px; border-width: 1px 1px 0 0; }
}
@media (max-width: 680px) {
    .tab-count { position: absolute; top: 3px; right: 4px; }
    .message { padding: 12px; }
}
@media (max-width: 430px) {
    .compose-controls textarea { min-height: 62px; }
}

:root[data-theme="dark"] {
    color-scheme: dark; color: #f4edfb; background: #1b1524;
    --card: #2a2137; --line: #4a3d5d; --lavender: #372a53; --shadow: 0 8px 22px -12px #0009;
}
[data-theme="dark"] body { background: radial-gradient(ellipse at top, #34233e, #1b1524 70%); }
[data-theme="dark"] .banner { background-color: #302339; background-image: linear-gradient(#251834aa, #251834aa), url("assets/paysage.svg"); }
[data-theme="dark"] :is(.brand h1, .brand p, .brand h1 span, .message-meta time, .empty,
    .mobile-nav a, .panel-link, .message-filters > summary, .day h2, .search-field, .side-panel .handwritten,
    .side-menu [aria-current], .profile-settings-link, .notifications > summary, .mobile-menu summary,
    .notification-menu a) { color: #ecd9ff; }
[data-theme="dark"] :is(.mobile-menu nav, .mobile-menu summary, .notification-menu, .emoji-options,
    .compose-controls textarea, .upcoming select, input, textarea) { background: var(--card); }
[data-theme="dark"] :is(button, .emoji-picker summary, .compose-icon) { background: #47355d; color: #f4edfb; }
[data-theme="dark"] :is(.side1, .comment-side1) { background: #232f45; border-color: #34476a; }
[data-theme="dark"] :is(.side2, .comment-side2) { background: #3e2639; border-color: #5a3552; }
[data-theme="dark"] .agree { background: #1d382a; color: #b6efca; }
[data-theme="dark"] .disagree { background: #432630; color: #ffc2cd; }
[data-theme="dark"] .discuss { background: #42301f; color: #ffdcba; }
[data-theme="dark"] .famille:not([aria-current]) { color: #e0ccff; }

.settings-popover { position: relative; }
.settings-popover summary::-webkit-details-marker { display: none; }
.settings-popover[open] summary { outline: 3px solid #b99cf0; }
.settings-menu {
    position: absolute; z-index: 8; top: calc(100% + 12px); right: 0;
    width: min(330px, calc(100vw - 24px)); overflow: hidden;
    border-radius: 20px; background: var(--card);
    box-shadow: 0 18px 38px -16px #47295f80;
}
.settings-title { display: block; padding: 14px 16px; background: #58416d; color: #fff; }
.settings-options { padding: 10px; }
.settings-row {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; gap: 12px; padding: 10px 12px;
    background: transparent; text-align: left; font-weight: 700;
}
.settings-row small { display: block; color: #6e6080; font-size: .75rem; }
.settings-row:hover { background: var(--lavender); }
.settings-switch { position: relative; flex: none; width: 44px; height: 26px; border-radius: 20px; background: #ede4f2; }
.settings-switch::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px; border-radius: 50%; background: #fff;
    box-shadow: 0 2px 4px #39254740;
}
.settings-row[aria-checked="true"] .settings-switch { background: #8059cb; }
.settings-row[aria-checked="true"] .settings-switch::after { left: 21px; }
.settings-reset { color: #b3264b; }
.settings-profile { color: inherit; font-size: .875rem; }
.demo-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
[data-theme="dark"] .settings-row { background: transparent; }
[data-theme="dark"] .settings-row:hover { background: var(--lavender); }
[data-theme="dark"] .settings-row small { color: #d0bddf; }
[data-theme="dark"] .settings-reset { color: #ffafc4; }
@media (max-width: 680px) {
    .settings-popover { position: static; }
    .settings-menu { top: calc(100% - 8px); right: 12px; }
}
