/* SemenceMatinale — feuille de style. Charte : blanc dominant, rouge et jaune en accents. */
:root {
    --red: #C8102E;
    --red-dark: #9E0B22;
    --red-soft: #FDECEF;
    --yellow: #F2C200;
    --yellow-soft: #FFF6CC;
    --ink: #1F2328;
    --muted: #6B7280;
    --line: #E5E7EB;
    --bg: #FFFFFF;
    --bg-alt: #F8F9FA;
    --green: #25D366;
    --green-dark: #1DA851;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sidebar-w: 240px;
    --topbar-h: 58px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 16px; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; height: auto; }
code { background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
pre.debug { background: var(--bg-alt); padding: 1rem; border-radius: var(--radius); overflow: auto; text-align: left; font-size: .8rem; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.grow { flex: 1 1 auto; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 8px; top: 8px; background: var(--yellow); padding: .5rem; z-index: 100; }
.icon { vertical-align: -4px; flex: none; }

/* --- Boutons --- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1rem; border-radius: 10px; border: 2px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; transition: background .15s, color .15s, border-color .15s; min-height: 44px; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { background: #fff; color: var(--red); border-color: var(--red); }
.btn-outline:hover { background: var(--red-soft); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-whatsapp { background: var(--green); color: #fff; }
.btn-whatsapp:hover { background: var(--green-dark); }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; min-height: 34px; border-radius: 8px; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.danger, .icon-btn.danger { color: var(--red); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--bg-alt); }

/* --- Layout privé --- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem; height: var(--topbar-h); padding: 0 1rem; background: #fff; border-bottom: 3px solid var(--red); }
.topbar .brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: var(--red); font-size: 1.1rem; }
.topbar .brand img { border-radius: 8px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.user-chip { display: flex; align-items: center; gap: .5rem; color: var(--ink); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.user-name { display: none; }
.install-btn { white-space: nowrap; }
@media (max-width: 640px) { .topbar .install-btn { display: none !important; } .topbar .brand span { font-size: 1rem; } }
.sidebar .install-btn { margin: .5rem 0; justify-content: center; }
.offline-badge { background: var(--yellow-soft); color: #7a5b00; border: 1px solid var(--yellow); border-radius: 999px; padding: .2rem .6rem; font-size: .8rem; font-weight: 600; }
.menu-toggle { flex-direction: column; gap: 4px; }
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar { position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--line); padding: .75rem; overflow-y: auto; transform: translateX(-100%); transition: transform .2s; z-index: 25; display: flex; flex-direction: column; }
.sidebar.open { transform: none; box-shadow: var(--shadow); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 10px; color: var(--ink); font-weight: 500; }
.sidebar a:hover { background: var(--bg-alt); text-decoration: none; }
.sidebar a.active { background: var(--red-soft); color: var(--red); font-weight: 700; }
.sidebar a.highlight { background: var(--yellow-soft); }
.sidebar a.highlight.active { background: var(--yellow); }
.logout-form { margin-top: auto; padding-top: .5rem; }
.sidebar-foot { font-size: .75rem; color: var(--muted); margin: .5rem 0 0; text-align: center; }
.sidebar-backdrop { display: none; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 20; }
.sidebar.open + .sidebar-backdrop { display: block; }
.main { flex: 1; padding: 1rem; max-width: 1200px; width: 100%; margin: 0 auto; }
@media (min-width: 960px) {
    .sidebar { transform: none; box-shadow: none; }
    .sidebar-backdrop, .menu-toggle { display: none !important; }
    .main { margin-left: var(--sidebar-w); padding: 1.5rem 2rem; max-width: calc(1200px + var(--sidebar-w)); }
    .user-name { display: inline; }
}

/* --- Composants --- */
.page-head { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.back { font-size: .85rem; color: var(--muted); display: inline-block; margin-bottom: .2rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }
.grid-2 > .card { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .stats { grid-template-columns: repeat(6, 1fr); } }
.stat { display: flex; flex-direction: column; padding: .9rem 1rem; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); }
.stat:hover { text-decoration: none; border-color: var(--red); }
.stat-accent { border-left-color: var(--red); }
.stat-n { font-size: 1.8rem; font-weight: 800; color: var(--red); line-height: 1; }
.stat-l { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.shortcuts { margin-bottom: 1.25rem; }
.shortcut-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 720px) { .shortcut-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .shortcut-grid { grid-template-columns: repeat(4, 1fr); } }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .9rem .5rem; text-align: center; background: var(--yellow-soft); border: 1px solid #F5DE7A; border-radius: var(--radius); color: var(--ink); font-weight: 600; font-size: .9rem; }
.shortcut:hover { background: var(--yellow); text-decoration: none; }
.shortcut .icon { width: 26px; height: 26px; color: var(--red); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list.compact > li { padding: .3rem 0; }
.list small { display: block; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.tl-time { color: var(--muted); font-size: .8rem; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--bg-alt); color: var(--muted); vertical-align: middle; }
.badge-active, .badge-ready, .badge-shared { background: #E6F7EC; color: #1B7F3B; }
.badge-inactive, .badge-draft { background: var(--bg-alt); color: var(--muted); }
.badge-archived { background: #EEE; color: #555; }
.badge-preview { background: var(--yellow-soft); color: #7a5b00; }
.badge-validated { background: var(--red-soft); color: var(--red); }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .75rem; font-weight: 600; background: color-mix(in srgb, var(--tag, #999) 15%, #fff); color: var(--tag, #555); border: 1px solid color-mix(in srgb, var(--tag, #999) 40%, #fff); }
@supports not (color: color-mix(in srgb, red, blue)) { .tag { background: var(--bg-alt); color: var(--ink); border-color: var(--line); } }
.empty { text-align: center; padding: 2.5rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input[type=search], .filters select, .filters input[type=date] { flex: 1 1 160px; }
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active { color: var(--red); border-bottom-color: var(--red); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .65rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { background: var(--bg-alt); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .cards { grid-template-columns: 1fr 1fr 1fr; } }
.card-item { margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.card-item-head { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.card-item .preview { color: var(--muted); font-size: .9rem; white-space: pre-line; margin: 0; }
.card-item-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .4rem; }
.video-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .video-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .video-grid { grid-template-columns: 1fr 1fr 1fr; } }
.video-card { padding: 0; overflow: hidden; margin: 0; display: flex; flex-direction: column; }
.video-card .thumb { position: relative; display: block; aspect-ratio: 16/9; background: #000; }
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-card .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2.2rem; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.video-body { padding: .75rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.player { width: 100%; margin: .4rem 0; }
.dl { margin: 0 0 1rem; }
.dl dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: .6rem; }
.dl dd { margin: 0; }
.poster { max-height: 320px; border-radius: 10px; border: 1px solid var(--line); margin-top: .5rem; }
.poster-thumb { max-height: 120px; border-radius: 8px; border: 1px solid var(--line); }
.wa-preview, .wa-bubble { white-space: pre-wrap; word-break: break-word; font: inherit; background: #E7FFDB; border-radius: 12px 12px 12px 2px; padding: .9rem 1rem; border: 1px solid #C9EDB8; margin: 0 0 .75rem; }
.wa-bubble { position: relative; }
.steps-list li { margin-bottom: .4rem; }

/* --- Formulaires --- */
.form .field, .field { margin-bottom: .9rem; }
label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], select, textarea {
    width: 100%; padding: .65rem .75rem; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,.12); }
textarea { resize: vertical; line-height: 1.45; }
input[type=file] { width: 100%; padding: .5rem 0; }
input[type=color] { width: 44px; height: 44px; padding: 2px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
.w-small { width: 72px !important; }
.w-label { width: 130px; }
.hint { display: block; color: var(--muted); font-size: .8rem; margin-top: .3rem; font-weight: 400; }
.field-error { color: var(--red); font-size: .85rem; margin: .3rem 0 0; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }
.radio-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; padding: .5rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio input { accent-color: var(--red); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .4rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center; margin-top: .5rem; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(255,255,255,.95); padding: .75rem 0; border-top: 1px solid var(--line); z-index: 5; }
.inline-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; flex: 1 1 200px; }
.vars summary { cursor: pointer; font-weight: 600; margin-bottom: .5rem; }
.upload-progress { margin: .5rem 0; }
.upload-progress .bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; position: relative; }
.upload-progress .bar::after { content: ""; position: absolute; inset: 0; width: var(--p, 0%); background: var(--red); transition: width .2s; }
.cat-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.cat-row input[type=text] { flex: 1 1 120px; }
.list-cats > li { display: flex; align-items: center; gap: .4rem; }
.list-cats .cat-row { flex: 1; }
.social-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.social-ico { color: var(--red); display: inline-flex; }

/* --- Sélecteur de groupes --- */
.picker-tools { display: flex; gap: .4rem; margin-bottom: .6rem; }
.picker-tools input { flex: 1; }
.picker-cat { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; margin-bottom: .5rem; }
.cat-check { border-left: 4px solid var(--tag, var(--red)); padding-left: .5rem; width: 100%; }
.picker-list { list-style: none; margin: .4rem 0 0; padding: 0 0 0 1.3rem; }
.picker-list li { padding: .25rem 0; }
.picker-list li.hidden, .picker-cat.hidden { display: none; }
.groups-picker { max-height: 70vh; overflow: auto; }

/* --- Page de partage --- */
.targets { list-style: none; margin: 0; padding: 0; }
.target { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.target.is-shared { background: #F1FBF4; margin: 0 -.5rem; padding-left: .5rem; padding-right: .5rem; border-radius: 8px; }
.target-info small { display: block; }
.target-actions { display: flex; align-items: center; gap: .6rem; }

/* --- Flash --- */
.flashes { margin-bottom: 1rem; }
.flash { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: .75rem 1rem; border-radius: 10px; margin-bottom: .5rem; font-weight: 500; border: 1px solid; }
.flash-success { background: #E6F7EC; color: #14532D; border-color: #A7E3BC; }
.flash-error { background: var(--red-soft); color: var(--red-dark); border-color: #F5B5C0; }
.flash-warning { background: var(--yellow-soft); color: #7a5b00; border-color: #F5DE7A; }
.flash-info { background: #EAF2FF; color: #1E3A8A; border-color: #BFD3FF; }
.flash-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 999px; font-weight: 600; z-index: 200; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* --- Auth / setup --- */
.auth-body { background: linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%); min-height: 100vh; }
.auth-wrap { max-width: 460px; margin: 0 auto; padding: 2rem 1rem; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--red); font-size: 1.3rem; margin-bottom: 1.25rem; }
.auth-brand img { border-radius: 12px; box-shadow: var(--shadow); }
.auth-card h1 { text-align: center; }
.setup-card { max-width: 100%; }
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 1rem; gap: .25rem; font-size: .8rem; }
.steps li { flex: 1; text-align: center; padding: .4rem .2rem; border-bottom: 3px solid var(--line); color: var(--muted); }
.steps li.done { border-color: var(--yellow); color: var(--ink); }
.steps li.current { border-color: var(--red); color: var(--red); font-weight: 700; }
.checks { margin-bottom: 1rem; font-size: .9rem; }
.checks ul { list-style: none; padding: 0; margin: .5rem 0 0; }
.checks li.ok { color: #1B7F3B; }
.checks li.ko { color: var(--red); font-weight: 600; }

/* --- Page publique --- */
.public-body { background: #fff; }
.public-wrap { max-width: 640px; margin: 0 auto; padding: 1.5rem 1rem 2rem; }
.hero { text-align: center; padding: 1rem 0 1.5rem; }
.hero-compact { padding-top: 2rem; }
.hero-logo { border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 1rem; }
.hero h1 { font-size: 1.8rem; color: var(--red); }
.hero-signature { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.hero-mission { color: #374151; max-width: 520px; margin: 0 auto 1rem; }
.hero-motto { font-style: italic; color: #7a5b00; background: var(--yellow-soft); display: inline-block; padding: .4rem .9rem; border-radius: 999px; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--muted); margin: 0; }
.follow { text-align: center; padding: 1rem 0; border-top: 1px solid var(--line); }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0 .75rem; border-bottom: 3px solid var(--red); margin-bottom: .5rem; }
.public-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.15rem; color: var(--red); }
.public-brand img { border-radius: 8px; }
.public-brand:hover { text-decoration: none; }
/* Réseaux sociaux : bloc compact, tous sur une ligne */
.follow { padding: .75rem 0; }
.follow h2 { justify-content: center; font-size: 1rem; margin-bottom: .5rem; }
.social-list { list-style: none; margin: 0; padding: .7rem .4rem; display: flex; flex-wrap: nowrap; gap: .25rem; justify-content: space-around; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 14px; }
.social-list li { flex: 1 1 0; min-width: 0; }
.social-btn { display: flex; flex-direction: column; align-items: center; gap: .25rem; color: var(--ink); font-weight: 600; font-size: .62rem; width: 100%; }
.social-label { text-align: center; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-btn:hover { text-decoration: none; }
.social-circle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand, var(--red)); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); transition: transform .15s; }
.social-circle .icon { width: 20px; height: 20px; }
@media (min-width: 640px) { .social-btn { font-size: .78rem; } .social-circle { width: 52px; height: 52px; } .social-circle .icon { width: 26px; height: 26px; } .social-list { justify-content: center; gap: 1.25rem; padding: 1rem; } .social-list li { flex: 0 0 auto; width: 84px; } }
.social-btn:hover .social-circle { transform: scale(1.08); }
.social-youtube { --brand: #FF0000; }
.social-whatsapp { --brand: #25D366; }
.social-facebook { --brand: #1877F2; }
.social-instagram { --brand: #E1306C; }
.social-tiktok { --brand: #000000; }
.social-telegram { --brand: #229ED9; }
.social-x { --brand: #000000; }
.social-site { --brand: var(--yellow); }
.social-site .social-circle { color: var(--ink); }
.public-actions { text-align: center; display: flex; flex-direction: column; gap: .6rem; align-items: center; padding: 1.25rem 0; }
.public-footer { text-align: center; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); padding-top: 1rem; }

/* --- V2 : espace public quotidien --- */
.public-wrap { max-width: 760px; }
.public-header { flex-wrap: wrap; row-gap: .5rem; }
.public-brand { min-width: 0; }
.public-brand span { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.public-brand small { font-size: .72rem; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.public-header-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
/* Sélecteur de langue : liste déroulante avec drapeaux */
.lang-select { display: inline-flex; align-items: center; gap: .3rem; border: 1.5px solid var(--line); border-radius: 999px; padding: .15rem .5rem .15rem .6rem; background: #fff; margin-bottom: 0; font-weight: 600; }
.lang-select-flag { font-size: 1.05rem; line-height: 1; }
.lang-select select { border: 0; background: transparent; font: inherit; font-size: .8rem; font-weight: 700; color: var(--ink); padding: .2rem 0; min-height: 0; width: auto; cursor: pointer; }
.lang-select select:focus { outline: none; box-shadow: none; }
.lang-choice .flag { margin-right: .35rem; }
@media (max-width: 480px) {
    .public-brand { width: 100%; font-size: 1.05rem; }
    .public-brand img { width: 36px; height: 36px; }
    .public-header-right { width: 100%; justify-content: space-between; margin-left: 0; }
}
/* Menu public : 5 onglets toujours visibles, icône au-dessus du libellé, sans défilement */
.public-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: .25rem; margin: .25rem 0 .75rem; }
.public-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; padding: .45rem .15rem; border-radius: 12px; font-size: .68rem; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.1; border: 1.5px solid transparent; }
.public-nav a .icon { width: 22px; height: 22px; }
.public-nav a.active { background: var(--red-soft); color: var(--red); border-color: #F5B5C0; }
.public-nav a:hover { text-decoration: none; background: var(--bg-alt); color: var(--ink); }
@media (min-width: 640px) { .public-nav a { flex-direction: row; gap: .4rem; font-size: .85rem; padding: .5rem .6rem; border-radius: 999px; } }
.hero-public { padding: .5rem 0 1rem; }
.hero-logo-sm { margin-bottom: .5rem; }
.hero-public h1 { font-size: 1.5rem; }
.pub-section { padding: 1rem 0; border-top: 1px solid var(--line); }
.pub-section h2 { display: flex; align-items: center; gap: .4rem; font-size: 1.15rem; color: var(--red); margin-bottom: .75rem; }
.pub-section-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.pub-section-head a { font-size: .85rem; font-weight: 600; }
.pub-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .pub-grid { grid-template-columns: 1fr 1fr; } }
.pub-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.pub-card-featured { border: 2px solid var(--yellow); background: linear-gradient(180deg, #FFFDF2 0%, #fff 60%); }
.pub-card-img img { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.pub-card-body { padding: .9rem 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.pub-card h3 { font-size: 1.05rem; margin: 0; }
.pub-card-featured h3 { font-size: 1.35rem; }
.pub-card h3 a { color: var(--ink); }
.pub-date { font-size: .78rem; color: var(--muted); margin: 0; }
.pub-verse { color: var(--red-dark); font-weight: 600; margin: 0; }
.pub-verse-lg { font-size: 1.1rem; }
.pub-excerpt { color: #374151; font-size: .9rem; margin: 0; }
.pub-text { line-height: 1.6; }
.pub-text-lg { font-size: 1.05rem; margin: 1rem 0; }
.pub-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .4rem; }
.pub-actions-lg { padding: 1rem 0; }
.pub-article h1 { font-size: 1.6rem; color: var(--red); }
.pub-figure { margin: 1rem 0; } .pub-figure img { width: 100%; border-radius: var(--radius); }
.pub-media { margin: 1rem 0; padding: .75rem 1rem; background: var(--bg-alt); border-radius: var(--radius); }
.pub-media h3 { font-size: .95rem; display: flex; align-items: center; gap: .4rem; }
.player-video { width: 100%; border-radius: 10px; background: #000; }
.pub-prayer { background: var(--yellow-soft); border-left: 4px solid var(--yellow); padding: .75rem 1rem; border-radius: 0 10px 10px 0; margin: 1rem 0; }
.pub-prayer h3 { margin-bottom: .3rem; }
/* Vidéos : 2 sur téléphone, 3 sur ordinateur */
.pub-videos { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pub-videos .pub-video:nth-child(n+3) { display: none; }
@media (min-width: 640px) { .pub-videos { grid-template-columns: 1fr 1fr 1fr; } .pub-videos .pub-video:nth-child(3) { display: block; } .pub-videos .pub-video:nth-child(n+4) { display: none; } }
.pub-video { display: block; border-radius: 10px; overflow: hidden; background: #000; color: #fff; position: relative; }
.pub-video img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; opacity: .92; }
.pub-video-title { position: absolute; left: 0; right: 0; bottom: 0; padding: .5rem .6rem; font-size: .78rem; font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.pub-video-lg img { aspect-ratio: 16/9; }
.pub-video:hover { text-decoration: none; }
.pub-dl { background: var(--bg-alt); padding: .5rem 1rem; border-radius: 10px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }
/* Avis général : bloc compact */
.pub-rating { text-align: center; padding: .75rem 0; }
.rating-box { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .75rem; }
.rating-title { font-weight: 700; font-size: .95rem; margin: 0 0 .5rem; color: var(--ink); }
.rating-choices { display: flex; justify-content: center; gap: .4rem; }
.rating-choice { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .6rem; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: .8rem; font-weight: 600; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s, transform .05s; }
.rating-choice:hover { border-color: var(--red); }
.rating-choice:active { transform: scale(.97); }
.rating-choice.active { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.rating-dot { font-size: .95rem; line-height: 1; }
.rating-count { min-width: 1.4em; padding: .05rem .4rem; border-radius: 999px; background: var(--yellow-soft); color: #7a5b00; font-size: .72rem; font-weight: 800; }
.rating-choice.active .rating-count { background: var(--red); color: #fff; }
.rating-total { margin: .5rem 0 0; font-size: .74rem; color: var(--muted); }
@media (max-width: 400px) { .rating-choice { padding: .3rem .45rem; font-size: .74rem; gap: .25rem; } }
/* Fenêtre de bienvenue */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; display: flex; align-items: flex-end; justify-content: center; padding: 1rem; }
@media (min-width: 640px) { .modal { align-items: center; } }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 16px; padding: 1.25rem; width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.modal-logo { border-radius: 14px; margin-bottom: .5rem; }
.modal-actions { display: flex; justify-content: space-between; gap: .5rem; margin-top: .9rem; }
.modal-open { overflow: hidden; }
.wstep-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.country-search { margin-bottom: .5rem; }
.country-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; text-align: left; }
.country-item { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .55rem .75rem; border: 0; background: #fff; font: inherit; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); }
.country-item:hover { background: var(--bg-alt); }
.country-item.active { background: var(--red-soft); color: var(--red); font-weight: 700; }
.country-item .flag { font-size: 1.2rem; }
.lang-choices { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.lang-choice { padding: .6rem 1rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.lang-choice.active { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.lang-choice:hover { text-decoration: none; border-color: var(--red); }
.check-list { display: flex; flex-direction: column; gap: .4rem; margin: .5rem 0; }
.pub-prefs .card { text-align: left; }
/* Administration V2 */
.menu-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .8rem .75rem .3rem; font-weight: 700; }
.tabs-inline button { background: none; border: 0; padding: .6rem .9rem; color: var(--muted); font: inherit; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap; }
.tabs-inline button.active { color: var(--red); border-bottom-color: var(--red); }
.bar-row { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: .6rem; margin: .4rem 0; font-size: .9rem; }
.bar-track { height: 12px; background: var(--bg-alt); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--red); border-radius: 6px; }
.bar-excellent { background: #1B7F3B; } .bar-bien { background: var(--yellow); } .bar-pasmal { background: #9CA3AF; }
.bar-value { text-align: right; font-weight: 700; }
.spark { display: flex; align-items: flex-end; gap: .35rem; height: 140px; padding-top: .5rem; }
.spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.spark-bar { width: 100%; background: var(--red); border-radius: 4px 4px 0 0; min-height: 3px; }
.spark-label { font-size: .65rem; color: var(--muted); margin-top: .25rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.media-item { display: flex; flex-direction: column; gap: .3rem; color: var(--ink); font-size: .8rem; }
.media-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.media-item:hover { text-decoration: none; }
.stat-n.small { font-size: 1rem; }

/* ==========================================================================
   Thème « dégradé » : en-tête rouge profond avec cercles, carte blanche arrondie, boutons pilules
   ========================================================================== */
:root {
    --grad-start: #C8102E;
    --grad-end: #5E0B2E;
    --grad: linear-gradient(135deg, var(--grad-start) 0%, #9B1030 55%, var(--grad-end) 100%);
    --btn-grad: linear-gradient(90deg, #C8102E 0%, #6A0F3A 100%);
    --radius: 16px;
}
.theme-gradient { background: #F4F4F6; }
.gradient-top { position: absolute; left: 0; right: 0; top: 0; height: 290px; background: var(--grad); overflow: hidden; z-index: 0; }
.gradient-top.gradient-full { position: fixed; height: 100%; }
.bubble { position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.28), rgba(255,255,255,.04) 60%, rgba(0,0,0,.08)); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.bubble.b1 { width: 160px; height: 160px; right: -40px; top: -30px; }
.bubble.b2 { width: 70px; height: 70px; left: 8%; top: 70px; }
.bubble.b3 { width: 110px; height: 110px; left: 55%; top: 150px; opacity: .9; }
.bubble.b4 { width: 42px; height: 42px; right: 22%; top: 190px; }
.gradient-full .bubble.b3 { top: 60%; left: -30px; width: 180px; height: 180px; }
.gradient-full .bubble.b4 { top: 80%; right: 10%; width: 90px; height: 90px; }
.public-wrap, .auth-wrap { position: relative; z-index: 1; }

/* En-tête public sur le dégradé */
.theme-gradient .public-header { border-bottom: 0; padding: .9rem 0 1.1rem; color: #fff; }
.theme-gradient .public-brand { color: #fff; }
.theme-gradient .public-brand img { border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.theme-gradient .public-brand small { color: rgba(255,255,255,.8); }
.theme-gradient .lang-select { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.45); color: #fff; backdrop-filter: blur(4px); }
.theme-gradient .lang-select select { color: #fff; }
.theme-gradient .lang-select option { color: var(--ink); }
.theme-gradient .public-header .btn-primary { background: #fff; color: var(--red); border-color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.2); }

/* Carte blanche arrondie contenant le menu, le contenu et le pied de page */
.sheet { background: #fff; border-radius: 26px 26px 0 0; padding: .9rem 1rem 1rem; box-shadow: 0 -8px 30px rgba(0,0,0,.12); min-height: 70vh; }
.theme-gradient .public-wrap { padding-left: 0; padding-right: 0; padding-top: .25rem; }
.theme-gradient .public-header { padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 640px) { .sheet { border-radius: 26px; padding: 1.25rem 1.5rem 1.5rem; } .theme-gradient .public-wrap { padding-bottom: 2rem; } }
.theme-gradient .hero-public { padding-top: 0; }
.theme-gradient .hero-logo-sm { margin-top: .25rem; border: 4px solid #fff; border-radius: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.public-nav a.active { background: var(--red-soft); }

/* Boutons en pilule dégradée */
.btn { border-radius: 999px; }
.btn-primary { background: var(--btn-grad); border-color: transparent; box-shadow: 0 6px 16px rgba(200,16,46,.28); }
.btn-primary:hover { background: linear-gradient(90deg, #B30E29 0%, #560C30 100%); }
.btn-whatsapp { box-shadow: 0 4px 12px rgba(37,211,102,.25); }
.card, .pub-card, .rating-box, .social-list, .pub-media, .table-wrap, .empty { border-radius: var(--radius); }
.pub-card-featured { background: linear-gradient(180deg, #FFF8E6 0%, #fff 70%); border-color: var(--yellow); }
.pub-section h2 { color: var(--grad-end); }

/* Classement des pays (administration) */
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.rank li:last-child { border-bottom: 0; }
.rank-pos { width: 24px; height: 24px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-weight: 800; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; }
.rank li:first-child .rank-pos { background: var(--yellow); color: var(--ink); }
.rank-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 10px; background: var(--bg-alt); border-radius: 6px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: var(--btn-grad); border-radius: 6px; }
.rank-val { font-weight: 800; color: var(--red); text-align: right; white-space: nowrap; }
.rank-val small { color: var(--muted); font-weight: 600; }
.top-country { display: flex; align-items: center; gap: .9rem; background: linear-gradient(90deg, var(--yellow-soft), #fff); border: 1px solid #F5DE7A; border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; }
.top-flag { font-size: 2rem; line-height: 1; }

/* Pied de page : même rouge dégradé que l'en-tête, texte blanc, chaque ligne sur une seule ligne */
.theme-gradient .public-footer { background: var(--grad); color: #fff; border-top: 0; margin: 0; padding: 1.1rem .75rem 1.3rem; text-align: center; border-radius: 0; position: relative; overflow: hidden; }
.theme-gradient .public-footer p { margin: .25rem 0; font-size: clamp(.5rem, 2.55vw, .8rem); white-space: nowrap; color: rgba(255,255,255,.92); }
.theme-gradient .public-footer .powered { color: rgba(255,255,255,.8); font-size: clamp(.48rem, 2.35vw, .74rem); opacity: 1; }
.theme-gradient .public-footer .btn-outline { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.7); font-size: .78rem; padding: .35rem .9rem; min-height: 34px; }
.theme-gradient .sheet { border-radius: 26px 26px 0 0; min-height: 60vh; }
@media (min-width: 640px) { .theme-gradient .public-footer { border-radius: 0 0 26px 26px; padding: 1.3rem 1rem 1.5rem; } .theme-gradient .public-footer p { font-size: .82rem; } }

/* Pages d'authentification et d'installation sur le dégradé */
.auth-body.theme-gradient { background: var(--grad-end); }
.theme-gradient .auth-wrap { padding-top: 1.5rem; }
.theme-gradient .auth-brand { color: #fff; }
.theme-gradient .auth-brand img { border-radius: 18px; border: 4px solid #fff; }
.theme-gradient .auth-card { border-radius: 24px; border: 0; box-shadow: 0 18px 50px rgba(0,0,0,.28); padding: 1.5rem 1.25rem; }
.theme-gradient .auth-wrap .powered { color: rgba(255,255,255,.85); }
.theme-gradient .auth-wrap .flash { border-radius: 14px; }
.pin-key { background: #F6F3F5; }
.pin-key:hover { background: var(--red-soft); }

/* Administration : barre dégradée, panneaux arrondis */
.topbar { background: var(--grad); border-bottom: 0; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.topbar .brand { color: #fff; }
.topbar .brand img { border-radius: 10px; }
.topbar .user-chip { color: #fff; }
.topbar .avatar { background: var(--yellow); }
.topbar .install-btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.6); }
.menu-toggle span { background: #fff; }
.offline-badge { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.5); }
.app-body { background: #F4F4F6; }
.sidebar a.active { background: var(--red-soft); }
.sidebar a.highlight { background: var(--yellow-soft); }
.stat, .shortcut { border-radius: var(--radius); }
.page-head h1 { color: var(--grad-end); }

@media print { .topbar, .sidebar, .form-actions, .filters, .tabs, .public-nav, .lang-select, .gradient-top { display: none !important; } .main { margin: 0; } }

/* --- Code PIN --- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pin-input { letter-spacing: .35em; font-size: 1.3rem; font-weight: 700; text-align: center; }
/* Connexion : indicateur à points + pavé compact et discret (le clavier du téléphone fonctionne aussi) */
.pin-input-hidden { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pin-dots { display: flex; justify-content: center; gap: .9rem; margin: .75rem 0 1rem; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: #fff; transition: background .15s, border-color .15s, transform .15s; }
.pin-dots span.on { background: var(--red); border-color: var(--red); transform: scale(1.1); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 56px); gap: .55rem; justify-content: center; margin: 0 auto 1rem; }
.pin-key { font: inherit; font-size: 1.15rem; font-weight: 600; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--bg-alt); color: var(--ink); cursor: pointer; transition: background .1s, transform .05s, color .1s; }
.pin-key:hover { background: var(--red-soft); color: var(--red); }
.pin-key:active { transform: scale(.94); background: var(--yellow-soft); }
.pin-key-alt { font-size: .95rem; color: var(--muted); background: transparent; }
.pin-submit { display: flex; justify-content: center; width: 100%; max-width: 240px; margin: 1.25rem auto .9rem; }
/* Saisie du PIN : le champ réel recouvre les points (un toucher ouvre le clavier numérique du téléphone) */
.pin-wrap { position: relative; max-width: 240px; margin: 0 auto; cursor: text; }
.pin-wrap .pin-dots { margin: 1rem 0 .5rem; gap: 1.1rem; }
.pin-wrap .pin-dots span { width: 22px; height: 22px; }
.pin-input-over { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; padding: 0; border: 0; background: transparent; color: transparent; caret-color: transparent; letter-spacing: 1em; }
.auth-card form + p { margin-top: .5rem; }
/* Application installée (plein écran) : aucun bouton d'installation */
@media (display-mode: standalone) { [data-install-btn], .install-btn { display: none !important; } }

.powered { font-size: .72rem; color: var(--muted); opacity: .8; margin: .25rem 0 0; }
