/* 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; }
.social-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem .5rem; justify-content: center; }
.social-btn { display: flex; flex-direction: column; align-items: center; gap: .3rem; color: var(--ink); font-weight: 600; font-size: .78rem; width: 68px; }
.social-label { text-align: center; line-height: 1.2; max-width: 68px; overflow-wrap: anywhere; }
.social-btn:hover { text-decoration: none; }
.social-circle { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--brand, var(--red)); color: #fff; box-shadow: var(--shadow); transition: transform .15s; }
.social-circle .icon { width: 28px; height: 28px; }
.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-brand span { display: flex; flex-direction: column; line-height: 1.1; }
.public-brand small { font-size: .72rem; color: var(--muted); font-weight: 500; }
.public-header-right { display: flex; align-items: center; gap: .6rem; }
.lang-switch { display: flex; gap: .15rem; border: 1.5px solid var(--line); border-radius: 999px; padding: .15rem; }
.lang-switch a { padding: .25rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.lang-switch a.active { background: var(--red); color: #fff; }
.lang-switch a:hover { text-decoration: none; }
.public-nav { display: flex; gap: .25rem; overflow-x: auto; margin: .25rem 0 .75rem; padding-bottom: .25rem; }
.public-nav a { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .75rem; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--ink); white-space: nowrap; border: 1.5px solid transparent; }
.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); }
.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; }
.pub-videos { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (min-width: 640px) { .pub-videos { grid-template-columns: 1fr 1fr 1fr; } }
.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 */
.pub-rating { text-align: center; }
.pub-rating h2 { justify-content: center; }
.rating-choices { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.rating-choice { display: flex; flex-direction: column; align-items: center; gap: .15rem; min-width: 96px; padding: .7rem .6rem; border: 2px solid var(--line); border-radius: 14px; background: #fff; font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.rating-choice:hover { border-color: var(--red); }
.rating-choice.active { border-color: var(--red); background: var(--red-soft); }
.rating-emoji { font-size: 1.7rem; }
.rating-label { font-weight: 600; font-size: .85rem; }
.rating-count { font-size: 1.1rem; font-weight: 800; color: var(--red); }
.rating-total { margin-top: .6rem; }
/* 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; }

@media print { .topbar, .sidebar, .form-actions, .filters, .tabs, .public-nav, .lang-switch { 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; }
.pin-field .pin-input { font-size: 1.9rem; letter-spacing: .5em; min-height: 60px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .75rem auto 1rem; max-width: 300px; }
.pin-key { font: inherit; font-size: 1.5rem; font-weight: 700; min-height: 60px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: background .1s, border-color .1s, transform .05s; }
.pin-key:hover { border-color: var(--red); background: var(--red-soft); }
.pin-key:active { transform: scale(.96); background: var(--yellow-soft); }
.pin-key-alt { font-size: 1.1rem; color: var(--muted); }
@media (min-width: 720px) { .auth-card .pin-pad { max-width: 260px; } }
