:root {
    --forest-950: #03271f;
    --forest-900: #073f32;
    --forest-800: #07513e;
    --accent-800: #066149;
    --accent-700: #087a5a;
    --accent-600: #08966c;
    --accent-500: #12b981;
    --accent-100: #dff8ed;
    --cream: #f6f8f4;
    --surface: #ffffff;
    --ink: #15362e;
    --muted: #6c817a;
    --line: #dfe9e4;
    --danger: #be3d4b;
    --shadow: 0 12px 36px rgba(4, 53, 41, .09);
    --shadow-lg: 0 24px 70px rgba(1, 34, 26, .18);
    --radius: 20px;
    --radius-sm: 13px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    min-height: 100%;
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font: 16px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-700); text-decoration: none; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.page-shell { width: 100%; min-height: 100vh; padding: 84px 14px 48px; }
.page-shell-guest { padding: 0; }
.content-narrow { width: min(100%, 720px); margin: 0 auto; }
.content-wide { width: min(100%, 1040px); margin: 0 auto; }
.card { background: var(--surface); border: 1px solid rgba(8, 87, 66, .08); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.optional { color: var(--muted); font-size: .82rem; font-weight: 500; }
.eyebrow, .step-label { margin: 0 0 .35rem; color: var(--accent-600); font-size: .73rem; font-weight: 800; letter-spacing: .16em; }
.page-heading { margin: 12px 2px 24px; }
.page-heading h1 { margin: 0; font-size: clamp(1.8rem, 7vw, 2.6rem); line-height: 1.12; letter-spacing: -.045em; }
.page-heading p:last-child { margin: .55rem 0 0; color: var(--muted); }
.heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin: 4px 2px 20px; color: var(--muted); font-size: .88rem; }

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: .72rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 13px;
    cursor: pointer;
    font-weight: 750;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:active { transform: scale(.98); }
.button:disabled { cursor: wait; opacity: .64; }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--accent-600), var(--accent-700)); box-shadow: 0 9px 22px rgba(8, 122, 90, .22); }
.button-primary:hover { box-shadow: 0 12px 28px rgba(8, 122, 90, .32); }
.button-secondary { color: var(--accent-700); background: var(--accent-100); border-color: rgba(8, 122, 90, .08); }
.button-ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.button-danger { color: #fff; background: var(--danger); }
.button-full { width: 100%; }
.button-small { min-height: 38px; padding: .48rem .72rem; font-size: .86rem; }
.icon-button { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }

.topbar {
    position: fixed;
    z-index: 40;
    inset: 0 0 auto;
    height: 68px;
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    padding: max(6px, env(safe-area-inset-top)) 14px 6px;
    color: #fff;
    background: linear-gradient(115deg, var(--forest-950), var(--forest-800));
    box-shadow: 0 8px 28px rgba(3, 39, 31, .22);
}
.menu-toggle { justify-self: start; }
.menu-toggle span { display: block; width: 21px; height: 2px; margin: 2.5px 0; border-radius: 2px; background: #fff; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 850; letter-spacing: -.04em; }
.brand-compact { justify-self: center; font-size: 1.16rem; }
.brand > span:last-child span { color: #67e6b8; }
.brand-mark { color: #45d9a3; filter: drop-shadow(0 0 8px rgba(69, 217, 163, .55)); }
.profile-shortcut { justify-self: end; }

.avatar { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 4px 14px rgba(3, 54, 41, .15); }
.avatar-sm { width: 38px; height: 38px; }
.avatar-xs { width: 34px; height: 34px; font-size: .82rem; }
.avatar-lg { width: 58px; height: 58px; }
.avatar-xl { width: 88px; height: 88px; font-size: 1.7rem; }
.avatar-fallback { display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--accent-500), var(--forest-800)); font-weight: 850; }

.menu-overlay { position: fixed; z-index: 60; inset: 0; background: rgba(1, 24, 18, .54); backdrop-filter: blur(3px); }
.drawer {
    position: fixed;
    z-index: 70;
    inset: 0 auto 0 0;
    width: min(88vw, 360px);
    display: flex;
    flex-direction: column;
    padding: max(22px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    color: #f7fffb;
    background: radial-gradient(circle at 10% 0%, #0a6a50, transparent 36%), var(--forest-950);
    box-shadow: var(--shadow-lg);
    transform: translateX(-105%);
    transition: transform .24s cubic-bezier(.2,.8,.2,1);
}
.drawer.is-open { transform: translateX(0); }
.drawer-head { display: grid; grid-template-columns: 58px 1fr 44px; align-items: center; gap: 12px; padding: 5px 2px 22px; border-bottom: 1px solid rgba(255,255,255,.11); }
.drawer-head strong, .drawer-head span { display: block; }
.drawer-head span { color: #a8cfc1; font-size: .86rem; }
.menu-close { color: #fff; font-size: 1.9rem; font-weight: 300; }
.drawer-nav { padding: 18px 0; overflow-y: auto; }
.drawer-nav a { min-height: 50px; display: flex; align-items: center; gap: 14px; padding: 8px 11px; color: #eefaf5; border-radius: 12px; font-weight: 650; }
.drawer-nav a:hover { background: rgba(255,255,255,.08); }
.drawer-nav a span { width: 26px; color: #5ce2b1; text-align: center; }
.drawer-logout { margin-top: auto; }
.drawer-logout .button { color: #fff; border-color: rgba(255,255,255,.18); }

.alert { width: 100%; margin: 0 0 18px; padding: 13px 15px; border-radius: 13px; font-size: .93rem; font-weight: 650; }
.alert-error { color: #7c2330; background: #ffe9ec; border: 1px solid #ffd0d6; }
.alert-success { color: #07563f; background: #ddf8ec; border: 1px solid #bcebd8; }
.alert-info { color: #174f65; background: #e8f5fa; }

.guest-page { background: var(--forest-950); }
.auth-wrap { min-height: 100vh; display: grid; align-content: center; overflow: hidden; background: radial-gradient(circle at 85% 7%, rgba(36, 199, 143, .28), transparent 28%), radial-gradient(circle at 8% 72%, rgba(23, 134, 99, .25), transparent 30%), linear-gradient(155deg, var(--forest-950), #075240); }
.auth-hero { position: relative; z-index: 1; padding: 52px 24px 26px; color: #fff; text-align: center; }
.auth-hero::before { content: ""; position: absolute; z-index: -1; width: 260px; height: 260px; inset: 6% auto auto 50%; border: 1px solid rgba(255,255,255,.06); border-radius: 44% 56% 63% 37%; transform: translateX(-50%) rotate(25deg); }
.app-logo { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 18px; color: #66efbc; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 24px; box-shadow: inset 0 1px rgba(255,255,255,.12), 0 18px 40px rgba(0,0,0,.16); font-size: 2rem; }
.auth-hero .eyebrow { color: #77dfba; }
.auth-hero h1 { margin: 0; font-size: clamp(2.45rem, 13vw, 4.5rem); line-height: 1; letter-spacing: -.075em; }
.auth-hero h1 span { color: #65e8b7; }
.auth-hero > p:last-child { margin: 12px 0 0; color: #b9d5ca; }
.auth-card { position: relative; z-index: 2; width: min(calc(100% - 24px), 480px); margin: 0 auto 24px; padding: 25px 20px; box-shadow: 0 28px 80px rgba(0, 24, 18, .28); }
.auth-card h2 { margin: 0 0 5px; font-size: 1.5rem; letter-spacing: -.03em; }
.auth-card > .muted { margin: 0 0 22px; }
.privacy-note { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: .76rem; }
.success-mark { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 0 18px; color: #fff; background: var(--accent-600); border-radius: 50%; font-size: 1.8rem; }

.form-stack { display: grid; gap: 15px; }
.form-grid { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #294a41; font-size: .88rem; font-weight: 720; }
input, textarea, select {
    width: 100%;
    min-height: 47px;
    padding: .76rem .86rem;
    color: var(--ink);
    background: #fbfcfa;
    border: 1px solid #d8e4de;
    border-radius: 12px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { background: #fff; border-color: var(--accent-500); box-shadow: 0 0 0 4px rgba(18, 185, 129, .12); }
input[type="file"] { padding: .55rem; font-size: .82rem; }
.input-icon { position: relative; display: block; }
.input-icon > span { position: absolute; inset: 0 auto 0 13px; display: grid; place-items: center; color: #87a39a; font-size: .66rem; }
.input-icon input { padding-left: 38px; }
.check-field { grid-template-columns: 26px 1fr; align-items: center; }
.check-field input { width: 22px; min-height: 22px; accent-color: var(--accent-600); }
.check-field span { font-size: .95rem; }
label small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.form-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.form-divider { margin-top: 23px; padding-top: 23px; border-top: 1px solid var(--line); }
.danger-zone { margin-top: 24px; padding-top: 20px; border-top: 1px solid #f3d8dc; }

.feed-layout { width: min(100%, 1020px); margin: 0 auto; }
.feed-column { width: 100%; max-width: 680px; margin: 0 auto; }
.home-weather-card { display: block; margin-bottom: 10px; overflow: hidden; color: var(--ink); background: #fff; text-decoration: none; }
.home-weather-card:hover { color: var(--ink); box-shadow: 0 12px 30px rgba(15, 68, 54, .14); }
.home-forecast { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.home-forecast::-webkit-scrollbar { display: none; }
.home-forecast-day { position: relative; min-height: 154px; display: grid; grid-template-rows: auto auto 1fr auto auto; justify-items: center; align-items: center; padding: 10px 7px 9px; border-right: 1px solid #e3e7e9; scroll-snap-align: start; }
.home-forecast-day:last-child { border-right: 0; }
.home-forecast-day.is-today { background: linear-gradient(180deg, #f8ffff 0%, #f0fbf8 100%); }
.home-forecast-day.is-today::after { position: absolute; inset: auto 8px 0; height: 4px; content: ''; background: #17b7b0; border-radius: 6px 6px 0 0; }
.home-forecast-name { color: #17221f; font-size: .85rem; font-weight: 660; line-height: 1.1; }
.home-forecast-date { margin-top: 2px; color: #0d1714; font-size: 1.2rem; font-weight: 620; line-height: 1; }
.home-forecast-icon { width: 58px; height: 61px; display: grid; place-items: center; margin: 4px 0 2px; font-size: 2rem; }
.home-forecast-icon img { width: 58px; height: 61px; display: block; object-fit: contain; }
.home-forecast-max, .home-forecast-min { display: block; font-size: 1.08rem; font-weight: 680; line-height: 1.08; }
.home-forecast-max { color: #c44769; }
.home-forecast-min { margin-top: 2px; color: #55a0c3; }
.home-weather-unavailable { min-height: 92px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; color: var(--muted); font-size: .82rem; }
.home-weather-unavailable > span { font-size: 1.45rem; }
.home-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.home-quick-card { display: block; min-width: 0; padding: 12px; color: var(--ink); background: #fff; text-decoration: none; }
.home-quick-card:hover { color: var(--ink); border-color: #c9ded6; box-shadow: 0 10px 26px rgba(15, 68, 54, .12); }
.home-quick-title { min-width: 0; display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: center; gap: 7px; }
.home-quick-title strong { min-width: 0; font-size: .78rem; line-height: 1.18; letter-spacing: -.015em; }
.home-quick-title em { grid-column: 1 / -1; justify-self: start; margin-top: 2px; padding: 3px 7px; color: var(--accent-800); background: var(--accent-100); border-radius: 999px; font-size: .66rem; font-style: normal; font-weight: 800; }
.home-quick-icon { width: 27px; height: 27px; display: grid; place-items: center; color: var(--accent-700); background: var(--accent-100); border-radius: 9px; font-size: 1rem; font-weight: 850; }
.home-quick-values { display: grid; gap: 5px; margin: 9px 0 0; }
.home-quick-values > div { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.home-quick-values dt { color: var(--muted); font-size: .64rem; font-weight: 720; }
.home-quick-values dd { margin: 0; font-size: .7rem; font-weight: 800; text-align: right; white-space: nowrap; }
.home-bin-rows { display: grid; gap: 5px; margin-top: 9px; }
.home-bin-rows > div { min-width: 0; display: grid; gap: 1px; padding-top: 5px; border-top: 1px solid var(--line); }
.home-bin-rows span { min-width: 0; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .64rem; }
.home-bin-rows strong { font-size: .7rem; line-height: 1.25; }
.bin-dot { width: 10px; height: 10px; display: inline-block; border-radius: 3px; }
.bin-household { background: #40534c; }
.bin-packaging { background: #f1c84b; }
.home-quick-unavailable { margin: 10px 0 0; color: var(--muted); font-size: .7rem; }
.composer { margin-bottom: 16px; padding: 16px; }
.composer-row { display: flex; align-items: flex-start; gap: 11px; }
.composer-row textarea { min-height: 58px; padding: .7rem .1rem; background: transparent; border: 0; box-shadow: none; }
.composer-actions { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding-top: 11px; border-top: 1px solid var(--line); }
.composer-actions .button { min-height: 41px; padding: .6rem .9rem; }
.media-picker { min-height: 42px; display: inline-flex; grid-auto-flow: column; align-items: center; gap: 7px; padding: 8px 7px; color: var(--accent-700); cursor: pointer; font-size: .83rem; }
.media-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.composer-hint { display: none; color: var(--muted); font-size: .72rem; }
.media-preview { display: flex; gap: 8px; margin: 8px 0 12px 57px; overflow-x: auto; }
.media-preview span { width: 70px; height: 70px; flex: 0 0 auto; overflow: hidden; border-radius: 10px; background: #e4ece8; }
.media-preview img, .media-preview video { width: 100%; height: 100%; object-fit: cover; }
.post-card { position: relative; margin-bottom: 16px; overflow: hidden; }
.post-head { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; padding: 16px 16px 8px; }
.post-author strong, .post-author span { display: block; }
.post-author strong { line-height: 1.2; }
.post-author span { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.post-actions { position: relative; align-self: start; }
.post-menu-button { color: var(--muted); letter-spacing: .08em; }
.context-menu { position: absolute; z-index: 5; top: 38px; right: 0; min-width: 145px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.context-menu button { width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.context-menu button:hover { background: var(--cream); }
.danger-text { color: var(--danger); }
.post-content { padding: 7px 16px 15px; color: #213f37; overflow-wrap: anywhere; white-space: normal; }
.media-grid { display: grid; gap: 2px; overflow: hidden; background: #dce5e1; }
.media-grid a, .media-grid video { min-width: 0; min-height: 0; }
.media-grid img, .media-grid video { width: 100%; height: 100%; max-height: 600px; object-fit: cover; background: #0d1e19; }
.media-count-2, .media-count-3, .media-count-4, .media-count-5, .media-count-6 { grid-template-columns: repeat(2, 1fr); }
.media-count-3 a:first-child, .media-count-3 video:first-child { grid-row: span 2; }
.media-count-4, .media-count-5, .media-count-6 { grid-auto-rows: minmax(130px, 280px); }
.reaction-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.reaction-button { min-height: 39px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 5px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 11px; cursor: pointer; }
.reaction-button span { font-size: 1rem; filter: grayscale(.7); transition: transform .15s, filter .15s; }
.reaction-button b { font-size: .72rem; }
.reaction-button.is-active { color: var(--accent-800); background: var(--accent-100); border-color: #c6eddd; }
.reaction-button.is-active span { filter: none; transform: scale(1.15); }
.comments-wrap { padding: 11px 14px 14px; }
.load-comments { margin: 0 0 8px 45px; padding: 3px 0; color: var(--muted); background: none; border: 0; cursor: pointer; font-size: .78rem; font-weight: 650; }
.comment-list { display: grid; gap: 9px; }
.comment { display: flex; align-items: flex-start; gap: 8px; }
.comment-bubble { min-width: 0; max-width: calc(100% - 42px); padding: 8px 11px; background: #f1f5f2; border-radius: 6px 15px 15px 15px; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; }
.comment-head strong { font-size: .84rem; }
.comment-head time { color: var(--muted); font-size: .66rem; }
.comment-text { margin: 2px 0 0; font-size: .87rem; overflow-wrap: anywhere; }
.micro-actions { display: flex; gap: 10px; margin-top: 4px; }
.micro-actions button { padding: 0; color: var(--muted); background: none; border: 0; font-size: .66rem; cursor: pointer; }
.comment-form { display: grid; grid-template-columns: 34px 1fr 38px; align-items: center; gap: 7px; margin-top: 11px; }
.comment-form input { min-height: 41px; padding: .55rem .72rem; background: #f6f8f6; border-radius: 20px; font-size: .84rem; }
.comment-form button { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--accent-600); border: 0; border-radius: 50%; cursor: pointer; }
.empty-state { padding: 42px 24px; text-align: center; }
.empty-state > span { color: var(--accent-500); font-size: 2.5rem; }
.empty-state h2 { margin: 6px 0; font-size: 1.25rem; }
.empty-state p { margin: 0 0 18px; color: var(--muted); }
.feed-side { display: none; }
#load-more { margin: 0 0 20px; }

.profile-card, .section-card, .table-card { padding: 20px; margin-bottom: 18px; }
.profile-identity { display: flex; align-items: center; gap: 18px; }
.profile-identity h2 { margin: 0; font-size: 1.55rem; }
.profile-identity p { margin: 2px 0 7px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; color: var(--accent-700); background: var(--accent-100); border-radius: 20px; font-size: .68rem; font-weight: 800; vertical-align: middle; }
.badge-muted { color: #687870; background: #edf1ef; }
.section-card h2 { margin: 0 0 5px; font-size: 1.3rem; }
.section-card > .muted { margin-top: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat-card { padding: 16px 12px; }
.stat-card > span { color: var(--accent-500); }
.stat-card strong { display: block; margin: 3px 0 -2px; font-size: 1.7rem; letter-spacing: -.04em; }
.stat-card p { margin: 0; color: var(--muted); font-size: .72rem; }
.admin-links { display: grid; gap: 13px; }
.home-settings-card { margin-top: 18px; }
.admin-link { min-height: 104px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 13px; padding: 16px; color: var(--ink); }
.admin-link > span { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--accent-500), var(--forest-800)); border-radius: 15px; }
.admin-link h2 { margin: 0; font-size: 1rem; }
.admin-link p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.admin-link b { color: var(--accent-600); font-size: 1.2rem; }
.user-list { display: grid; }
.user-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.user-row:first-child { padding-top: 0; }
.user-row:last-child { padding-bottom: 0; border: 0; }
.user-main { min-width: 0; }
.user-main strong, .user-main > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-main > span { color: var(--muted); font-size: .75rem; }
.user-actions { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 7px; }
.credentials-card { margin-bottom: 18px; padding: 18px; border-color: #bfead9; background: linear-gradient(135deg, #f4fff9, #fff); }
.credentials-card h2 { margin: 0; font-size: 1.1rem; }
.credentials-card pre { margin: 14px 0; padding: 12px; overflow-x: auto; color: #18483b; background: #e9f7f1; border-radius: 10px; white-space: pre-wrap; font: 600 .8rem/1.6 ui-monospace, monospace; }
.credentials-card > p { margin: 10px 0 0; color: var(--muted); font-size: .7rem; }
.credentials-persistent { scroll-margin-top: 86px; }
.credentials-heading { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 11px; margin-bottom: 17px; }
.credentials-heading > span { width: 42px; height: 42px; display: grid; place-items: center; background: #dff6eb; border-radius: 13px; }
.credentials-heading p { margin: 3px 0 0; color: var(--muted); font-size: .75rem; }
.credential-password-label { margin-top: 4px; }
.credential-password-label input[readonly] { color: #16483a; background: #effaf5; border-color: #c6e7d8; font: 700 .94rem/1.2 ui-monospace, monospace; }
.password-field-group { display: grid; gap: 8px; align-content: start; }
.password-toggle { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; font-weight: 650; cursor: pointer; }
.password-toggle input { width: 20px; min-height: 20px; margin: 0; padding: 0; accent-color: var(--accent-600); }
.credential-buttons { display: grid; gap: 9px; margin-top: 16px; }
.button-whatsapp { color: #fff; background: #1fa855; box-shadow: 0 9px 22px rgba(31, 168, 85, .2); }
.credential-security-note { color: var(--muted); font-size: .7rem; }
.credential-missing { margin: 0; font-weight: 500; }
.app-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.app-row:last-child { border: 0; }
.app-row .button { grid-column: 2 / 4; }
.app-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: var(--forest-800); border-radius: 12px; }
.app-row strong, .app-row code { display: block; }
.app-row code { max-width: 100%; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; }
.empty-inline { padding: 12px; color: var(--muted); text-align: center; }
.info-panel { margin: 12px 2px 30px; padding: 15px 17px; color: #245347; background: #e8f5ef; border-radius: 14px; }
.info-panel p { margin: 4px 0 0; font-size: .84rem; }
.info-panel code { font-size: .76rem; }

.toast-region { position: fixed; z-index: 100; inset: auto 14px max(16px, env(safe-area-inset-bottom)); display: grid; justify-items: center; pointer-events: none; }
.toast { max-width: 440px; padding: 11px 16px; color: #fff; background: var(--forest-950); border-radius: 12px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(18px); transition: .22s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-error { background: #8d2937; }

@media (min-width: 560px) {
    .page-shell { padding-inline: 22px; }
    .auth-card { padding: 30px; }
    .composer-hint { display: inline; }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .full-field { grid-column: 1 / -1; }
    .user-actions { grid-column: auto; justify-content: flex-end; }
    .credential-buttons { grid-template-columns: repeat(2, minmax(0, max-content)); }
    .app-row { grid-template-columns: 44px minmax(0, 1fr) auto auto; }
    .app-row .button { grid-column: auto; }
    .home-forecast { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; }
    .home-quick-card { padding: 14px; }
    .home-quick-title { grid-template-columns: 30px minmax(0, 1fr) auto; }
    .home-quick-title em { grid-column: auto; grid-row: 1; margin-top: 0; }
    .home-quick-icon { width: 30px; height: 30px; }
}

@media (min-width: 900px) {
    .page-shell { padding-top: 94px; }
    .auth-wrap { grid-template-columns: minmax(360px, .9fr) minmax(440px, 1.1fr); align-items: center; padding: 50px max(5vw, 40px); }
    .auth-hero { text-align: left; padding: 40px; }
    .app-logo { margin-left: 0; }
    .auth-card { width: min(100%, 500px); margin: 0 auto; padding: 38px; }
    .feed-layout { display: grid; grid-template-columns: minmax(0, 680px) 280px; align-items: start; gap: 24px; }
    .feed-side { position: sticky; top: 92px; display: block; padding: 24px; }
    .feed-side .side-mark { color: var(--accent-500); font-size: 2rem; }
    .feed-side h2 { margin: 6px 0; }
    .feed-side p { color: var(--muted); font-size: .9rem; }
    .stat-card { padding: 21px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* === Agenda / carrousel "À venir sur l'île" (v1.3) === */
.home-events-section { margin: 2px 0 16px; }
.home-events-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 3px 9px; }
.home-events-heading h2 { margin: 1px 0 0; color: #14392f; font-size: 1.18rem; line-height: 1.15; letter-spacing: -.035em; }
.home-events-eyebrow { color: var(--accent-600); font-size: .62rem; font-weight: 850; letter-spacing: .15em; }
.home-events-nav { display: flex; gap: 6px; }
.home-event-arrow { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; color: var(--forest-800); background: #fff; border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 5px 14px rgba(4, 53, 41, .07); cursor: pointer; font-size: 1.45rem; line-height: 1; }
.home-event-arrow:active { transform: scale(.96); }
.home-events-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(86%, 1fr); gap: 10px; overflow-x: auto; padding: 1px 1px 7px; scroll-padding-inline: 1px; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-inline: contain; }
.home-events-track::-webkit-scrollbar { display: none; }
.home-event-card { min-width: 0; text-decoration: none; color: inherit; min-height: 0; display: flex; flex-direction: column; padding: 10px 12px; cursor: pointer; overflow: hidden; scroll-snap-align: start; box-shadow: 0 9px 26px rgba(4, 53, 41, .075); }
.home-event-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.home-event-category { min-width: 0; display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; color: var(--accent-800); background: var(--accent-100); border-radius: 999px; font-size: .64rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-event-category > span { font-size: .82rem; }
.home-event-source { flex: 0 1 auto; color: var(--muted); font-size: .58rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-event-date-row { min-width: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 11px; align-items: center; margin-top: 8px; }
.home-event-date { min-height: 72px; display: grid; align-content: center; justify-items: center; padding: 6px 5px; color: #fff; background: linear-gradient(145deg, var(--forest-900), var(--accent-700)); border-radius: 15px; box-shadow: 0 8px 18px rgba(6, 97, 73, .18); text-align: center; }
.home-event-date strong { font-size: .82rem; line-height: 1.22; }
.home-event-date span { margin-top: 3px; color: #baf2dc; font-size: .7rem; font-weight: 780; }
.home-event-copy { min-width: 0; }
.home-event-copy h3 { margin: 0; display: -webkit-box; overflow: hidden; color: #163a31; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-size: 1rem; line-height: 1.2; letter-spacing: -.025em; }
.home-event-copy p { min-width: 0; display: flex; align-items: center; gap: 4px; margin: 6px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.25; }
.home-event-copy p span { color: var(--accent-600); font-size: .85rem; }
.home-event-footer { min-height: 34px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.home-event-link { font-size: .69rem; font-weight: 800; }
.home-event-admin-actions { display: flex; gap: 5px; }
.home-event-admin-button { min-height: 30px; padding: 4px 7px; color: var(--accent-800); background: #eff9f5; border: 1px solid #d6eee4; border-radius: 8px; cursor: pointer; font-size: .61rem; font-weight: 800; }
.home-event-admin-button.is-danger { color: #a72d3b; background: #fff1f2; border-color: #f5d7db; }
.home-events-dots { min-height: 12px; display: flex; justify-content: center; gap: 5px; padding-top: 3px; }
.home-events-dots span { width: 5px; height: 5px; background: #c8d7d1; border-radius: 50%; transition: width .18s ease, background .18s ease; }
.home-events-dots span.is-active { width: 15px; background: var(--accent-600); border-radius: 999px; }

.home-event-dialog { width: min(calc(100% - 22px), 620px); max-height: min(88vh, 760px); padding: 0; overflow: auto; color: var(--ink); background: transparent; border: 0; border-radius: 20px; }
.home-event-dialog::backdrop { background: rgba(1, 24, 18, .58); backdrop-filter: blur(4px); }
.home-event-dialog.is-open { position: fixed; z-index: 120; inset: 6vh 11px auto; display: block; margin: auto; }
.home-event-dialog-shell { display: grid; gap: 13px; padding: 18px; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); }
.home-event-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-event-dialog-head span { color: var(--accent-600); font-size: .62rem; font-weight: 850; letter-spacing: .14em; }
.home-event-dialog-head h2 { margin: 2px 0 0; font-size: 1.25rem; }
.home-event-dialog-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.home-event-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }

.event-sync-card { display: grid; gap: 15px; }
.event-sync-card p { margin: 3px 0 5px; color: var(--muted); }
.event-sync-card small { color: var(--muted); }
.event-admin-list { padding-top: 12px; }
.event-admin-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0 12px; border-bottom: 1px solid var(--line); }
.event-admin-list-head h2 { margin: 0; font-size: 1.15rem; }
.event-admin-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.event-admin-row:last-child { border-bottom: 0; }
.event-admin-row.is-deleted { opacity: .58; }
.event-admin-icon { width: 40px; height: 40px; display: grid; place-items: center; background: #f0f7f4; border-radius: 12px; font-size: 1.2rem; }
.event-admin-main { min-width: 0; }
.event-admin-main strong, .event-admin-main span, .event-admin-main small { display: block; }
.event-admin-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.event-admin-main span { margin-top: 2px; color: #385e54; font-size: .72rem; }
.event-admin-main small { margin-top: 2px; color: var(--muted); font-size: .64rem; }
.event-admin-row > form { margin: 0; }
.event-admin-row > .button, .event-admin-row > form { grid-column: 2 / 4; }
.event-admin-row > .badge { justify-self: end; }

@media (min-width: 560px) {
    .home-events-track { grid-auto-columns: minmax(48%, 1fr); }
    .home-event-dialog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .event-sync-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .event-admin-row { grid-template-columns: 42px minmax(0, 1fr) auto auto auto; }
    .event-admin-row > .button, .event-admin-row > form { grid-column: auto; }
}

@media (min-width: 900px) {
    .home-events-track { grid-auto-columns: minmax(47%, 1fr); }
}

/* Administration du carrousel événements — v1.3.2 */
.event-admin-help { margin: 8px 0 14px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.event-admin-actions { grid-column: 2 / 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.event-admin-row.is-hidden { opacity: .78; }
.event-admin-row.is-deleted { opacity: .55; }
.badge-success { color: var(--accent-700); background: var(--accent-100); }
.event-admin-actions [hidden] { display: none !important; }
@media (min-width: 760px) {
    .event-admin-row { grid-template-columns: 42px minmax(0, 1fr) minmax(320px, auto); }
    .event-admin-actions { grid-column: auto; }
}


/* Administration — suivi des connexions (v1.3.3) */
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.user-main .user-last-login { margin-top: 4px; color: #365c51; font-size: .72rem; white-space: normal; }
.user-main .user-last-login strong { display: inline; color: var(--accent-700); font-size: inherit; }
.user-main .user-last-activity { margin-top: 2px; color: #365c51; font-size: .72rem; white-space: normal; }
.user-main .user-last-activity strong { display: inline; color: var(--accent-700); font-size: inherit; }
.connection-summary-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 18px 20px; }
.connection-summary-card div span, .connection-summary-card div strong { display: block; }
.connection-summary-card div span { color: var(--muted); font-size: .76rem; font-weight: 700; }
.connection-summary-card div strong { margin-top: 2px; font-size: 1.8rem; letter-spacing: -.04em; }
.connection-summary-card p { margin: 0; color: var(--muted); font-size: .76rem; text-align: right; }
.connection-history-card { padding-top: 8px; padding-bottom: 8px; }
.connection-list { display: grid; }
.connection-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.connection-row:last-child { border-bottom: 0; }
.connection-user { min-width: 0; }
.connection-user strong, .connection-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-user span { margin-top: 1px; color: var(--muted); font-size: .72rem; }
.connection-row time { grid-column: 2; color: #315c50; font-size: .78rem; font-weight: 750; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 18px 0 4px; }
.pagination > span { color: var(--muted); font-size: .78rem; font-weight: 700; }

@media (max-width: 559px) {
    .heading-row { align-items: stretch; flex-direction: column; }
    .heading-actions { justify-content: stretch; }
    .heading-actions .button { flex: 1 1 100%; }
    .connection-summary-card { align-items: flex-start; flex-direction: column; }
    .connection-summary-card p { text-align: left; }
}

@media (min-width: 560px) {
    .connection-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
    .connection-row time { grid-column: auto; text-align: right; }
}


/* Upload progress global — v1.5.1 */
.em-upload-overlay[hidden] { display: none !important; }
.em-upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.em-upload-card {
    width: min(92vw, 430px);
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 24px 22px 20px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 20px;
    background: #101614;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .5);
    color: #fff;
    text-align: center;
}
.em-upload-spinner {
    width: 34px;
    height: 34px;
    border: 4px solid rgba(255,255,255,.18);
    border-top-color: #33d17a;
    border-radius: 50%;
    animation: em-upload-spin .8s linear infinite;
}
.em-upload-title { font-size: 1.08rem; line-height: 1.2; }
.em-upload-detail { min-height: 1.2em; color: rgba(255,255,255,.78); font-size: .86rem; }
.em-upload-progress {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
}
.em-upload-progress > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0e9f6e, #42e695);
    transition: width .12s linear;
}
.em-upload-percent { font-size: 1.45rem; letter-spacing: -.02em; }
.em-upload-card small { color: rgba(255,255,255,.62); font-size: .72rem; }
html.em-upload-active, html.em-upload-active body { overflow: hidden; }
@keyframes em-upload-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .em-upload-spinner { animation-duration: 1.8s; }
    .em-upload-progress > span { transition: none; }
}

/* Fil d'actualité — galerie multimédia + édition complète v1.6.0 */
.media-grid { gap: 3px; padding: 0 3px 3px; background: transparent; }
.post-media-item { position: relative; min-width: 0; min-height: 0; height: 100%; padding: 0; overflow: hidden; border: 0; background: #10231d; cursor: zoom-in; }
.post-media-item img, .post-media-item video { display: block; width: 100%; height: 100%; min-height: 190px; max-height: 560px; object-fit: cover; background: #10231d; transition: transform .18s ease, filter .18s ease; }
.post-media-item:hover img, .post-media-item:hover video { transform: scale(1.015); filter: brightness(.96); }
.media-count-1 .post-media-item img, .media-count-1 .post-media-item video { min-height: 250px; max-height: 620px; }
.media-count-2, .media-count-3, .media-count-4, .media-count-5, .media-count-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-count-3 .post-media-item:first-child { grid-row: span 2; }
.media-count-4, .media-count-5, .media-count-6 { grid-auto-rows: minmax(135px, 270px); }
.media-count-4 .post-media-item img, .media-count-4 .post-media-item video,
.media-count-5 .post-media-item img, .media-count-5 .post-media-item video,
.media-count-6 .post-media-item img, .media-count-6 .post-media-item video { min-height: 135px; }
.post-media-play { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; display: grid; place-items: center; transform: translate(-50%, -50%); color: #fff; background: rgba(0,0,0,.58); border: 1px solid rgba(255,255,255,.35); border-radius: 50%; font-size: 1.25rem; line-height: 1; padding-left: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.26); pointer-events: none; }

.post-edit-dialog { width: min(94vw, 620px); max-height: 90vh; padding: 0; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.34); }
.post-edit-dialog::backdrop { background: rgba(4,16,12,.72); backdrop-filter: blur(3px); }
.post-edit-shell { max-height: 90vh; overflow: auto; padding: 18px; }
.post-edit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.post-edit-head span { color: var(--accent-600); font-size: .65rem; font-weight: 850; letter-spacing: .12em; }
.post-edit-head h2 { margin: 2px 0 0; font-size: 1.35rem; }
.post-edit-label { display: grid; gap: 7px; color: var(--muted); font-size: .76rem; font-weight: 750; }
.post-edit-label textarea { width: 100%; min-height: 118px; resize: vertical; }
.post-edit-media-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.post-edit-section-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.post-edit-section-title strong { font-size: .92rem; }
.post-edit-section-title span { color: var(--muted); font-size: .7rem; }
.post-edit-existing, .post-edit-new-preview { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.post-edit-existing-item, .post-edit-new-preview > span { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 13px; background: #e6eeea; }
.post-edit-existing-item img, .post-edit-existing-item video, .post-edit-new-preview img, .post-edit-new-preview video { width: 100%; height: 100%; object-fit: cover; }
.post-edit-existing-item.is-removed img, .post-edit-existing-item.is-removed video { filter: grayscale(1) brightness(.55); opacity: .58; }
.post-edit-existing-item.is-removed::after { content: 'Sera supprimé'; position: absolute; inset: auto 5px 6px; padding: 4px 6px; color: #fff; background: rgba(122,25,25,.88); border-radius: 7px; text-align: center; font-size: .62rem; font-weight: 800; }
.post-edit-remove-media { position: absolute; z-index: 2; top: 6px; right: 6px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; color: #fff; background: rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.45); border-radius: 50%; font-size: 1.05rem; cursor: pointer; }
.post-edit-video-badge { position: absolute; left: 6px; bottom: 6px; padding: 3px 6px; color: #fff; background: rgba(0,0,0,.66); border-radius: 6px; font-size: .58rem; font-weight: 850; letter-spacing: .06em; }
.post-edit-picker { width: 100%; justify-content: center; padding: 11px 12px; background: var(--accent-100); border: 1px dashed #9ad0b9; border-radius: 12px; }
.post-edit-new-preview { margin-top: 10px; }
.post-edit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }

body.media-lightbox-open { overflow: hidden; }
.post-media-lightbox { position: fixed; z-index: 10000; inset: 0; }
.post-media-lightbox[hidden] { display: none !important; }
.post-media-lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.94); backdrop-filter: blur(7px); }
.post-media-lightbox-ui { position: absolute; inset: 0; display: grid; grid-template-columns: 52px minmax(0,1fr) 52px; grid-template-rows: 52px minmax(0,1fr) 42px; align-items: center; }
.post-media-lightbox-stage { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; width: 100%; height: 100%; display: grid; place-items: center; padding: 8px; touch-action: pan-y; }
.post-media-lightbox-stage img, .post-media-lightbox-stage video { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 4px; box-shadow: 0 16px 60px rgba(0,0,0,.42); }
.post-media-lightbox-stage video { width: min(100%, 1100px); }
.post-media-lightbox-close, .post-media-lightbox-arrow { position: relative; z-index: 2; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); cursor: pointer; }
.post-media-lightbox-close { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); width: 42px; height: 42px; border-radius: 50%; font-size: 1.65rem; }
.post-media-lightbox-arrow { width: 42px; height: 58px; justify-self: center; border-radius: 14px; font-size: 2rem; }
.post-media-lightbox-arrow.is-prev { grid-column: 1; grid-row: 2; }
.post-media-lightbox-arrow.is-next { grid-column: 3; grid-row: 2; }
.post-media-lightbox-counter { grid-column: 2; grid-row: 3; justify-self: center; align-self: start; min-width: 58px; padding: 5px 10px; color: rgba(255,255,255,.9); background: rgba(255,255,255,.08); border-radius: 20px; text-align: center; font-size: .78rem; font-weight: 750; }

@media (max-width: 520px) {
    .post-media-item img, .post-media-item video { min-height: 155px; }
    .media-count-1 .post-media-item img, .media-count-1 .post-media-item video { min-height: 230px; }
    .post-edit-existing, .post-edit-new-preview { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .post-media-lightbox-ui { grid-template-columns: 44px minmax(0,1fr) 44px; }
    .post-media-lightbox-arrow { width: 36px; height: 52px; font-size: 1.7rem; background: rgba(0,0,0,.32); }
    .post-media-lightbox-stage { padding: 4px; }
}

/* Fiche événement interne — v1.6.4 */
.home-event-card:focus-visible { outline: 3px solid rgba(26, 139, 103, .35); outline-offset: 2px; }
.home-event-dialog { overscroll-behavior: contain; }
.home-event-dialog-shell { max-height: min(90vh, 780px); overflow-y: auto; }
.home-event-dialog-head { position: sticky; top: -18px; z-index: 2; margin: -18px -18px 0; padding: 17px 18px 12px; background: rgba(255,255,255,.96); border-bottom: 1px solid rgba(11,84,65,.08); backdrop-filter: blur(12px); }
.home-event-dialog-head h2 { color: #123e33; line-height: 1.15; }
.home-event-info { padding: 11px 12px; background: #f4f8f6; border: 1px solid #e2ece7; border-radius: 13px; }
.home-event-info small, .home-event-source-block > small { display: block; margin-bottom: 4px; color: var(--muted); font-size: .66rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.home-event-info strong { color: #173f35; font-size: .9rem; }
.home-event-info p { margin: 0; color: #31584e; font-size: .84rem; line-height: 1.45; white-space: pre-line; }
.home-event-info-wide { grid-column: 1 / -1; }
.home-event-route-block, .home-event-source-block, .home-event-admin-modal { display: grid; gap: 9px; padding: 13px; border-radius: 15px; }
.home-event-route-block { background: #f0f7f4; border: 1px solid #dcebe5; }
.home-event-route-block > strong, .home-event-admin-modal > strong { color: #173f35; font-size: .84rem; }
.home-event-route-block > small { color: var(--muted); font-size: .67rem; line-height: 1.35; }
.home-event-route-actions, .home-event-admin-modal > div { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.home-event-map-button { min-height: 42px; justify-content: center; color: #fff; background: linear-gradient(145deg,#145c47,#0c8a64); border: 1px solid rgba(255,255,255,.24); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 7px 16px rgba(9,95,69,.17); }
.home-event-source-block { background: linear-gradient(145deg, rgba(11,101,73,.11), rgba(31,179,128,.08)); border: 1px solid rgba(17,128,93,.18); }
.home-event-source-button { width: 100%; min-height: 44px; justify-content: center; color: #fff; background: linear-gradient(145deg, rgba(10,91,67,.96), rgba(22,152,108,.92)); border: 1px solid rgba(255,255,255,.38); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 8px 20px rgba(5,84,60,.18); backdrop-filter: blur(10px); }
.home-event-source-button:hover { color: #fff; transform: translateY(-1px); }
.home-event-admin-modal { background: #fff8f0; border: 1px solid #f2dfc8; }
.home-event-admin-modal[hidden], .home-event-source-block[hidden] { display: none !important; }
.home-event-admin-modal .button { justify-content: center; text-align: center; }
@media (max-width: 430px) {
  .home-event-dialog { width: calc(100% - 14px); max-height: 94vh; }
  .home-event-dialog-shell { padding: 15px; }
  .home-event-dialog-head { top: -15px; margin: -15px -15px 0; padding: 15px 15px 11px; }
  .home-event-route-actions, .home-event-admin-modal > div { grid-template-columns: 1fr 1fr; }
}

/* Administration des sources du carrousel événements */
.event-source-live-note{font-size:.82rem;color:var(--muted)}
.event-source-list{display:grid;gap:10px;margin:12px 0 18px}
.event-source-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px;border:1px solid var(--border);border-radius:14px;background:rgba(255,255,255,.025)}
.event-source-dot{width:12px;height:12px;border-radius:50%;display:block;background:#7d8791;box-shadow:0 0 0 3px rgba(125,135,145,.13)}
.event-source-dot.is-online{background:#35c86f;box-shadow:0 0 0 3px rgba(53,200,111,.15),0 0 12px rgba(53,200,111,.4)}
.event-source-dot.is-offline{background:#ef5b5b;box-shadow:0 0 0 3px rgba(239,91,91,.15),0 0 12px rgba(239,91,91,.3)}
.event-source-main{min-width:0;display:grid;gap:3px}.event-source-main small{overflow-wrap:anywhere;color:var(--muted)}.event-source-main span{font-size:.78rem;color:var(--muted)}
.event-source-actions{grid-column:2/-1;display:flex;gap:8px;flex-wrap:wrap}.event-source-actions form{margin:0}
.event-source-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}
@media(min-width:760px){.event-source-row{grid-template-columns:auto minmax(0,1fr) auto auto}.event-source-actions{grid-column:auto}}

.event-source-head-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.event-source-modal[hidden]{display:none!important}.event-source-modal{position:fixed;inset:0;z-index:10050;display:grid;place-items:center;padding:14px}.event-source-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.72);backdrop-filter:blur(5px)}.event-source-dialog{position:relative;z-index:1;width:min(620px,100%);max-height:92vh;overflow:auto;background:var(--surface,#111a18);border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 24px 70px rgba(0,0,0,.45)}.event-source-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.event-source-dialog-head h2{margin:0}.event-source-dialog-close{width:42px;height:42px;border:0;border-radius:50%;font-size:1.7rem;line-height:1;background:rgba(255,255,255,.08);color:inherit;cursor:pointer}.event-source-dialog .event-source-form{margin:0;padding:0;border:0}body.modal-open{overflow:hidden}


/* Bécaniste — identité noir / jaune / rouge / blanc — v1.7.0 */
:root {
    --forest-950: #050505;
    --forest-900: #0b0b0b;
    --forest-800: #151515;
    --accent-800: #a50f16;
    --accent-700: #c8141d;
    --accent-600: #e31b23;
    --accent-500: #ffd21a;
    --accent-100: #fff3b0;
    --cream: #050505;
    --surface: #111111;
    --ink: #ffffff;
    --muted: #b9b9b9;
    --line: #343434;
    --danger: #e31b23;
    --shadow: 0 12px 34px rgba(0,0,0,.42);
    --shadow-lg: 0 24px 70px rgba(0,0,0,.64);
}
body { background:#050505; color:#fff; }
a { color:#ffd21a; }
.card { background:#111; border-color:#2d2d2d; box-shadow:var(--shadow); }
.page-heading h1, .post-author strong, .section-card h2, .profile-card h2 { color:#fff; }
.eyebrow, .step-label { color:#ffd21a; }
.topbar {
    grid-template-columns:48px minmax(0,1fr);
    color:#fff;
    background:linear-gradient(110deg,#050505 0%,#111 66%,#3b080b 100%);
    border-bottom:2px solid #ffd21a;
    box-shadow:0 8px 28px rgba(0,0,0,.52);
}
.brand-compact { justify-self:end; font-size:1.28rem; letter-spacing:-.03em; }
.brand-mark { color:#ffd21a; filter:drop-shadow(0 0 8px rgba(255,210,26,.35)); }
.profile-shortcut { display:none!important; }
.menu-toggle span { background:#ffd21a; }
.menu-overlay { background:rgba(0,0,0,.72); }
.drawer {
    color:#fff;
    background:radial-gradient(circle at 8% 0%,rgba(227,27,35,.25),transparent 34%),#090909;
    border-right:1px solid #292929;
}
.drawer-head { border-bottom-color:#333; }
.drawer-head span { color:#c4c4c4; }
.drawer-nav a { color:#fff; }
.drawer-nav a:hover { background:#191919; }
.drawer-nav a > span:first-child { color:#ffd21a; }
.drawer-profile-link > span:last-child { width:auto!important; text-align:left!important; color:inherit!important; }
.drawer-profile-link strong, .drawer-profile-link small { display:block; }
.drawer-profile-link small { margin-top:2px; color:#aaa; font-size:.68rem; font-weight:550; }
.drawer-logout .button { color:#fff; border-color:#444; }
.avatar { border-color:#ffd21a; background:#222; box-shadow:0 4px 14px rgba(0,0,0,.45); }
.avatar-fallback { color:#050505; background:linear-gradient(145deg,#ffd21a,#e7a900); }
.button-primary { color:#080808; background:linear-gradient(135deg,#ffd21a,#f0ae00); box-shadow:0 9px 22px rgba(255,210,26,.16); }
.button-primary:hover { box-shadow:0 12px 28px rgba(255,210,26,.24); }
.button-secondary { color:#fff; background:#851017; border-color:#b81922; }
.button-ghost { color:#fff; background:#141414; border-color:#3a3a3a; }
.button-danger { color:#fff; background:#d01921; }
label { color:#ececec; }
input, textarea, select { color:#fff; background:#171717; border-color:#393939; }
input:focus, textarea:focus, select:focus { background:#1b1b1b; border-color:#ffd21a; box-shadow:0 0 0 4px rgba(255,210,26,.11); }
input::placeholder, textarea::placeholder { color:#8f8f8f; }
.form-divider { border-top-color:#333; }
.composer textarea { background:#171717; color:#fff; }
.media-picker { color:#ffd21a; background:#1b1b1b; border-color:#3a3a3a; }
.post-head, .post-content, .composer, .feed-side { color:#fff; }
.post-author span, .composer-hint, .muted, .optional { color:#aaa; }
.context-menu { background:#181818; border-color:#343434; box-shadow:0 16px 44px rgba(0,0,0,.55); }
.context-menu button { color:#fff; }
.context-menu button:hover { background:#242424; }
.context-menu .danger-text { color:#ff646a; }
.empty-state > span, .side-mark { color:#ffd21a; }
.feed-side { border-top:3px solid #e31b23; }
.alert-success { color:#fff; background:#15351f; border-color:#245b34; }
.alert-error { color:#fff; background:#471015; border-color:#7a1a22; }
.alert-info { color:#fff; background:#18232a; border-color:#2a3c46; }
.profile-card .badge { color:#090909; background:#ffd21a; }
.auth-wrap { background:radial-gradient(circle at 82% 7%,rgba(227,27,35,.25),transparent 30%),radial-gradient(circle at 8% 72%,rgba(255,210,26,.12),transparent 30%),linear-gradient(155deg,#050505,#141414); }
.auth-hero .eyebrow, .auth-hero h1 span { color:#ffd21a; }
.app-logo { color:#ffd21a; background:#121212; border-color:#353535; }
.auth-card { background:#111; color:#fff; }
.post-edit-dialog { background:#111; color:#fff; }
.post-edit-dialog::backdrop { background:rgba(0,0,0,.82); }
.post-edit-head span { color:#ffd21a; }
.post-edit-media-section { border-top-color:#333; }
.post-edit-picker { background:#1a1a1a; border-color:#6c5a00; }
@media (min-width: 900px) {
    .topbar { padding-left:max(18px,calc((100vw - 1120px)/2)); padding-right:max(18px,calc((100vw - 1120px)/2)); }
}
