/* ============================================================
   hopla.space — BRAND LAYER (loaded LAST on every app/auth page)
   Brings the landing-page design to the real app: self-hosted
   Inter, paper/ink palette, flat accent (no gradients), quiet
   cards, ink primary buttons, line icons. The 10 accent themes
   and light/dark mode keep working (accent = --rb-pink).
   ============================================================ */
@font-face { font-family: "Inter"; src: url("../fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---- tokens: light (default) ---- */
:root, html[data-theme="light"] {
    --bg-0: #fbf9f6;          /* page (paper) */
    --bg-1: #f5f2ed;          /* subtle surfaces: sidebar, inputs */
    --bg-2: #ffffff;          /* cards */
    --bg-3: #efebe5;
    --text-1: #17131f;        /* ink */
    --text-2: #3d3748;
    --text-3: #6f6879;
    --border: rgba(23,19,31,.09);
    --border-2: rgba(23,19,31,.15);
    --glass: rgba(23,19,31,.035);
    --glass-hover: rgba(23,19,31,.06);
    --shadow: 0 1px 2px rgba(23,19,31,.05), 0 12px 32px -12px rgba(23,19,31,.18);
    --shadow-1: 0 1px 2px rgba(23,19,31,.05), 0 4px 14px rgba(23,19,31,.05);
    --ink-btn: #17131f;
    --ink-btn-hover: #000;
    --ink-btn-text: #ffffff;
    --serif: "Instrument Serif", ui-serif, Georgia, serif;
    color-scheme: light;
}
html[data-theme="dark"] {
    --bg-0: #121016;
    --bg-1: #17141c;
    --bg-2: #1d1a23;
    --bg-3: #25212c;
    --text-1: #f4f1f7;
    --text-2: #cdc7d5;
    --text-3: #918a9c;
    --border: rgba(255,255,255,.08);
    --border-2: rgba(255,255,255,.14);
    --glass: rgba(255,255,255,.04);
    --glass-hover: rgba(255,255,255,.07);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -12px rgba(0,0,0,.6);
    --shadow-1: 0 1px 2px rgba(0,0,0,.25), 0 4px 14px rgba(0,0,0,.25);
    --ink-btn: #f4f1f7;
    --ink-btn-hover: #ffffff;
    --ink-btn-text: #17131f;
    color-scheme: dark;
}
/* Flat accent instead of gradients — keeps the user's colour theme */
html, html[data-color] {
    --rb-gradient: var(--rb-pink);
    --rb-gradient-soft: color-mix(in srgb, var(--rb-pink) 11%, transparent);
    --rb-purple: color-mix(in srgb, var(--rb-pink) 82%, var(--text-1));
    --accent-soft: color-mix(in srgb, var(--rb-pink) 12%, transparent);
}

/* ---- base ---- */
html, body {
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-feature-settings: "ss01", "cv11";
    letter-spacing: -.003em;
    background: var(--bg-0);
}
h1, h2, h3, h4 { letter-spacing: -.025em; font-weight: 650; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: color-mix(in srgb, var(--rb-pink) 25%, transparent); }

/* ---- buttons ---- */
.btn { border-radius: 999px; font-weight: 600; border-color: var(--border-2); background: var(--bg-2); box-shadow: none; }
.btn:hover { background: var(--bg-1); border-color: var(--text-3); transform: none; }
.btn-primary, .btn-primary:hover {
    background: var(--ink-btn); color: var(--ink-btn-text); border-color: var(--ink-btn);
    box-shadow: 0 1px 0 rgba(255,255,255,.1) inset, 0 6px 16px -8px rgba(23,19,31,.5);
    filter: none;
}
.btn-primary:hover { background: var(--ink-btn-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--glass-hover); border-color: transparent; }
.btn-icon { border-radius: 10px; }

/* ---- forms ---- */
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=search], input[type=url], input[type=tel], textarea, select {
    background: var(--bg-2); border-color: var(--border-2); border-radius: 11px;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--text-1) !important; outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-1) 9%, transparent) !important;
}
.form-row label { font-weight: 500; color: var(--text-2); }
.pill { border-radius: 999px; }
.pill.active { background: var(--ink-btn) !important; color: var(--ink-btn-text) !important; border-color: var(--ink-btn) !important; box-shadow: none !important; }
.chip-check.checked { border-color: var(--text-1); }
.chip-check.checked::before { color: var(--rb-pink); }
.rb-switch input:checked ~ .track { background: var(--rb-pink); }
.rb-validate-bubble { background: var(--ink-btn); color: var(--ink-btn-text); box-shadow: var(--shadow); }
.rb-validate-bubble::before { border-bottom-color: var(--ink-btn); }

/* ---- cards & misc ---- */
.card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-1); }
.chip { border-radius: 999px; }
.empty .emoji { filter: grayscale(.2); }
.toast { border-radius: 14px !important; }

/* ---- app header (mobile) / toolbar (desktop) ---- */
.app-header, html[data-theme="light"] .app-header {
    background: color-mix(in srgb, var(--bg-0) 82%, transparent);
    backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.app-brand .logo { border-radius: 9px; }
.header-btn { border-radius: 11px; background: transparent; border-color: var(--border); color: var(--text-2); }
.header-btn:hover { background: var(--glass-hover); color: var(--text-1); }
.header-btn .ic { width: 19px; height: 19px; }
.header-btn .dot { background: var(--rb-pink); }
.band-switch { background: var(--bg-2); border-color: var(--border-2); font-weight: 600; }
.band-switch .ic { width: 17px; height: 17px; color: var(--text-3); }
.user-btn, .ds-user-av { background: var(--ink-btn) !important; color: var(--ink-btn-text) !important; }
.user-menu, .band-menu, .notif-panel { border-radius: 14px; box-shadow: var(--shadow); }
.user-menu .ico, .band-menu .ico { display: inline-flex; color: var(--text-3); }
.user-menu .ico .ic, .band-menu .ico .ic { width: 17px; height: 17px; }
.user-menu .logout { color: #d33b40; }
.user-menu .logout .ico { color: #d33b40; }
.notif.unread { background: var(--accent-soft); }

/* ---- mobile bottom tab bar ---- */
.bottom-nav { background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: none; }
.bottom-nav a { color: var(--text-3); font-weight: 500; font-size: .68rem; }
.bottom-nav a .bn-ico { filter: none; opacity: 1; display: inline-flex; }
.bottom-nav a .bn-ico .ic { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--text-1); }
.bottom-nav a.active .bn-ico { color: var(--rb-pink); transform: none; }

/* ---- page headers ---- */
.page-header h1 { font-size: 1.75rem; font-weight: 650; letter-spacing: -.035em; }

/* ---- dashboard ---- */
.dash-hello h1 { font-weight: 650; letter-spacing: -.04em; }
.dash-hello h1 .serif { color: var(--rb-pink); font-size: 1.08em; }
.dash-tile { background: var(--bg-2); border-radius: 18px; box-shadow: var(--shadow-1); padding: 20px; gap: 14px; }
.dash-tile::before { display: none; }
.dash-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.tile-ico {
    width: 40px; height: 40px; border-radius: 12px; box-shadow: none;
    background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c);
}
.tile-ico .ic { width: 21px; height: 21px; }
.tile-label { font-weight: 650; font-size: 1.05rem; letter-spacing: -.02em; }
.tile-count { background: var(--bg-1); color: var(--text-2); box-shadow: none; font-weight: 600; font-size: .8rem; min-width: 26px; height: 26px; }
.tile-preview li::before { background: var(--c); opacity: .9; }
.tp-main { font-weight: 500; }
.dash-tile--coral  { --c: #e5484d; }
.dash-tile--sun    { --c: #d48806; }
.dash-tile--mint   { --c: #12a28b; }
.dash-tile--violet { --c: #6e56cf; }
.dash-tile--sky    { --c: #1f8fd0; }
.dash-tile--pink   { --c: #d6409f; }
.dash-strip-head h3 { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -.02em; }
.dash-strip-head h3 .ic { color: var(--rb-pink); }
.strip-card { border-radius: 14px; box-shadow: none; }
.strip-when.hot { background: var(--rb-pink); }
.strip-card.strip-anniv.today { background: var(--accent-soft); }
.welcome-banner { background: var(--bg-2) !important; color: var(--text-1) !important; border: 1px solid var(--border); border-radius: 18px; }

/* "set your password" / read-only banners in app.php */
.setpwd-banner { background: var(--ink-btn) !important; color: var(--ink-btn-text) !important; box-shadow: var(--shadow) !important; border-radius: 16px !important; }
.setpwd-banner .setpwd-btn { background: var(--rb-pink) !important; color: #fff !important; }

/* ---- full-screen form sheets ---- */
.modal-sheet .modal > header h3 { font-weight: 650; letter-spacing: -.03em; }

/* ---- desktop sidebar refinements ---- */
@media (min-width: 1024px) {
    .ds-brand img { border-radius: 9px; }
    .ds-brand-txt { font-weight: 700; letter-spacing: -.035em; font-size: 1.08rem; }
    .ds-brand-txt b { color: var(--text-3); font-weight: 500; }
    .ds-item.active { background: var(--bg-2); box-shadow: var(--shadow-1); }
    .ds-nav .ds-item.active::before { background: var(--rb-pink); }
    .ds-item.active .ds-ico { color: var(--rb-pink); }
    .ds-ico { display: inline-flex; justify-content: center; color: var(--text-3); }
    .ds-ico .ic { width: 18px; height: 18px; }
    .ds-pro { background: var(--ink-btn); color: var(--ink-btn-text); }
    .dt-ico { display: inline-flex; color: var(--rb-pink); }
    .dt-ico .ic { width: 18px; height: 18px; }
}

/* ---- auth / standalone pages (login, signup, forgot, reset, verify, invite, contact, legal) ---- */
body.brand-page { background: var(--bg-0); }
.brand-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; color: var(--text-1); }
.brand-logo img { display: block; border-radius: 9px; }
.brand-logo span { font-weight: 700; font-size: 1.12rem; letter-spacing: -.035em; color: var(--text-1); }
.brand-logo span i { font-style: normal; color: #a39dab; font-weight: 500; }

/* ---- standalone pages: overrides of landing.css + inline page styles ---- */
body.brand-page { font-family: "Inter", ui-sans-serif, system-ui, sans-serif; color: var(--text-1); }
body.brand-page .auth-wrap {
    background:
        radial-gradient(40% 50% at 18% 20%, rgba(255,90,95,.08), transparent 70%),
        radial-gradient(38% 46% at 85% 85%, rgba(124,92,252,.07), transparent 70%),
        var(--bg-0) !important;
}
body.brand-page .auth-wrap::before { display: none !important; }
body.brand-page .auth-card {
    background: var(--bg-2) !important; border: 1px solid var(--border) !important;
    border-radius: 22px !important; box-shadow: var(--shadow) !important;
}
body.brand-page .auth-card h1, body.brand-page .auth-card h2 { font-weight: 650; letter-spacing: -.035em; }
body.brand-page .brand-row { margin-bottom: 24px !important; }
.brand-wm { font-weight: 700; font-size: 1.12rem; letter-spacing: -.035em; color: var(--text-1); }
.brand-wm i { font-style: normal; font-weight: 500; color: #a39dab; }
body.brand-page .legal-head .brand-logo, body.brand-page .brand-logo { background: transparent !important; width: auto; height: auto; }
body.brand-page .landing-header, body.brand-page .legal-head {
    background: color-mix(in srgb, var(--bg-0) 82%, transparent) !important;
    backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border);
}
body.brand-page .brand { font-weight: 700; letter-spacing: -.035em; color: var(--text-1); }
body.brand-page h1, body.brand-page h2, body.brand-page h3 { letter-spacing: -.03em; }
body.brand-page .grad, body.brand-page .mascot-tint { background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--text-1) !important; }
body.brand-page .landing-footer { background: var(--bg-0); border-top: 1px solid var(--border); color: var(--text-3); }
body.brand-page a:not(.btn) { color: var(--text-1); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; }
body.brand-page a:not(.btn):hover { text-decoration-color: var(--text-1); }
body.brand-page .auth-close, body.brand-page .auth-back, body.brand-page .brand-row a, body.brand-page a.brand { text-decoration: none !important; }

/* icon buttons & empty states */
.btn .ic { width: 16px; height: 16px; }
.btn-sm .ic { width: 15px; height: 15px; }
.note-card .actions button .ic { width: 14px; height: 14px; }
.empty .emoji { color: var(--text-3); display: flex; justify-content: center; margin-bottom: 8px; }
.anniv-x, .chat-topic-btn, .li-del { color: var(--text-3); }
.anniv-x:hover, .chat-topic-btn:hover { color: var(--text-1); }
.band-logo-fallback { color: var(--text-3); display: inline-flex; }

/* standalone pages: beat landing.css */
body.brand-page .btn-primary, body.brand-page .btn-primary:hover {
    background: var(--ink-btn) !important; color: var(--ink-btn-text) !important; border-color: var(--ink-btn) !important;
    box-shadow: 0 6px 16px -8px rgba(23,19,31,.5) !important; filter: none !important;
}
body.brand-page .btn-primary:hover { background: var(--ink-btn-hover) !important; }
body.brand-page label, body.brand-page .form-row label { color: var(--text-2) !important; font-weight: 500; }

/* phones: tile title gets its own line (no more "Dat…") */
@media (max-width: 560px) {
    .tile-head { flex-wrap: wrap; row-gap: 10px; }
    .tile-label { order: 3; flex-basis: 100%; white-space: normal; }
    .tile-count { order: 2; }
}

/* ---- calendar: never overflow (7 equal columns that can shrink) ---- */
.cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-width: 0; }
.cal-ev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--accent-soft); border-left-color: var(--rb-pink); }
.cal-cell.today .num { background: var(--ink-btn); color: var(--ink-btn-text); }
@media (max-width: 560px) {
    .cal-cell { min-height: 62px; padding: 4px 3px; }
    .cal-cell .num { font-size: .78rem; }
    .cal-dow { padding: 6px 0; font-size: .64rem; letter-spacing: 0; }
    .cal-ev { font-size: .6rem; padding: 1px 3px; border-left-width: 2px; }
    .page-header { gap: 8px; }
    .page-header .btn { padding: 7px 11px; font-size: .82rem; white-space: nowrap; }
    .page-header h1 { font-size: 1.5rem; }
}

/* ---- phone header: the bottom tab bar already has "Accueil" ---- */
@media (max-width: 1023px) {
    .app-header .left > .header-btn { display: none; }
    .app-header { padding: 8px 12px; }
}
@media (max-width: 420px) {
    .band-switch { max-width: 150px; padding: 6px 12px; }
    .app-header .right { gap: 6px; }
}

/* ---- desktop: 2 tile columns until there's room for 3 + the side column ---- */
@media (min-width: 1024px) and (max-width: 1400px) {
    .dash-home > .dash-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .page-header > .row { flex-wrap: wrap; gap: 6px; width: 100%; }
}

/* ---- Courses: featured wide tile on the dashboard ---- */
/* wide only in the 3-column layout (large screens); fills gaps whatever the user order */
@media (min-width: 1401px) {
    .dash-home > .dash-tiles { grid-auto-flow: row dense; }
    .dash-tile.wide { grid-column: span 2; }
    .dash-tile.wide .tile-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
}

/* ---- Time picker: clock face ---- */
.rb-timepicker.rb-clock { width: auto; padding: 14px 16px 12px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--border); box-shadow: var(--shadow); }
.rb-clock .ck-head { display: flex; align-items: center; justify-content: center; gap: 2px; }
.rb-clock .ck-part { font: 650 2rem/1 "Inter", sans-serif; letter-spacing: -.03em; padding: 6px 10px; border-radius: 12px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; }
.rb-clock .ck-part.on { color: var(--text-1); background: var(--bg-1); }
.rb-clock .ck-colon { font: 650 2rem/1 "Inter", sans-serif; color: var(--text-3); }
.rb-clock .ck-hint { text-align: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 6px 0 8px; }
.rb-clock .ck-dial { position: relative; margin: 0 auto; border-radius: 50%; background: var(--bg-1); }
.rb-clock .ck-n {
    position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%;
    border: 0; background: transparent; color: var(--text-1); font: 600 .92rem/1 "Inter", sans-serif; cursor: pointer; padding: 0; z-index: 2;
}
.rb-clock .ck-n.ck-in { width: 30px; height: 30px; font-size: .74rem; color: var(--text-3); }
.rb-clock .ck-n:hover { background: var(--glass-hover); }
.rb-clock .ck-n.sel { background: var(--ink-btn); color: var(--ink-btn-text); }
.rb-clock .ck-center { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--ink-btn); z-index: 1; }
.rb-clock .ck-hand { position: absolute; left: 50%; bottom: 50%; width: 2px; margin-left: -1px; background: var(--ink-btn); transform-origin: 50% 100%; z-index: 1; }
.rb-clock .rb-tp-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; padding: 0; border: 0; }
.rb-clock .rb-tp-foot button { border-radius: 999px; padding: 7px 16px; font-weight: 600; }
.rb-clock .rb-tp-foot button[data-tp="ok"] { background: var(--ink-btn); color: var(--ink-btn-text); border-color: var(--ink-btn); }
/* phones: centred sheet at the bottom of the screen */
.rb-timepicker.rb-clock.ck-sheet { position: fixed; left: 50% !important; top: auto !important; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100001; }

/* ---- Event form (agenda) ---- */
.ev-form .ev-title { font-size: 1.25rem; font-weight: 650; letter-spacing: -.02em; padding: 12px 14px; }
.ev-form .ev-field { position: relative; }
.ev-form .ev-field > .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.ev-form .ev-field input { padding-left: 40px; }
.ev-when { border: 1px solid var(--border); background: var(--bg-2); border-radius: 16px; padding: 12px 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.ev-line { display: grid; grid-template-columns: 52px minmax(0, 1fr) 96px; gap: 10px; align-items: center; }
.ev-lbl { font-weight: 600; color: var(--text-2); font-size: .9rem; }
.ev-line .ev-time { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; cursor: pointer; }
.ev-form.is-allday .ev-time { visibility: hidden; }
.ev-form.is-allday .ev-line { grid-template-columns: 52px minmax(0, 1fr) 0; gap: 10px 10px; }
.ev-allday { margin-top: 2px; }
/* participants: tap the faces */
.ev-people { display: flex; flex-wrap: wrap; gap: 10px 8px; align-items: flex-start; }
.ev-all {
    align-self: center; height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
    border: 1px dashed var(--border-2); background: transparent; color: var(--text-2); font: 600 .85rem "Inter", sans-serif;
}
.ev-all.on { border-style: solid; background: var(--ink-btn); color: var(--ink-btn-text); border-color: var(--ink-btn); }
.ev-p { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 64px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--text-3); }
.ev-av {
    position: relative; width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center; font: 700 1.05rem "Inter", sans-serif; color: #fff;
    background: var(--c); filter: grayscale(1); opacity: .35; transition: filter .15s, opacity .15s, transform .15s;
}
.ev-p.on .ev-av { filter: none; opacity: 1; box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--c); }
.ev-p:active .ev-av { transform: scale(.94); }
.ev-tick {
    position: absolute; right: -3px; bottom: -3px; width: 19px; height: 19px; border-radius: 50%;
    display: none; place-items: center; background: var(--ink-btn); color: var(--ink-btn-text); border: 2px solid var(--bg-0);
}
.ev-tick .ic { width: 11px; height: 11px; stroke-width: 3; }
.ev-p.on .ev-tick { display: grid; }
.ev-name { font-size: .74rem; font-weight: 600; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-p.on .ev-name { color: var(--text-1); }
.ev-more { margin: 4px 0 0; border-top: 1px solid var(--border); padding-top: 12px; }
.ev-more > summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
@media (max-width: 560px) {
    .ev-line { grid-template-columns: 40px minmax(0, 1fr) 84px; gap: 8px; }
    .ev-form.is-allday .ev-line { grid-template-columns: 40px minmax(0, 1fr) 0; }
}
@media (max-width: 560px) {
    .ev-actions { flex-wrap: wrap; }
    .ev-actions > div[style*="flex:1"] { display: none; }
    .ev-actions .btn { flex: 1 1 auto; }
    .ev-actions .btn-primary { flex-basis: 100%; order: -1; padding: 12px; }
}

/* ---- Buttons follow the user's accent colour (Profile → colour) ----
   --accent-strong = a deeper shade of each accent so white text stays readable
   (WCAG ≥ 4.5:1). Only inside the app (html[data-color]); the landing and the
   login/signup pages keep the ink buttons. */
/* Three values per accent:
     --accent-strong = readable shade for TEXT and outlines on the page background
     --accent-fill   = the colour of filled surfaces (buttons, home banner, active pills)
     --accent-on     = the text colour on top of --accent-fill
   Dark accents: fill = strong, white text. LIGHT accents (rose, amber, sky) get a
   clearly lighter fill with dark text, so they no longer look like their dark
   neighbours (amber vs sunset, sky vs ocean, rose vs cherry). */
html[data-color]          { --accent-strong: #d93f45; --accent-fill: var(--accent-strong); --accent-on: #ffffff; }
html[data-color="coral"]  { --accent-strong: #d93f45; }
html[data-color="ocean"]  { --accent-strong: #2563eb; }
html[data-color="forest"] { --accent-strong: #15803d; }
html[data-color="sunset"] { --accent-strong: #c2410c; }
html[data-color="grape"]  { --accent-strong: #7c3aed; }
html[data-color="teal"]   { --accent-strong: #0f766e; }
html[data-color="cherry"] { --accent-strong: #b3123a; }
html[data-color="rose"]   { --accent-strong: #c0256b; --accent-fill: #f790c2; --accent-on: #4a0f2c; }
html[data-color="amber"]  { --accent-strong: #9a5b00; --accent-fill: #ffc531; --accent-on: #3a2500; }
html[data-color="sky"]    { --accent-strong: #0369a1; --accent-fill: #6dcff6; --accent-on: #06283d; }
html[data-color], html[data-color][data-theme="dark"], html[data-color][data-theme="light"] {
    --ink-btn: var(--accent-fill);
    --ink-btn-hover: color-mix(in srgb, var(--accent-fill) 86%, #000);
    --ink-btn-text: var(--accent-on);
}
html[data-color] .btn-primary { box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent-fill) 70%, transparent); }
html[data-color] .setpwd-banner .setpwd-btn { background: #fff !important; color: var(--accent-strong) !important; }

/* ---- Courses (shopping) ---- */
.shop-head { margin-bottom: 12px; }
.shop-add {
    position: sticky; top: 64px; z-index: 5;
    display: flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 6px 6px 14px;
    background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow-1);
}
.shop-add > .ic { color: var(--text-3); width: 20px; height: 20px; }
.shop-add input { flex: 1; border: 0 !important; box-shadow: none !important; background: transparent; font-size: 1.02rem; padding: 10px 4px; }
.shop-add-btn { width: 44px; height: 44px; padding: 0; border-radius: 12px; }
.shop-add-btn .ic { width: 20px; height: 20px; }
.shop-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.shop-cat { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 12px 8px 6px; box-shadow: var(--shadow-1); }
.shop-cat h3 { display: flex; align-items: center; gap: 8px; margin: 0 8px 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.shop-cat h3 em { font-style: normal; margin-left: auto; color: var(--text-3); font-weight: 600; }
.shop-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cc); }
.shop-items { list-style: none; margin: 0; padding: 0; }
.shop-item {
    display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 12px; cursor: pointer;
    user-select: none; -webkit-user-select: none; transition: background .12s, opacity .16s, transform .16s;
}
.shop-item:hover { background: var(--glass-hover); }
.shop-item.leaving { opacity: 0; transform: translateX(14px); }
.shop-check {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; padding: 0; cursor: pointer;
    border: 2px solid var(--border-2); background: transparent; color: transparent; display: grid; place-items: center;
}
.shop-check .ic { width: 15px; height: 15px; stroke-width: 3; }
.shop-label { flex: 1; min-width: 0; font-size: 1rem; font-weight: 500; overflow-wrap: anywhere; }
.shop-del { flex: 0 0 auto; border: 0; background: transparent; color: var(--text-3); font-size: 1.3rem; line-height: 1; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; }
.shop-del:hover { background: var(--glass-hover); color: #d33b40; }
.shop-item.done .shop-check { background: var(--ink-btn); border-color: var(--ink-btn); color: var(--ink-btn-text); }
.shop-item.done .shop-label { text-decoration: line-through; color: var(--text-3); }
.shop-cart { margin-top: 22px; background: var(--bg-1); border: 1px dashed var(--border-2); border-radius: 16px; padding: 10px 8px 6px; }
.shop-cart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 8px 4px; color: var(--text-2); font-weight: 600; }
.shop-cart-head span { display: inline-flex; align-items: center; gap: 6px; }
.shop-cart-head .ic { width: 16px; height: 16px; }
@media (max-width: 560px) {
    .shop-add { top: 58px; }
    .shop-list { grid-template-columns: 1fr; }
    .shop-del { width: 40px; height: 40px; }
}
@media (min-width: 1024px) { .shop-add { top: 72px; } }

/* ---- Home banner: greeting + today + message of the day ---- */
.dash-banner {
    display: flex !important; flex-direction: column; gap: 18px;
    position: relative; overflow: hidden; margin: 0 0 22px;
    padding: 26px 28px; border-radius: 24px; color: var(--accent-on, #fff);
    background:
        radial-gradient(60% 120% at 100% 0%, rgba(255,255,255,.22), transparent 60%),
        radial-gradient(50% 90% at 0% 100%, rgba(0,0,0,.18), transparent 70%),
        var(--accent-fill, #d93f45);
    box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--accent-fill, #d93f45) 70%, transparent);
}
.dash-banner::after { /* soft rings, purely decorative */
    content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
    border: 28px solid rgba(255,255,255,.08); pointer-events: none;
}
.dash-banner .bn-date { font-size: .82rem; font-weight: 600; opacity: .85; letter-spacing: .01em; }
.dash-banner h1 { margin: 4px 0 6px; font-size: 2rem; font-weight: 650; letter-spacing: -.04em; color: var(--accent-on, #fff); }
.dash-banner h1 .serif { color: var(--accent-on, #fff); font-size: 1.08em; }
.dash-banner .bn-status { margin: 0; font-size: 1.08rem; font-weight: 550; max-width: 640px; }
.bn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bn-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); color: var(--accent-on, #fff) !important;
    font-size: .88rem; font-weight: 600; text-decoration: none !important; backdrop-filter: blur(4px);
}
.bn-chip:hover { background: rgba(255,255,255,.28); }
.bn-chip .ic { width: 16px; height: 16px; }
.dash-banner .bn-quote {
    position: relative; margin: 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.22);
    font-size: .98rem; opacity: .95; max-width: 720px;
}
.dash-banner .bn-quote .serif { font-size: 1.25em; opacity: .8; }
@media (min-width: 1024px) {
    .dash-home > .dash-banner { grid-area: hello; margin: 0; }
}
@media (max-width: 560px) {
    .dash-banner { padding: 20px 18px; border-radius: 20px; gap: 14px; margin-bottom: 18px; }
    .dash-banner h1 { font-size: 1.6rem; }
    .dash-banner .bn-status { font-size: 1rem; }
}
.dash-hello.dash-banner p, .dash-hello.dash-banner .bn-status, .dash-hello.dash-banner .bn-quote { color: var(--accent-on, #fff); }
/* Light accents: the translucent chips need a darker veil to stay visible */
html[data-color="rose"] .bn-chip, html[data-color="amber"] .bn-chip, html[data-color="sky"] .bn-chip { background: rgba(255,255,255,.42); border-color: rgba(0,0,0,.10); }

/* ---- Desktop: user menu opens from the sidebar pill (header avatar hidden) ---- */
@media (min-width: 1024px) {
    .app-header .user-wrap { display: none; }
    button.ds-user { width: 100%; font: inherit; text-align: left; cursor: pointer; }
    .ds-user-chev { margin-left: auto; display: inline-flex; color: var(--text-3); transform: rotate(180deg); transition: transform .15s; }
    .ds-user-chev .ic { width: 16px; height: 16px; }
    .desk-side > #userMenu {
        position: absolute; left: 12px; right: 12px; bottom: 76px; top: auto;
        min-width: 0; z-index: 80;
    }
    .desk-side > #userMenu .um-manage { display: none; }
    html.side-collapsed .desk-side > #userMenu { left: 10px; right: auto; width: 240px; }
    html.side-collapsed .ds-user-chev { display: none; }
}
.shop-del { display: grid; place-items: center; }
.shop-del .ic { width: 17px; height: 17px; }
/* Courses: rename in place */
.shop-edit { flex: 0 0 auto; border: 0; background: transparent; color: var(--text-3); width: 32px; height: 32px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.shop-edit .ic { width: 16px; height: 16px; }
.shop-edit:hover { background: var(--glass-hover); color: var(--text-1); }
.shop-item.editing { background: var(--bg-1); cursor: default; }
.shop-edit-input { flex: 1; min-width: 0; padding: 7px 10px !important; font-size: 1rem; }
.shop-item.done .shop-edit { display: none; }
@media (max-width: 560px) { .shop-edit { width: 38px; height: 38px; } }
/* In the trolley: tap = back to the list, "Vider le caddie" = remove → no bin per item */
.shop-item.done .shop-del { display: none; }
.shop-item .shop-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-right: -4px; }
/* Agenda day panel: event type as a small coloured chip (not inside the date box) */
.ev-type-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; margin-right: 4px; border-radius: 999px;
    font-size: .74rem; font-weight: 600; color: var(--text-1);
    background: color-mix(in srgb, var(--tc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 35%, transparent);
}
.event-row .dateblock .m { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-row .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; }

/* Calendar "today": a small circle around the day number only (the old full-width
   pill looked like an event). */
.cal-cell .num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px; line-height: 1; }
.cal-cell.today .num { background: var(--ink-btn); color: var(--ink-btn-text); padding: 0 4px; }
@media (max-width: 560px) { .cal-cell .num { min-width: 22px; height: 22px; } }
/* Agenda: events open directly; past events of the month dimmed */
.cal-ev { cursor: pointer; }
.cal-ev:hover { filter: brightness(.96); outline: 1px solid color-mix(in srgb, var(--text-1) 15%, transparent); }
.cal-more { background: var(--bg-1) !important; border-left-color: var(--border-2) !important; color: var(--text-2); font-weight: 600; }
.event-row.is-past { opacity: .55; }
.event-row.is-past:hover { opacity: .85; }

/* Dashboard: "to do" counters (agenda, courses, tâches, dates) pop out */
.tile-count.tile-count--hot {
    min-width: 38px; height: 38px; padding: 0 11px;
    font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em;
    color: #fff; background: color-mix(in srgb, var(--c) 86%, #000);
    box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--c) 80%, transparent);
}
@media (max-width: 560px) {
    .tile-count.tile-count--hot { min-width: 34px; height: 34px; font-size: 1.05rem; }
}

/* ---- Seasonal decor (admin → Thèmes saisonniers) ----
   Pattern on the page background only: cards/sidebar stay opaque, so content
   remains perfectly readable; the decor shows in the gaps. */
body.app-body.has-season {
    background-color: var(--bg-0);
    background-image: var(--season-bg);
    background-size: 260px 260px;
    background-attachment: fixed;
}
@media (max-width: 1023px) { body.app-body.has-season { background-attachment: scroll; background-size: 220px 220px; } }
/* Same theme on the home banner: white translucent motifs over the accent colour */
body.has-season .dash-banner {
    background:
        var(--season-banner) 0 0 / 200px 200px repeat,
        radial-gradient(60% 120% at 100% 0%, rgba(255,255,255,.22), transparent 60%),
        radial-gradient(50% 90% at 0% 100%, rgba(0,0,0,.18), transparent 70%),
        var(--accent-strong, #d93f45);
}
@media (max-width: 560px) { body.has-season .dash-banner { background-size: 170px 170px, auto, auto, auto; } }

/* ---- Agenda: header + month switcher (one segmented control, not 5 pills) ---- */
.page-header.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: nowrap; }
.page-header.ag-head h1 { margin: 0; }
.ag-new { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ag-new .ic { width: 18px; height: 18px; }
.ag-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.ag-month {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px;
    background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px;
}
.ag-month strong { min-width: 150px; text-align: center; font-size: 1rem; font-weight: 650; letter-spacing: -.01em; }
.ag-arrow {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px;
    color: var(--text-1); text-decoration: none;
}
.ag-arrow:hover { background: var(--glass-hover); }
.ag-arrow .ic { width: 18px; height: 18px; }
.ag-arrow--next .ic { transform: rotate(180deg); }
.ag-today {
    font-size: .9rem; font-weight: 600; color: var(--accent-strong, var(--text-1)); text-decoration: none;
    padding: 8px 12px; border-radius: 999px;
}
.ag-today:hover { background: var(--glass-hover); }
@media (max-width: 560px) {
    .ag-new { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 999px; }
    .ag-new span { display: none; }
    .ag-new .ic { width: 22px; height: 22px; }
    .ag-month { flex: 1; justify-content: space-between; }
    .ag-month strong { min-width: 0; }
}

/* ---- Phone: "À venir & à fêter" as a compact vertical list (the side-scrolling
   carousel looked like it overflowed the screen). Max 4 items. ---- */
@media (max-width: 1023px) {
    .dash-strip { flex-direction: column; overflow: visible; padding: 0; gap: 8px; scroll-snap-type: none; }
    .dash-strip > .strip-card { flex: 0 0 auto; width: auto; min-width: 0; padding: 12px 14px; box-shadow: none; }
    .dash-strip > .strip-card:nth-child(n+5) { display: none; }
    .dash-strip > .strip-card:hover { transform: none; }
}
/* Thin, discreet page scrollbar (desktop browsers) */
html { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-3) 45%, transparent) transparent; }
@media (min-width: 561px) { .ag-nav { justify-content: flex-start; } }

/* ---- Agenda: month/year picker popover ---- */
.ag-month { position: relative; }
.ag-month-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 170px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px;
    background: transparent; color: var(--text-1); font: inherit; cursor: pointer;
}
.ag-month-btn strong { min-width: 0 !important; }
.ag-month-btn .ic { width: 15px; height: 15px; color: var(--text-3); transition: transform .18s; }
.ag-month-btn:hover { background: var(--glass-hover); }
.ag-month-btn[aria-expanded="true"] { background: var(--glass-hover); }
.ag-month-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.ag-picker {
    position: absolute; z-index: 60; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    width: 300px; padding: 14px; border-radius: 20px;
    background: var(--bg-2); border: 1px solid var(--border);
    box-shadow: 0 24px 50px -18px rgba(23,19,31,.35), 0 2px 6px rgba(23,19,31,.06);
    animation: agpIn .16s ease-out;
}
.ag-picker[hidden] { display: none; }
@keyframes agpIn { from { opacity: 0; transform: translate(-50%, -6px) scale(.98); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.agp-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.agp-year strong { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.agp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.agp-months button {
    position: relative; height: 44px; border: 0; border-radius: 12px; cursor: pointer;
    background: transparent; color: var(--text-1); font: inherit; font-size: .95rem; font-weight: 550;
    transition: background .12s, transform .12s;
}
.agp-months button:hover { background: var(--glass-hover); }
.agp-months button:active { transform: scale(.96); }
.agp-months button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 1px; }
.agp-months button.is-now::after {
    content: ""; position: absolute; left: 50%; bottom: 6px; width: 5px; height: 5px; margin-left: -2.5px;
    border-radius: 50%; background: var(--accent-strong, #d93f45);
}
.agp-months button.is-sel { background: var(--ink-btn); color: var(--ink-btn-text); font-weight: 700; }
.agp-months button.is-sel.is-now::after { background: var(--ink-btn-text); }
.agp-today {
    display: block; width: 100%; margin-top: 10px; padding: 10px; border: 0; border-top: 1px solid var(--border);
    background: transparent; color: var(--accent-strong, var(--text-1)); font: inherit; font-weight: 650; cursor: pointer;
    border-radius: 0 0 10px 10px;
}
.agp-today:hover { background: var(--glass-hover); }
@media (max-width: 560px) {
    .ag-month-btn { min-width: 0; flex: 1; }
    .ag-picker { width: min(320px, calc(100vw - 32px)); }
}
.agp-year .ag-arrow { border: 0; background: transparent; box-shadow: none; padding: 0; cursor: pointer; }
.agp-year .ag-arrow:hover { background: var(--glass-hover); }

/* ---- Full-screen sheets: big "back" arrow top-left (phone first) ---- */
.modal-sheet .modal > header.has-back { justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
.modal-sheet .modal > header.has-back h3 { flex: 1; min-width: 0; }
.sheet-back {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
    height: 40px; padding: 0 14px 0 10px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-2); color: var(--text-1);
    font: inherit; font-size: .92rem; font-weight: 650;
    transition: background .12s, transform .12s;
}
.sheet-back:hover { background: var(--glass-hover); }
.sheet-back:active { transform: scale(.96); }
.sheet-back svg { flex: 0 0 auto; }
@media (max-width: 560px) {
    /* Phone: the arrow is THE way out; title on the line below, × hidden (duplicate) */
    .modal-sheet .modal > header.has-back { padding-top: max(8px, env(safe-area-inset-top)); row-gap: 12px; }
    .modal-sheet .modal > header.has-back .sheet-back { height: 44px; padding: 0 16px 0 12px; font-size: 1rem; }
    .modal-sheet .modal > header.has-back .sheet-back svg { width: 24px; height: 24px; }
    .modal-sheet .modal > header.has-back h3 { flex-basis: 100%; order: 2; font-size: 1.5rem; }
    .modal-sheet .modal > header.has-back .close-x { display: none; }
}

/* ---- Phone: comfortable touch targets (44px, Apple/Google guideline) for item actions ---- */
@media (max-width: 560px), (hover: none) {
    .shop-del, .shop-edit, .list-item .li-del {
        width: 44px !important; height: 44px !important; border-radius: 12px; opacity: 1 !important;
    }
    .shop-del .ic, .shop-edit .ic, .list-item .li-del .ic { width: 21px !important; height: 21px !important; }
    .list-item .li-del { margin: -6px -6px -6px 0; }
}
@media (max-width: 560px), (hover: none) {
    .list-card-head .lc-actions .btn { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; border-radius: 12px; }
    .list-card-head .lc-actions .btn .ic { width: 20px; height: 20px; }
}

/* ---- Members → Ajouter: invite QR code ---- */
.inv-qr-wrap { max-width: 380px; margin: 0 auto; text-align: center; }
.inv-desc { color: var(--text-2); line-height: 1.55; margin: 0 0 18px; }
.inv-qr {
    width: 240px; height: 240px; margin: 0 auto; padding: 14px; display: grid; place-items: center;
    background: #fff; border-radius: 22px; border: 1px solid var(--border);
    box-shadow: 0 18px 40px -22px rgba(23,19,31,.35);
}
.inv-qr svg { width: 100%; height: 100%; display: block; }
.inv-qr svg path, .inv-qr svg rect[fill="black"] { fill: #17131f; }
.inv-meta { margin: 12px 0 14px; }
.inv-full { margin: -6px 0 14px; padding: 9px 12px; border-radius: 12px; font-size: .88rem; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.28); }
.inv-link { display: flex; gap: 6px; margin-bottom: 10px; }
.inv-link input { flex: 1; min-width: 0; font-size: .82rem; font-family: ui-monospace, monospace; color: var(--text-2); }
.inv-share { width: 100%; padding: 13px; font-size: 1rem; }
.inv-regen { margin-top: 12px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: .88rem; text-decoration: underline; cursor: pointer; padding: 8px; }
.inv-regen:hover { color: var(--text-1); }

/* Landing: "Rejoindre un groupe" (invite QR) under the hero buttons */
.lp-join-link { display: inline-block; margin-top: 16px; font-size: .95rem; color: var(--text-2, #5b5566); text-decoration: none; }
.lp-join-link b { color: var(--text-1, #17131f); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.lp-join-link:hover b { color: var(--accent-strong, #d93f45); }

/* ============================================================
   Home swipe pager — Tous mes groupes ← Accueil → Jeu → Pub
   ============================================================ */
/* At rest: only the active panel exists in the layout, no transform, no clipping —
   the page behaves exactly as without the pager. */
.swp { position: relative; min-width: 0; width: 100%; max-width: 100%; }
.swp-view { width: 100%; touch-action: pan-y; }
.swp-panel { min-width: 0; box-sizing: border-box; }
.swp-panel[aria-hidden="true"] { display: none; }
/* While a swipe is moving: all panels side by side, clipped to the content width. */
.swp.is-moving { overflow: hidden; overflow: clip; }
.swp.is-moving .swp-view { overflow: hidden; overflow: clip; transition: height .3s ease; }
.swp.is-moving .swp-track { display: flex; align-items: flex-start; transition: transform .38s cubic-bezier(.22,.8,.24,1); will-change: transform; }
.swp.is-moving .swp-panel { display: block; flex: 0 0 100%; overflow-x: clip; }
.swp.is-dragging, .swp.is-dragging * { user-select: none; -webkit-user-select: none; cursor: grabbing !important; }
@media (prefers-reduced-motion: reduce) { .swp.is-moving .swp-track, .swp.is-moving .swp-view { transition: none; } }
/* Overview placeholder while it loads */
.ov-loading { display: grid; gap: 12px; }
.ov-loading span { height: 64px; border-radius: 16px; background: var(--glass-hover); animation: ovPulse 1.1s ease-in-out infinite alternate; }
@keyframes ovPulse { from { opacity: .45; } to { opacity: 1; } }

/* ---- Overview: Tous mes groupes ---- */
.ov-head h1 { margin: 0; font-size: 1.6rem; letter-spacing: -.02em; }
.ov-head p { margin: 4px 0 16px; }
.ov-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ov-gcard { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 16px; text-decoration: none; color: var(--text-1);
    background: var(--bg-1, var(--glass)); border: 1px solid var(--border); border-left: 5px solid var(--c); box-shadow: var(--shadow); }
.ov-gcard:hover { background: var(--glass-hover); }
.ov-gname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-gstats { display: flex; gap: 12px; color: var(--text-2); font-size: .85rem; font-variant-numeric: tabular-nums; }
.ov-gstats span { display: inline-flex; align-items: center; gap: 4px; }
.ov-gstats svg { width: 15px; height: 15px; opacity: .75; }
.ov-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .ov-cols { grid-template-columns: 1fr; } }
.ov-box { background: var(--bg-1, var(--glass)); border: 1px solid var(--border); border-radius: 18px; padding: 14px 14px 8px; box-shadow: var(--shadow); min-width: 0; }
.ov-box h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.02rem; }
.ov-box h2 svg { width: 18px; height: 18px; color: var(--accent-strong, var(--rb-pink)); }
.ov-empty { padding: 6px 0 12px; margin: 0; }
.ov-day { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 12px 0 4px; }
.ov-day.is-today { color: var(--accent-strong, var(--rb-pink)); }
.ov-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; margin: 0 -8px; border-radius: 10px; text-decoration: none; color: var(--text-1); min-height: 44px; box-sizing: border-box; }
.ov-row:hover { background: var(--glass-hover); }
.ov-time { flex: 0 0 42px; font-size: .85rem; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ov-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-check { flex: 0 0 16px; height: 16px; border-radius: 5px; border: 2px solid var(--text-3); box-sizing: border-box; }
.ov-mine { font-style: normal; font-size: .72rem; font-weight: 700; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong, var(--rb-pink)); }
.ov-due { font-size: .78rem; color: var(--text-2); white-space: nowrap; }
.ov-due.is-late { color: #e5484d; font-weight: 700; }
.ov-grp { flex: 0 1 auto; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; font-weight: 700;
    padding: 2px 8px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }

/* ---- Arcade panel ---- */
.arc { display: flex; justify-content: center; padding-bottom: 6px; }
.arc-cab { width: 100%; max-width: 420px; background: linear-gradient(180deg, #2a1b4a, #140c26); border-radius: 24px; padding: 14px 14px 12px;
    box-shadow: 0 18px 40px -16px rgba(20,12,38,.6), inset 0 0 0 2px rgba(255,255,255,.06); }
.arc-marquee { text-align: center; font: 800 1.05rem/1 ui-monospace, "Courier New", monospace; letter-spacing: .32em; color: #ffd23f;
    text-shadow: 0 0 10px rgba(255,210,63,.7), 0 0 2px #ff4d5e; padding: 6px 0 12px; }
.arc-screen { position: relative; border-radius: 14px; overflow: hidden; background: #0b0716; box-shadow: 0 0 0 3px #000, 0 0 24px rgba(126,232,255,.18); }
.arc-screen canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; max-height: 68vh; margin: 0 auto; object-fit: contain;
    image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; outline: none; cursor: crosshair; }
.arc-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.45)); }
.arc-help { margin: 10px 0 0; text-align: center; font-size: .78rem; color: rgba(255,255,255,.62); }

/* ---- Ad panel ---- */
.adv { padding-top: 4px; }
.adv-label { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 0 0 8px; }

/* Arcade: the cabinet fills the whole content area (viewport minus header / bottom bar) */
.arc { padding-bottom: 0; }
.arc-cab { max-width: none; height: calc(100dvh - 150px); min-height: 420px; display: flex; flex-direction: column; box-sizing: border-box; }
.arc-screen { flex: 1; min-height: 0; }
.arc-screen canvas { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: contain; }
@media (min-width: 1024px) { .arc-cab { height: calc(100dvh - 130px); } }
@media (max-width: 1023px) { .arc-cab { height: calc(100dvh - 200px - env(safe-area-inset-bottom)); border-radius: 18px; padding: 10px; } .arc-marquee { padding: 2px 0 8px; } }
/* Home swipe: horizontal gestures anywhere in the content area (empty space included) go to the pager */
body:has(#swp) .app-layout, body:has(#swp) .main-pane { touch-action: pan-y; }

/* ---- Ad panel: tiles, 2 per row (PC) / stacked flex (phone) ---- */
.adv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.adv-card { display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; text-decoration: none; color: var(--text-1);
    background: var(--bg-1, var(--glass)); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.adv-card:hover { transform: translateY(-2px); }
.adv-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: top center; -webkit-user-drag: none; }
.adv-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.adv-name { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--adc); margin-bottom: 4px; }
.adv-body h2 { margin: 0 0 6px; font-size: 1.08rem; line-height: 1.3; }
.adv-body p { margin: 0 0 14px; color: var(--text-2); font-size: .9rem; line-height: 1.45; }
.adv-cta { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem;
    padding: 9px 15px; border-radius: 999px; background: var(--adc); color: #fff; }
.adv-cta svg { width: 16px; height: 16px; }
@media (max-width: 760px) {
    .adv-grid { display: flex; flex-direction: column; gap: 12px; }
}

/* ---- Tooltip: any element with data-tip shows a bubble after a short hover (or keyboard focus) ---- */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px);
    padding: 6px 10px; border-radius: 8px; background: #17131f; color: #fff; font-size: .78rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
    opacity: 0; visibility: hidden; pointer-events: none; z-index: 60; box-shadow: 0 6px 18px rgba(0,0,0,.22);
    transition: opacity .15s, transform .15s, visibility 0s linear .15s; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: .45s, .45s, .45s; }
@media (hover: none) { [data-tip]:active::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: .3s; } }

/* ============================================================
   Home "day card" — compact greeting with a tear-off calendar leaf
   (replaces the big colour banner). The accent colour lives on the leaf only.
   ============================================================ */
.day-card { display: flex !important; align-items: center; gap: 18px; position: relative; margin: 0 0 18px; padding: 14px 20px 14px 16px;
    background: var(--bg-1, #fff); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
@media (min-width: 1024px) { .dash-home > .day-card { grid-area: hello; margin: 0; } }
/* The leaf: slightly tilted, two binder holes on top, a soft shadow like a sheet pinned on the card */
.dc-leaf { flex: 0 0 auto; width: 74px; padding: 12px 0 8px; border-radius: 16px; text-align: center; position: relative;
    background: var(--accent-fill, #d93f45); color: var(--accent-on, #fff); transform: rotate(-4deg);
    box-shadow: 0 10px 18px -10px color-mix(in srgb, var(--accent-fill, #d93f45) 85%, #000), inset 0 -10px 16px -12px rgba(0,0,0,.25); }
.dc-leaf::before, .dc-leaf::after { content: ""; position: absolute; top: 6px; width: 7px; height: 7px; border-radius: 50%;
    background: var(--bg-1, #fff); box-shadow: inset 0 1px 1px rgba(0,0,0,.25); }
.dc-leaf::before { left: 18px; } .dc-leaf::after { right: 18px; }
.dc-leaf span { display: block; line-height: 1; }
.dc-dow { font-size: .66rem; font-weight: 800; letter-spacing: .14em; opacity: .9; margin-top: 6px; }
.dc-num { font-size: 2.05rem; font-weight: 750; letter-spacing: -.04em; margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.dc-mon { font-size: .72rem; font-weight: 650; opacity: .9; }
.dc-body { flex: 1 1 auto; min-width: 0; }
.day-card h1 { margin: 0; font-size: 1.5rem; font-weight: 650; letter-spacing: -.035em; color: var(--text-1); line-height: 1.15; }
.day-card h1 .serif { color: var(--accent-strong, var(--rb-pink)); font-size: 1.1em; }
.day-card .dc-status { margin: 3px 0 0; font-size: .95rem; color: var(--text-2); }
.dc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .82rem; font-weight: 600;
    text-decoration: none !important; color: var(--accent-strong, var(--text-1)) !important;
    background: color-mix(in srgb, var(--accent-fill, #d93f45) 13%, transparent); border: 1px solid color-mix(in srgb, var(--accent-fill, #d93f45) 26%, transparent); }
.dc-chip:hover { background: color-mix(in srgb, var(--accent-fill, #d93f45) 22%, transparent); }
.dc-chip .ic { width: 15px; height: 15px; }
/* Phrase of the day: a quiet handwritten-style aside on the right */
.day-card .dc-quote { flex: 0 1 300px; margin: 0; padding-left: 18px; border-left: 2px dotted color-mix(in srgb, var(--accent-fill, #d93f45) 45%, var(--border));
    font-size: .88rem; font-style: italic; line-height: 1.4; color: var(--text-2); }
.day-card .dc-quote .serif { font-size: 1.2em; color: var(--accent-strong, var(--rb-pink)); font-style: normal; }
@media (max-width: 760px) {
    .day-card { flex-wrap: wrap; gap: 12px 14px; padding: 12px 14px; border-radius: 18px; margin-bottom: 14px; }
    .dc-leaf { width: 58px; padding: 10px 0 6px; border-radius: 13px; }
    .dc-leaf::before, .dc-leaf::after { top: 5px; width: 5px; height: 5px; } .dc-leaf::before { left: 14px; } .dc-leaf::after { right: 14px; }
    .dc-dow { font-size: .58rem; margin-top: 5px; } .dc-num { font-size: 1.55rem; } .dc-mon { font-size: .64rem; }
    .dc-body { flex: 1 1 0; }
    .day-card h1 { font-size: 1.22rem; }
    .day-card .dc-status { font-size: .86rem; }
    .dc-chips { margin-top: 6px; } .dc-chip { padding: 4px 9px; font-size: .76rem; }
    /* one discreet line under the card content */
    .day-card .dc-quote { flex: 1 1 100%; padding: 8px 0 0; border-left: 0; border-top: 1px dotted var(--border); font-size: .8rem;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
/* Seasonal theme: the motifs decorate the leaf only */
body.has-season .dc-leaf { background-image: var(--season-banner); background-size: 90px 90px; }

/* ---- Ad panel on phones: one "poster" per screen, scroll down for the next ----
   Each ad fills almost the whole visible height (viewport minus header and bottom bar),
   in its brand colour, with the visual on top and the call-to-action at the bottom. */
@media (max-width: 760px) {
    .adv-label { margin-bottom: 6px; }
    .adv-grid { gap: 14px; }
    .adv-card { min-height: calc(100dvh - 196px - env(safe-area-inset-bottom)); border: 0; border-radius: 24px; padding: 14px;
        background: linear-gradient(165deg, color-mix(in srgb, var(--adc) 88%, #fff) 0%, var(--adc) 45%, color-mix(in srgb, var(--adc) 82%, #000) 100%);
        color: #fff; box-shadow: 0 18px 34px -18px color-mix(in srgb, var(--adc) 80%, #000); scroll-margin-top: 76px; }
    .adv-card:hover { transform: none; }
    .adv-card img { border-radius: 14px; aspect-ratio: auto; height: auto; object-fit: contain; box-shadow: 0 12px 26px -12px rgba(0,0,0,.55); }
    .adv-body { padding: 18px 6px 6px; }
    .adv-name { color: rgba(255,255,255,.82); font-size: .78rem; margin-bottom: 8px; }
    .adv-body h2 { font-size: 1.7rem; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 10px; color: #fff; }
    .adv-body p { font-size: 1.02rem; line-height: 1.5; color: rgba(255,255,255,.9); margin: 0 0 18px; }
    .adv-cta { align-self: stretch; justify-content: center; padding: 14px 18px; font-size: 1rem; background: #fff; color: var(--adc); }
}

/* ---- Members page on phones: one stacked card per member instead of a 5-column table
   (a real e-mail address pushed the table out of the screen) ---- */
@media (max-width: 720px) {
    .members-table, .members-table tbody, .members-table tr, .members-table td { display: block; width: auto !important; }
    .members-table thead { display: none; }
    .members-table tr { position: relative; padding: 12px 52px 12px 2px; }
    .members-table td { padding: 0 !important; text-align: left !important; }
    .members-table td:nth-child(1) { font-size: 1.02rem; }
    .members-table td:nth-child(2) { margin-top: 2px; color: var(--text-2); overflow-wrap: anywhere; word-break: break-word; }
    .members-table td:nth-child(3) { display: inline-block; margin-top: 8px; }
    .members-table td:nth-child(4) { display: inline-block; margin: 8px 0 0 8px; }
    .members-table td:nth-child(4):not(:empty)::before { content: "· "; }
    .members-table td:nth-child(5) { position: absolute; top: 10px; right: 0; }
    .members-table td:nth-child(5) .btn { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; }
    .members-table td:nth-child(5) .small { display: none; }          /* "c'est toi" already shown by the role chip row */
    .members-table tr:last-child { border-bottom: 0 !important; }
    /* Danger zone: text above, full-width button below */
    .danger-card .danger-row { flex-direction: column; align-items: stretch !important; gap: 10px; }
    .danger-card .danger-row .btn { align-self: flex-start; }
}
