*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 240px;
  --topbar-h: 54px;
  --bg: #F2F1F8;
  --bg-card: #FFFFFF;
  --sidebar-bg: #EEEDF6;
  --border: #E0DEED;
  --border-2: #C4C1D8;
  --text: #18161F;
  --text-2: #635E78;
  --text-3: #A09BB8;
  --accent: #3C3489;
  --r: 10px;
  --r-sm: 6px;
  --r-lg: 14px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: system-ui,-apple-system,'Segoe UI',sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; min-height: 100vh; }

/* ── LAYOUT ── */
.layout { display: flex; min-height: 100vh; flex-direction: column; }

/* ── LOGO ── */
.logo-icon { flex-shrink: 0; display: block; }

/* ── ACTIVE FILTER BAR ── */
.active-filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 6px 0 0; font-size: .78rem; }
.active-filter-label { color: var(--text-3); font-size: .72rem; font-weight: 500; margin-right: 2px; }
.active-filter-pill { display: inline-flex; align-items: center; gap: 5px; background: #EEEDF6; border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px 2px 10px; color: var(--accent); font-size: .74rem; font-weight: 500; }
.active-filter-pill button { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: .85rem; line-height: 1; padding: 0 0 0 2px; }
.active-filter-pill button:hover { color: var(--text); }
.active-filter-clear { background: none; border: none; color: var(--text-3); font-size: .73rem; cursor: pointer; margin-left: 4px; text-decoration: underline; }
.active-filter-clear:hover { color: var(--text-2); }

/* ── AXES FILTER BAR ── */
.axes-bar { padding: 0 0 6px; }
.axes-bar-label { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.axes-pills-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-axe-btn { padding: 4px 11px; border-radius: 20px; font-size: .78rem; font-weight: 500; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-2); cursor: pointer; transition: all .1s; }
.filter-axe-btn:hover { border-color: var(--border-2); color: var(--text); }
.filter-axe-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.axes-reset-link { background: none; border: none; font-size: .71rem; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; opacity: .8; }
.axes-reset-link:hover { opacity: 1; }

/* ── MAIN ── */
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar { height: var(--topbar-h); border-bottom: 1px solid var(--border); background: var(--bg-card); position: sticky; top: 0; z-index: 10; display: flex; align-items: center; padding: 0; }
.topbar > * { max-width: 1240px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 0 32px; }
.topbar-left { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.topbar-brand { display: flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.topbar-title-sep { color: var(--border-2); font-size: .85rem; }
.topbar-title { font-size: .85rem; color: var(--text-2); white-space: nowrap; }
.result-count { font-size: .78rem; color: var(--text-3); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-search {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 12px; flex: 1; max-width: 280px; min-width: 140px;
  transition: border-color .15s, box-shadow .15s;
}
.topbar-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(60,52,137,.1); }
.topbar-search svg { flex-shrink: 0; color: var(--text-3); }
.topbar-search input {
  border: none; background: none; outline: none;
  font-size: .83rem; color: var(--text); width: 100%;
}
.topbar-search input::placeholder { color: var(--text-3); }

/* BUTTONS */
.btn-ghost { background: none; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 12px; font-size: .82rem; color: var(--text-2); cursor: pointer; transition: all .1s; }
.btn-ghost:hover { border-color: var(--border-2); color: var(--text); }
.btn-propose { background: var(--text); color: #fff; border: 1px solid var(--text); border-radius: var(--r-sm); padding: 5px 12px; font-size: .81rem; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: opacity .15s; display: inline-flex; align-items: center; }
.btn-propose:hover { opacity: .8; }
.btn-soutenir { display: inline-flex; align-items: center; gap: 5px; background: none; color: #72243E; border: 1px solid #F4C0D1; border-radius: var(--r-sm); padding: 5px 12px; font-size: .81rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .15s; }
.btn-soutenir:hover { background: #FBEAF0; }
.btn-submit { width: 100%; background: var(--text); color: #fff; border: none; border-radius: var(--r-sm); padding: 10px; font-size: .9rem; font-weight: 500; cursor: pointer; margin-top: 4px; transition: opacity .15s; }
.btn-submit:hover { opacity: .82; }
.btn-submit:disabled { opacity: .45; cursor: not-allowed; }

/* AVATAR */
.avatar-wrap { position: relative; }
.avatar-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; border: none; font-size: .75rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.avatar-menu { display: none; position: absolute; right: 0; top: 38px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); min-width: 160px; padding: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.08); z-index: 50; }
.avatar-menu.open { display: block; }
.avatar-name { font-size: .8rem; font-weight: 500; padding: 6px 8px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; color: var(--text); }
.avatar-menu-item { display: flex; align-items: center; gap: 7px; width: 100%; padding: 6px 8px; font-size: .82rem; color: var(--text-2); background: none; border: none; border-radius: var(--r-sm); cursor: pointer; text-decoration: none; transition: background .1s; }
.avatar-menu-item:hover { background: var(--bg); color: var(--text); }

/* ── PAGE HERO ── */
.page-hero {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 0;
}
.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 32px 0;
}
.hero-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px; display: block;
}
.hero-title {
  font-size: 2.4rem; font-weight: 900; letter-spacing: -.04em;
  color: var(--text); line-height: 1.05; margin-bottom: 16px;
}
.hero-desc {
  font-size: .93rem; color: var(--text-2); line-height: 1.7;
  max-width: 620px; margin-bottom: 28px;
}
.hero-actions {
  display: flex; align-items: center; gap: 10px; padding-bottom: 1px;
}
.hero-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 9px 14px;
  transition: border-color .15s, box-shadow .15s;
  width: 320px; flex-shrink: 0;
}
.hero-search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(60,52,137,.1); }
.hero-search-wrap svg { flex-shrink: 0; color: var(--text-3); }
.hero-search-wrap input { border: none; background: none; outline: none; font-size: .88rem; color: var(--text); width: 100%; }
.hero-search-wrap input::placeholder { color: var(--text-3); }
.btn-propose-hero {
  flex-shrink: 0; background: none; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 10px; padding: 9px 14px;
  font-size: .85rem; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .15s, color .15s;
}
.btn-propose-hero:hover { background: var(--accent); color: #fff; }
.result-count { font-size: .78rem; color: var(--text-3); margin-left: 4px; white-space: nowrap; }

/* ── FORMAT TILES ── */
.format-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; padding: 20px 0 16px; }
.format-tile {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 16px 8px 13px;
  border: 1.5px solid var(--border); border-radius: var(--r-lg);
  background: var(--bg-card); cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s, background .12s;
  text-align: center;
}
.format-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
  background: var(--tile-bg, var(--bg));
  border-color: var(--tile-border, var(--border-2));
}
.format-tile.active {
  background: var(--tile-bg);
  border-color: var(--tile-border);
  border-width: 2px;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.format-tile-emoji { font-size: 1.55rem; line-height: 1.1; }
.format-tile-label { font-size: .82rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.format-tile-count { font-size: .74rem; color: var(--text-3); }
.format-tile.active .format-tile-label { color: var(--tile-color); }
.format-tile.active .format-tile-count { color: var(--tile-color); opacity: .7; }

/* ── GRID ── */
.grid-wrap { padding: 24px 32px 48px; flex: 1; max-width: 1240px; margin: 0 auto; width: 100%; }
.grid-toolbar { display: flex; align-items: center; margin-bottom: 14px; }
.sort-label { font-size: .76rem; color: var(--text-3); margin-right: 8px; }
.sort-btn { background: none; border: 1px solid transparent; border-radius: 20px; padding: 4px 11px; font-size: .78rem; color: var(--text-2); cursor: pointer; transition: all .1s; }
.sort-btn:hover { border-color: var(--border); color: var(--text); }
.sort-btn.active { background: var(--text); color: #fff; border-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ── TILE ── */
.tile { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .12s; display: flex; flex-direction: column; }
.tile:hover { border-color: var(--border-2); transform: translateY(-1px); }
.tile:active { transform: translateY(0); }
.tile-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 5px; flex: 1; min-height: 0; }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; flex-shrink: 0; }
.tile-top-right { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.tile-year { font-size: .68rem; font-weight: 600; color: var(--text-3); background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 2px 7px; white-space: nowrap; }
.type-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .69rem; font-weight: 600; letter-spacing: .02em; padding: 3px 8px; border-radius: 20px; border: 1px solid; white-space: nowrap; flex-shrink: 0; }
.type-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.tile-link-icon { color: var(--text-3); padding: 3px; transition: color .1s; }
.tile-link-icon:hover { color: var(--text); }
.tile-title { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.28; letter-spacing: -.02em; flex-shrink: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { font-size: .78rem; color: var(--text-3); flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-desc { font-size: .84rem; color: var(--text-2); line-height: 1.58; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.tile-axes { display: flex; flex-wrap: nowrap; gap: 4px; padding-top: 8px; border-top: 1px solid var(--border); margin-top: auto; overflow: hidden; flex-shrink: 0; }
.axe-tag { font-size: .69rem; font-weight: 500; padding: 2px 7px; border-radius: 20px; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; flex-shrink: 0; }
.axe-tag:nth-child(n+4) { display: none; }
.empty { grid-column: 1/-1; text-align: center; padding: 64px 20px; color: var(--text-3); font-size: .9rem; }

/* ── UPVOTE ── */
.upvote-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 8px;
  font-size: .75rem; font-weight: 500; color: var(--text-3);
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.upvote-btn:hover { border-color: var(--border-2); color: var(--text-2); }
.upvote-btn.voted { background: #EEEDFE; border-color: #CECBF6; color: #3C3489; }
.upvote-btn.uv-pop { transform: scale(1.15); }
.uv-count { font-size: .75rem; font-weight: 600; }
.uv-label { font-size: .72rem; color: inherit; opacity: .7; }
.upvote-lg { padding: 5px 12px; font-size: .82rem; border-radius: 20px; }
.upvote-lg .uv-count { font-size: .82rem; }

/* ── DETAIL PANEL ── */
.detail-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 30;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.detail-backdrop.open { display: block; }
.detail-panel {
  position: fixed; top: 50%; left: 50%;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.18);
  z-index: 31; overflow-y: auto;
  transform: translate(-50%, -50%) scale(.96); opacity: 0; pointer-events: none;
  transition: transform .22s cubic-bezier(.16,1,.3,1), opacity .22s ease;
}
.detail-panel.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.detail-inner { display: flex; flex-direction: column; }

.detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-card); z-index: 2; gap: 10px;
  border-radius: 16px 16px 0 0;
}
.detail-head-right { display: flex; align-items: center; gap: 8px; }
.detail-back {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: none; border: 1px solid var(--border); border-radius: 50%;
  color: var(--text-2); cursor: pointer; transition: all .1s; font-size: 1rem; line-height: 1;
  padding: 0;
}
.detail-back:hover { border-color: var(--border-2); color: var(--text); background: var(--bg); }

.detail-illus-lg svg { width: 100%; height: auto; display: block; }

.detail-body { padding: 22px 24px 20px; }
.detail-title { font-size: 1.25rem; font-weight: 700; line-height: 1.22; letter-spacing: -.025em; color: var(--text); margin-bottom: 5px; }
.detail-meta { font-size: .78rem; color: var(--text-3); margin-bottom: 12px; }
.detail-axes-top { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.detail-desc { font-size: .88rem; color: var(--text-2); line-height: 1.7; }

.detail-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.detail-access-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--text); color: #fff; text-decoration: none;
  border: none; border-radius: var(--r-sm); padding: 9px 16px;
  font-size: .84rem; font-weight: 500; cursor: pointer; transition: opacity .15s;
}
.detail-access-btn:hover { opacity: .82; }
.detail-amazon-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: #FF9900; color: #111; text-decoration: none;
  border: none; border-radius: var(--r-sm); padding: 9px 16px;
  font-size: .84rem; font-weight: 500; cursor: pointer; transition: opacity .15s;
}
.detail-amazon-btn:hover { opacity: .85; }

.detail-divider { height: 1px; background: var(--border); margin: 4px 0; }

.detail-similar { padding: 20px 24px 28px; }
.detail-similar-title { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 12px; }
.detail-similar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.similar-tile {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r);
  padding: 8px 10px; cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s;
}
.similar-tile:hover { border-color: var(--border-2); box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.similar-illus { width: 52px; flex-shrink: 0; border-radius: 5px; overflow: hidden; }
.similar-illus svg { width: 52px; height: 24px; display: block; }
.similar-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.similar-type { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.similar-titre { font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.similar-auteur { font-size: .72rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.detail-comments-wrap { padding: 20px 24px 32px; }
.comments-header { margin-bottom: 16px; }
.comments-header h3 { font-size: .88rem; font-weight: 600; color: var(--text-2); }
.comments-list { display: flex; flex-direction: column; gap: 0; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.comment-author { font-size: .8rem; font-weight: 600; color: var(--text); }
.comment-date { font-size: .72rem; color: var(--text-3); }
.comment-text { font-size: .83rem; color: var(--text-2); line-height: 1.58; padding-left: 32px; }
.no-comments { font-size: .83rem; color: var(--text-3); padding: 8px 0; }
.comment-sent { font-size: .83rem; color: #27500A; background: #EAF3DE; border: 1px solid #97C459; border-radius: var(--r-sm); padding: 9px 13px; margin-top: 12px; }

.comment-form { margin-top: 18px; }
.comment-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--r);
  padding: 10px 12px; font-size: .84rem; color: var(--text);
  resize: vertical; min-height: 80px; outline: none; font-family: inherit;
  transition: border-color .1s; background: var(--bg);
}
.comment-form textarea:focus { border-color: var(--border-2); background: var(--bg-card); }
.comment-form-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.comment-note { font-size: .74rem; color: var(--text-3); }
.btn-comment { background: var(--text); color: #fff; border: none; border-radius: var(--r-sm); padding: 7px 16px; font-size: .82rem; font-weight: 500; cursor: pointer; transition: opacity .15s; }
.btn-comment:hover { opacity: .8; }
.btn-comment:disabled { opacity: .45; cursor: not-allowed; }
.comment-login-note { font-size: .82rem; color: var(--text-3); margin-top: 14px; }
.comment-login-note button { background: none; border: none; color: var(--accent); cursor: pointer; font-size: .82rem; text-decoration: underline; }

/* ── MODALS ── */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg-card); border-radius: var(--r-lg); padding: 28px; width: 380px; max-width: 94vw; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-lg { width: 520px; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 1.3rem; color: var(--text-3); cursor: pointer; line-height: 1; }
.modal-title { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.modal-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.modal-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 14px; font-size: .88rem; color: var(--text-2); cursor: pointer; margin-bottom: -1px; transition: all .1s; }
.modal-tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px; font-size: .88rem; font-weight: 500; background: var(--bg-card); color: var(--text); cursor: pointer; transition: border-color .1s, background .1s; }
.btn-google:hover { border-color: var(--border-2); background: var(--bg); }
.modal-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--text-3); font-size: .78rem; }
.modal-divider::before, .modal-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
form label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 500; color: var(--text-2); margin-bottom: 10px; }
form input, form select, form textarea { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; font-size: .88rem; color: var(--text); outline: none; font-family: inherit; transition: border-color .1s; background: var(--bg-card); width: 100%; }
form input:focus, form select:focus, form textarea:focus { border-color: var(--border-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.axes-check-group { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.axes-label { font-size: .82rem; font-weight: 500; color: var(--text-2); }
.check-item { display: flex; align-items: center; gap: 5px; font-size: .83rem; color: var(--text-2); cursor: pointer; }
.check-item input { width: auto; }
.form-error { font-size: .8rem; color: #A32D2D; min-height: 16px; margin-bottom: 4px; }
.form-note { font-size: .78rem; color: var(--text-3); margin-bottom: 8px; }

/* ── TILE MEDIA (image / illustration wrapper — hauteur fixe) ── */
.tile-media-wrap { position: relative; line-height: 0; }
.tile-media {
  width: 100%; height: 152px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tile-media--illus { padding: 0; }
.tile-media--illus svg { width: 100%; height: 152px; display: block; flex-shrink: 0; }
.tile-img { width: 100%; height: 100%; display: block; }
.tile-img--cover   { object-fit: cover; }
.tile-img--contain { object-fit: contain; padding: 12px; }

/* ── TILE LATER BUTTON (signet flottant) ── */
.tile-later-btn {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.85); backdrop-filter: blur(4px);
  border: 1px solid rgba(0,0,0,.08); display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #3C3489; opacity: 0;
  transition: opacity .15s, transform .15s, background .1s;
  z-index: 2;
}
.tile:hover .tile-later-btn { opacity: 1; }
.tile-later-btn:hover { background: #fff; transform: scale(1.1); }
.tile-later-btn--active { opacity: 1 !important; background: #fff; }
.tile-later-btn--active svg { filter: drop-shadow(0 1px 3px rgba(60,52,137,.35)); }

/* ── HEART BUTTON (cœur sur tuile et détail) ── */
.heart-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: none; border: 1px solid var(--border);
  cursor: pointer; color: #C0304A;
  transition: background .12s, border-color .12s, transform .12s;
}
.heart-btn:hover { background: #FFF0F3; border-color: #F5A0B0; transform: scale(1.1); }
.heart-btn--active { background: #FFF0F3; border-color: #F5A0B0; }
.heart-btn--active svg { filter: drop-shadow(0 1px 2px rgba(192,48,74,.35)); }
.heart-btn--lg { width: 32px; height: 32px; }

/* ── TILE STATUS BADGE ── */
.tile-status-badge {
  position: absolute; top: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; font-weight: 700; padding: 4px 9px;
  border-radius: 20px; pointer-events: none; letter-spacing: .02em;
}
.tile-status-badge--seen  { background: #27500A; color: #fff; }
.tile-status-badge--later { background: #3C3489; color: #fff; }

/* ── TILE STATES ── */
.tile--seen    { border-color: #C0C0C0; border-width: 1px; opacity: .65; }
.tile--later   { border-color: #8B7FE8; border-width: 2px; }
.tile--hearted { border-color: #E05C7A; border-width: 2px; }
.tile--seen .tile-body    { background: #F2F2F2; }
.tile--later .tile-body   { background: #F0EFFD; }
.tile--hearted .tile-body { background: #FEF0F3; }
.tile--seen:hover    { opacity: .85; border-color: #999; }
.tile--later:hover   { border-color: #6B5FD4; }
.tile--hearted:hover { border-color: #C0304A; }

/* ── TILE USER-RESOURCE ACTION BAR ── */
.tile-ur-bar {
  display: flex; gap: 0; border-top: 1px solid var(--border);
  padding: 0; overflow: hidden;
}
.ur-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: none; border: none; border-right: 1px solid var(--border);
  padding: 7px 6px; font-size: .72rem; font-weight: 500; color: var(--text-3);
  cursor: pointer; transition: background .12s, color .12s; white-space: nowrap;
}
.ur-btn:last-child { border-right: none; }
.ur-btn:hover { background: var(--bg); color: var(--text-2); }
.ur-btn.ur-active { background: #27500A; color: #fff; font-weight: 600; }
.ur-btn.ur-active--later { background: #3C3489; color: #fff; font-weight: 600; }

/* ── DETAIL PANEL IMAGE ── */
.detail-img-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.detail-img { width: 100%; height: 100%; display: block; }
.detail-img--cover   { object-fit: cover; }
.detail-img--contain { object-fit: contain; padding: 24px; }

/* ── DETAIL USER-RESOURCE BUTTONS ── */
.detail-ur-row { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.ur-btn-lg {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 14px; font-size: .82rem; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all .12s; white-space: nowrap; min-width: 130px;
}
.ur-btn-lg:hover { border-color: var(--border-2); color: var(--text); }
.ur-btn-lg.ur-active { background: #EAF3DE; border-color: #97C459; color: #27500A; }
.ur-btn-lg.ur-active--later { background: #EEEDFE; border-color: #CECBF6; color: #3C3489; }

/* ── TOOLBAR (sort + user filter) ── */
.toolbar-sort { display: flex; align-items: center; gap: 4px; }
.toolbar-label { font-size: .73rem; font-weight: 600; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; margin-right: 4px; }
.toolbar-sep { width: 1px; height: 18px; background: var(--border); margin: 0 10px; }
.ur-filter-wrap { display: flex; align-items: center; gap: 4px; }
.ur-filter-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 1px solid transparent; border-radius: 20px;
  padding: 4px 11px; font-size: .78rem; color: var(--text-2); cursor: pointer; transition: all .1s;
}
.ur-filter-btn:hover { border-color: var(--border); color: var(--text); }
.ur-filter-btn.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ── OPENING SCREEN ── */
.opening {
  position: fixed; inset: 0; z-index: 9999;
  background: #F7F6F2;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  cursor: pointer;
  transition: opacity .7s ease, visibility .7s ease;
}
.opening.is-out {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.opening-inner {
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  max-width: 560px; padding: 0 32px; text-align: center;
}
.opening-mark {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid #3C3489; flex-shrink: 0;
  opacity: 0;
  animation: op-mark .6s ease forwards;
  animation-delay: .3s;
}
.opening-quote {
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  font-weight: 400; line-height: 1.65; color: #1A1917;
  letter-spacing: -.01em;
  font-style: normal;
  border: none; margin: 0; padding: 0;
}
.opening-line {
  display: block; opacity: 0;
}
.opening-line--1 { animation: op-line .9s cubic-bezier(.22,.68,0,1.2) forwards; animation-delay: .9s; }
.opening-line--2 { animation: op-line .9s cubic-bezier(.22,.68,0,1.2) forwards; animation-delay: 2s; font-style: italic; color: #3C3489; }
.opening-author {
  opacity: 0; animation: op-fade .7s ease forwards; animation-delay: 2.2s;
  font-size: .78rem; color: #6B6860; text-align: center; font-style: normal; margin-top: -4px;
}
.opening-tagline {
  opacity: 0; animation: op-fade .7s ease forwards; animation-delay: 3.2s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center;
}
.opening-brand {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #3C3489; opacity: .7;
}
.opening-mission {
  font-size: .92rem; color: #6B6860; line-height: 1.6; font-style: italic;
}

.opening-skip {
  opacity: 0; animation: op-fade .5s ease forwards; animation-delay: 4s;
  background: none; border: 1px solid #C8C5BB; border-radius: 6px;
  padding: 8px 22px; font-size: .82rem; color: #6B6860; cursor: pointer;
  transition: border-color .15s, color .15s; font-family: inherit;
}
.opening-skip:hover { border-color: #1A1917; color: #1A1917; }

@keyframes op-mark {
  from { opacity: 0; transform: scale(.5); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes op-line {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes op-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff;
  border-radius: var(--r); padding: 12px 14px 12px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.22);
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; white-space: nowrap;
  max-width: calc(100vw - 32px);
}
.toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast-body { display: flex; align-items: center; gap: 8px; font-size: .83rem; }
.toast-body svg { color: #5DCB79; flex-shrink: 0; }
.toast-actions { display: flex; gap: 6px; }
.toast-btn {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: 4px 11px; font-size: .75rem; color: #fff;
  cursor: pointer; transition: background .1s; white-space: nowrap;
}
.toast-btn:hover { background: rgba(255,255,255,.25); }
.toast-close { background: none; border: none; color: rgba(255,255,255,.6); font-size: 1.1rem; cursor: pointer; padding: 0 2px; line-height: 1; }
.toast-close:hover { color: #fff; }

/* ── LOCAL STORAGE NOTICE ── */
.local-notice {
  display: flex; align-items: center; gap: 8px;
  background: #EAF3DE; border: 1px solid #97C459; border-radius: var(--r-sm);
  padding: 8px 12px; font-size: .76rem; color: #27500A;
  margin-bottom: 12px; line-height: 1.4;
}
.local-notice svg { flex-shrink: 0; opacity: .7; }
.local-notice-close { margin-left: auto; background: none; border: none; color: #27500A; font-size: 1rem; cursor: pointer; padding: 0 2px; opacity: .6; }
.local-notice-close:hover { opacity: 1; }

/* ── TOPBAR EXTRAS ── */
.btn-media { display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 11px; font-size: .8rem; font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; transition: all .15s; }
.btn-media:hover { border-color: var(--border-2); color: var(--text); }
.newsletter-check { flex-direction: row !important; align-items: center !important; gap: 8px !important; font-weight: 400 !important; color: var(--text-2) !important; margin-bottom: 10px; cursor: pointer; }
.newsletter-check input { width: auto !important; }

/* ── NOUVEAUTÉS DOT ── */
.nouveautes-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #E03E52; margin-left: auto; flex-shrink: 0; }

/* ── NOUVEAUTÉS PANEL ── */
.nouveautes-panel {
  position: fixed; top: 54px; right: 14px; width: 300px; max-height: 440px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.12); z-index: 200; display: flex; flex-direction: column; overflow: hidden;
}
.nouveautes-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.nouveautes-title { font-size: .88rem; font-weight: 600; }
.nouveautes-close { background: none; border: none; font-size: 1.2rem; color: var(--text-3); cursor: pointer; padding: 0 2px; }
.nouveautes-body { overflow-y: auto; padding: 8px; }
.nouveautes-empty { font-size: .82rem; color: var(--text-3); padding: 12px 8px; }
.nouveautes-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--r-sm); cursor: pointer; transition: background .1s; }
.nouveautes-item:hover { background: var(--bg); }
.nouveautes-item-title { font-size: .82rem; color: var(--text); font-weight: 500; }

/* ── COMMENTS ── */
.comments-section { padding: 16px 20px 20px; }
.comments-title { font-size: .82rem; font-weight: 700; color: var(--text); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .04em; opacity: .5; }
.comments-loading { font-size: .8rem; color: var(--text-3); padding: 8px 0; }
.comments-empty { font-size: .82rem; color: var(--text-3); padding: 8px 0 16px; }
.comment-item { border-top: 1px solid var(--border); padding: 12px 0; }
.comment-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.comment-item-tag { font-size: .7rem; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 1px 7px; color: var(--text-2); }
.comment-item-author { font-size: .78rem; font-weight: 600; color: var(--text); }
.comment-item-date { font-size: .72rem; color: var(--text-3); margin-left: auto; }
.comment-item-body { font-size: .83rem; color: var(--text); line-height: 1.6; white-space: pre-wrap; }
.comment-form { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.comment-tag-row { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.comment-tag-label { font-size: .72rem; color: var(--text-3); margin-right: 2px; }
.ctag { font-size: .72rem; border: 1px solid var(--border); border-radius: 12px; padding: 2px 9px; background: none; cursor: pointer; color: var(--text-2); transition: all .1s; }
.ctag:hover { border-color: var(--accent); color: var(--accent); }
.ctag--active { background: var(--accent); border-color: var(--accent); color: #fff; }
.comment-textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 12px; font-size: .84rem; font-family: inherit; resize: vertical; min-height: 70px; outline: none; color: var(--text); background: var(--bg-card); }
.comment-textarea:focus { border-color: var(--accent); }
.comment-form-footer { display: flex; gap: 8px; margin-top: 8px; }
.comment-author { flex: 1; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 10px; font-size: .82rem; outline: none; color: var(--text); background: var(--bg-card); }
.comment-author:focus { border-color: var(--accent); }
.comment-submit { background: var(--accent); color: #fff; border: none; border-radius: var(--r-sm); padding: 7px 16px; font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.comment-submit:hover { opacity: .88; }
.comment-submit:disabled { opacity: .5; cursor: not-allowed; }
.comment-note { font-size: .72rem; color: var(--text-3); margin-top: 7px; }
.comment-note a { color: var(--accent); }
.comment-success { background: #E6F7EF; border: 1px solid #5DCAA5; border-radius: 6px; padding: 8px 12px; color: #085041; font-size: .8rem; margin-top: 10px; }

/* ── FOOTER ── */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-card); }
.footer-urgence { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 24px; background: #FFF8F0; border-bottom: 1px solid #FFE4C4; font-size: .78rem; color: #7A4500; flex-wrap: wrap; text-align: center; }
.footer-urgence svg { flex-shrink: 0; stroke: #C47A00; }
.footer-urgence a { color: #7A4500; }
.footer-urgence a:hover { text-decoration: underline; }
.footer-citation { padding: 28px 24px 16px; text-align: center; }
.footer-quote { margin: 0 auto; max-width: 580px; font-size: .88rem; color: var(--text-2); font-style: italic; line-height: 1.65; }
.footer-quote cite { display: block; margin-top: 7px; font-size: .76rem; font-style: normal; color: var(--text-3); }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; padding: 14px 24px 22px; border-top: 1px solid var(--border); margin-top: 16px; }
.footer-nav a { font-size: .8rem; color: var(--text-3); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }

/* ── BTN VOTRE PAROLE ── */
.btn-votreparole { display: inline-flex; align-items: center; gap: 5px; font-size: .81rem; font-weight: 500; color: var(--accent); background: none; border: 1px solid rgba(60,52,137,.3); border-radius: var(--r-sm); padding: 5px 12px; text-decoration: none; transition: background .1s; }
.btn-votreparole:hover { background: rgba(60,52,137,.06); }

/* ── OVERLAY ── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.2); z-index: 40; }
.overlay.visible { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 740px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%); transition: transform .22s ease; width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .menu-toggle { display: flex; }
  .grid-wrap { padding: 12px; }
  .grid { grid-template-columns: 1fr; }
  .detail-panel { width: 100vw; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── ADMIN EDIT OVERLAY (tuile) ── */
.tile-admin-edit {
  position: absolute; top: 8px; left: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.9); border: 1px solid rgba(0,0,0,.1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #534AB7; opacity: 0; z-index: 3;
  transition: opacity .15s, transform .15s;
}
.tile:hover .tile-admin-edit { opacity: 1; }
.tile-admin-edit:hover { transform: scale(1.1); background: #fff; }

/* ── ADMIN EDIT PANEL (drawer latéral) ── */
.admin-edit-panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: 420px; max-width: 100vw;
  background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 800; display: flex; flex-direction: column; overflow-y: auto;
}
.aep-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid #E5E3DC; background: #F7F6F2;
  position: sticky; top: 0; z-index: 1;
}
.aep-title { font-size: .88rem; font-weight: 600; color: #534AB7; }
.aep-close { background: none; border: none; cursor: pointer; font-size: 1.4rem; color: #6B6860; line-height: 1; }
.aep-meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px; border-bottom: 1px solid #E5E3DC; }
.aep-meta .meta-chip { font-size: .72rem; color: #6B6860; background: #F7F6F2; border: 1px solid #E5E3DC; border-radius: 20px; padding: 3px 10px; }
#aep-form { padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.aep-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.aep-row label, #aep-form > label { font-size: .78rem; font-weight: 500; color: #6B6860; display: flex; flex-direction: column; gap: 3px; }
.aep-row input, .aep-row select, #aep-form textarea, #aep-form input:not([type="hidden"]) {
  padding: 7px 10px; border: 1px solid #E5E3DC; border-radius: 5px;
  font-size: .83rem; color: #1A1917; background: #fff; outline: none;
  transition: border-color .12s;
}
.aep-row input:focus, .aep-row select:focus, #aep-form textarea:focus { border-color: #534AB7; }
#aep-form textarea { resize: vertical; min-height: 90px; }
.aep-axes { display: flex; flex-wrap: wrap; gap: 6px; }
.aep-check { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: #6B6860; cursor: pointer; }
.aep-footer { display: flex; align-items: center; gap: 12px; padding-top: 8px; border-top: 1px solid #E5E3DC; margin-top: 4px; }
.aep-save {
  background: #534AB7; color: #fff; border: none; border-radius: 6px;
  padding: 9px 20px; font-size: .85rem; font-weight: 500; cursor: pointer;
  transition: opacity .15s;
}
.aep-save:hover { opacity: .85; }
.aep-saved { font-size: .82rem; color: #27500A; font-weight: 500; }

/* ── ADMIN IMAGE UPLOAD ── */
.aep-img-section { display: flex; flex-direction: column; gap: 8px; }
.aep-img-label { font-size: .78rem; font-weight: 500; color: #6B6860; }
.aep-img-preview {
  width: 100%; min-height: 80px; background: #F7F6F2; border: 1px solid #E5E3DC;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.aep-img-preview img { max-height: 160px; max-width: 100%; object-fit: contain; display: block; }
.aep-no-img { font-size: .75rem; color: #B0ADA5; }
.aep-img-actions { display: flex; gap: 8px; align-items: center; }
.aep-btn-upload {
  font-size: .78rem; padding: 6px 12px; border-radius: 5px;
  background: #F0EFF9; color: #534AB7; border: 1px solid #C8C5EA;
  cursor: pointer; font-weight: 500;
}
.aep-btn-upload:hover { background: #E5E3F5; }
.aep-btn-remove-img {
  font-size: .75rem; padding: 5px 10px; border-radius: 5px;
  background: none; color: #B04040; border: 1px solid #E5C5C5; cursor: pointer;
}
.aep-btn-remove-img:hover { background: #FEF2F2; }
#aep-cropper-wrap { border: 1px solid #E5E3DC; border-radius: 6px; overflow: hidden; }
#aep-crop-container { max-height: 280px; background: #1a1a1a; }
#aep-crop-container img { display: block; max-width: 100%; }
.aep-crop-ratio {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  border-top: 1px solid #E5E3DC; background: #FAFAF8; flex-wrap: wrap;
}
.aep-crop-label { font-size: .72rem; color: #6B6860; }
.aep-ratio-btn {
  font-size: .72rem; padding: 3px 9px; border-radius: 4px;
  border: 1px solid #D9D7CF; background: #fff; cursor: pointer; color: #6B6860;
}
.aep-ratio-btn.active { background: #534AB7; color: #fff; border-color: #534AB7; }
.aep-crop-actions {
  display: flex; gap: 8px; padding: 8px 10px;
  border-top: 1px solid #E5E3DC; background: #FAFAF8;
}
.aep-btn-crop-ok {
  font-size: .78rem; padding: 6px 14px; border-radius: 5px;
  background: #534AB7; color: #fff; border: none; cursor: pointer; font-weight: 500;
}
.aep-btn-crop-ok:hover { opacity: .85; }
.aep-btn-crop-cancel {
  font-size: .78rem; padding: 6px 12px; border-radius: 5px;
  background: none; color: #6B6860; border: 1px solid #D9D7CF; cursor: pointer;
}
.aep-btn-cancel:hover { background: #F7F6F2; }
