/* Moteur de recherche Soelya : accueil et résultats (thèmes clair et sombre). Variables et polices viennent de style.css. */
@view-transition { navigation: auto; }
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

:root {
  --s-surface: #fff;
  --s-glass: rgba(255, 255, 255, 0.78);
  --s-header: rgba(246, 247, 253, 0.88);
  --s-hover: rgba(91, 79, 224, 0.055);
  --s-link: #3b35b8;
  --s-visited: #6b3fa8;
  --s-snip: #3f4577;
  --s-skel-a: rgba(91, 79, 224, 0.07);
  --s-skel-b: rgba(91, 79, 224, 0.16);
  --s-scrim: rgba(12, 14, 50, 0.22);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c22;
  --bg-soft: #12153a;
  --card: #141840;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);
  --text: #eceeff;
  --text-dim: #a4aad8;
  --accent: #9d95ff;
  --accent-soft: rgba(157, 149, 255, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.3), 0 24px 64px rgba(0, 0, 0, 0.55);
  --s-surface: #141840;
  --s-glass: rgba(24, 28, 70, 0.68);
  --s-header: rgba(10, 12, 34, 0.86);
  --s-hover: rgba(157, 149, 255, 0.07);
  --s-link: #a9a3ff;
  --s-visited: #c3a2f0;
  --s-snip: #b4b9e2;
  --s-skel-a: rgba(157, 149, 255, 0.08);
  --s-skel-b: rgba(157, 149, 255, 0.2);
  --s-scrim: rgba(2, 3, 14, 0.5);
}
:root[data-theme="dark"] ::selection { background: rgba(157, 149, 255, 0.35); }
:root[data-theme="dark"] .aurora .blob { opacity: 0.4; }
:root[data-theme="dark"] .aurora .b1 { background: #3a2fb0; }
:root[data-theme="dark"] .aurora .b2 { background: #0e5a96; }
:root[data-theme="dark"] .aurora .b3 { background: #5b2a9a; }
:root[data-theme="dark"] .aurora .grid-fade { background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px); }

.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo-d { display: none; }
:root[data-theme="dark"] .logo-l { display: none; }
:root[data-theme="dark"] .logo-d { display: inline-block; }

/* Boutons-icônes (annule le style de bouton global) */
.ib { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-dim); box-shadow: none; font-size: 1.05rem; cursor: pointer; transition: background 0.2s, color 0.2s; }
.ib:hover, .ib:active { background: var(--accent-soft); color: var(--accent); transform: none; box-shadow: none; }
.ib .ic { width: 20px; height: 20px; }
.theme-btn .th-sun { display: none; }
:root[data-theme="dark"] .theme-btn .th-sun { display: block; }
:root[data-theme="dark"] .theme-btn .th-moon { display: none; }

/* Pastille de site : initiale en secours, favicône par-dessus */
.fav { position: relative; flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; overflow: hidden; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--border); }
.fav-l { font: 700 0.72rem/1 var(--font-head); color: var(--accent); }
.fav img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 5px; object-fit: contain; background: var(--s-surface); }

/* ---------- Barre de recherche ---------- */
.sb { position: relative; display: flex; align-items: center; width: 100%; background: var(--s-glass); -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%); border: 1px solid var(--border-strong); border-radius: 999px; box-shadow: var(--shadow-sm); transition: box-shadow 0.25s var(--ease), border-color 0.25s; }
.sb::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 2px; background: conic-gradient(from var(--ang), #5b4fe0, #22c3ee, #a47bff, #3b82f0, #5b4fe0); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; opacity: 0; transition: opacity 0.3s; pointer-events: none; animation: ring-spin 5s linear infinite; }
.sb:hover { box-shadow: var(--shadow-md); }
.sb:focus-within { border-color: transparent; box-shadow: 0 0 0 5px var(--accent-soft), 0 14px 40px rgba(91, 79, 224, 0.22); }
.sb:focus-within::before { opacity: 1; }
.sb.open { z-index: 22; }
@keyframes ring-spin { to { --ang: 360deg; } }
.sb-ico { margin-left: 18px; stroke: var(--text-dim); stroke-width: 2; width: 20px; height: 20px; }
.sb-in { flex: 1; min-width: 0; height: 48px; padding: 0 12px; border: 0; background: transparent; outline: 0; font: 500 1rem/1 var(--font); color: var(--text); -webkit-appearance: none; appearance: none; }
.sb-in::placeholder { color: var(--text-dim); opacity: 0.75; font-weight: 400; }
.sb-in::-webkit-search-cancel-button { -webkit-appearance: none; }
.sb .sb-in, .sb .sb-in:focus { border: 0 !important; box-shadow: none; background: transparent !important; transition: none; }
.sb-go { flex: none; margin: 5px; height: 38px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--grad); color: #fff; font: 600 0.9rem/1 var(--font); cursor: pointer; transition: transform 0.15s var(--ease), box-shadow 0.2s; }
.sb-go:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(91, 79, 224, 0.35); }
.sb-sugg { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; right: 0; max-height: min(70vh, 460px); overflow-y: auto; margin: 0; padding: 8px; list-style: none; background: var(--s-surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop 0.16s var(--ease) both; }
.sb-sugg[hidden] { display: none; }
.sb-sugg li { display: flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 14px; cursor: pointer; font-size: 0.97rem; color: var(--text); text-align: left; }
.sb-sugg li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-sugg li b { font-weight: 650; }
.sb-sugg li:hover, .sb-sugg li.on { background: var(--accent-soft); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.99); } }
.sb-scrim { position: fixed; inset: 0; z-index: 18; background: var(--s-scrim); animation: fade 0.2s both; }
@keyframes fade { from { opacity: 0; } }

/* Barre de progression à l'envoi d'une recherche */
.top-prog { position: fixed; z-index: 90; top: 0; left: 0; height: 3px; width: 100%; background: var(--grad); transform-origin: left; animation: prog 8s cubic-bezier(0.1, 0.6, 0.2, 1) forwards; }
@keyframes prog { from { transform: scaleX(0); } to { transform: scaleX(0.92); } }

/* ---------- Accueil ---------- */
.home-body { min-height: 100vh; }
.home-top { display: flex; justify-content: flex-end; padding: 18px 28px; }
.home-top nav { display: flex; align-items: center; gap: 6px; }
.home-top a { padding: 9px 14px; border-radius: 999px; color: var(--text-dim); text-decoration: none; font-size: 0.92rem; font-weight: 500; transition: color 0.2s, background 0.2s; }
.home-top a:hover { color: var(--accent); background: var(--s-glass); }
.home-top a.nav-pill { color: var(--accent); border: 1px solid var(--border-strong); background: var(--s-glass); }
.home-top a.nav-pill:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.home-main { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; max-width: 720px; min-height: 66vh; margin: 0 auto; padding: 0 20px 4vh; text-align: center; }
.home-logo { margin: 0 0 34px; line-height: 0; animation: rise 0.7s var(--ease) both; }
.home-logo img { width: min(340px, 74vw); height: auto; }
.sb-home { animation: rise 0.7s 0.08s var(--ease) both; box-shadow: var(--shadow-md); }
.sb-home .sb-in { height: 60px; font-size: 1.1rem; }
.sb-home .sb-ico { margin-left: 24px; width: 22px; height: 22px; }
.sb-home .sb-go { height: 46px; margin: 6px; padding: 0 28px; }
.home-privacy { display: inline-flex; align-items: center; gap: 7px; margin: 22px 0 0; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--s-glass); font-size: 0.84rem; color: var(--text-dim); animation: rise 0.7s 0.16s var(--ease) both; }
.home-privacy .ic { color: var(--ok); }
.home-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; animation: rise 0.7s 0.22s var(--ease) both; }
.home-chips a { padding: 8px 15px; border: 1px solid var(--border); border-radius: 999px; background: var(--s-glass); color: var(--text-dim); text-decoration: none; font-size: 0.88rem; transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease); }
.home-chips a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.home-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; width: 100%; max-width: 900px; margin: 0 auto; padding: 56px 24px 72px; text-align: center; }
.home-points > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.home-points .pt-ic { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 6px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); font-size: 1.3rem; }
.home-points b { font: 700 1rem/1.3 var(--font-head); }
.home-points > div > span:last-child { max-width: 250px; font-size: 0.9rem; line-height: 1.55; color: var(--text-dim); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Pied de page ---------- */
.sr-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: auto; padding: 18px 28px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--s-glass); font-size: 0.82rem; color: var(--text-dim); }
.sr-foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.sr-foot a { color: var(--text-dim); text-decoration: none; }
.sr-foot a:hover { color: var(--accent); }

/* ---------- Résultats : en-tête ---------- */
.sr-top { view-transition-name: sr-top; position: sticky; top: 0; z-index: 20; background: var(--s-header); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); border-bottom: 1px solid var(--border); }
.sr-bar { display: flex; align-items: center; gap: 28px; max-width: 1180px; margin: 0 auto; padding: 14px 28px 8px; }
.sr-brand { flex: none; line-height: 0; }
.sr-brand img { width: 104px; height: auto; }
.sr-bar .sb { max-width: 680px; }
.sr-bar .sb-in { height: 44px; }
.sr-bar .sb-go { height: 34px; padding: 0 16px; font-size: 0.85rem; }
.sr-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.sr-nav a { padding: 9px 14px; border-radius: 999px; color: var(--text-dim); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.sr-nav a:hover { color: var(--accent); background: var(--accent-soft); }
.sr-tabs { display: flex; gap: 2px; max-width: 1180px; margin: 0 auto; padding: 0 22px; overflow-x: auto; scrollbar-width: none; }
.sr-tabs::-webkit-scrollbar { display: none; }
.sr-tabs a { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px 12px; color: var(--text-dim); text-decoration: none; font-size: 0.92rem; font-weight: 550; transition: color 0.2s; }
.sr-tabs a:hover { color: var(--text); }
.sr-tabs a.on { color: var(--accent); }
.sr-tabs a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); view-transition-name: tab-ind; }
::view-transition-group(tab-ind) { animation-duration: 0.3s; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; }

/* ---------- Résultats : corps ---------- */
.sr-main { flex: 1; display: grid; grid-template-columns: minmax(0, 680px) 360px; grid-template-areas: "ans side" "col side"; grid-template-rows: auto 1fr; justify-content: start; column-gap: 56px; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 28px 56px; }
.sr-main.wide { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ans" "col"; }
.ans-slot { grid-area: ans; min-width: 0; }
.sr-col { grid-area: col; min-width: 0; }
.side { grid-area: side; min-width: 0; }
.sr-msg { padding: 36px 24px; text-align: center; background: var(--s-surface); border: 1px solid var(--border); border-radius: 20px; }
.sr-msg h2 { margin: 0 0 8px; font-size: 1.2rem; }
.sr-msg p { margin: 0; color: var(--text-dim); }

.res { display: flex; gap: 16px; margin: 0 -16px 8px; padding: 14px 16px; border-radius: 18px; transition: background 0.2s; animation: rise 0.45s calc(var(--i, 0) * 32ms) var(--ease) both; }
.res:hover { background: var(--s-hover); }
.res-body { flex: 1; min-width: 0; }
.res-site { display: flex; align-items: center; gap: 10px; margin: 0 0 7px; font-size: 0.84rem; line-height: 1.2; color: var(--text-dim); }
.res-name { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.res-crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res h3 { margin: 0 0 6px; font: 600 1.2rem/1.35 var(--font-head); letter-spacing: -0.01em; }
.res h3 a { color: var(--s-link); text-decoration: none; overflow-wrap: anywhere; }
.res h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.res h3 a:visited { color: var(--s-visited); }
.res-snip { margin: 0; font-size: 0.94rem; line-height: 1.6; color: var(--s-snip); overflow-wrap: anywhere; }
.res-snip b { font-weight: 650; color: var(--text); }
.res-date { color: var(--text-dim); }
.res-th { flex: none; align-self: flex-start; width: 112px; height: 84px; object-fit: cover; border-radius: 14px; background: var(--bg-soft); }

.inst { margin: 0 0 22px; padding: 14px 18px; background: var(--s-surface); border: 1px solid var(--border); border-radius: 16px; font-size: 1rem; font-weight: 550; box-shadow: var(--shadow-sm); }

/* ---------- Réponse de Soelya ---------- */
.ans { --b: var(--grad); position: relative; margin: 0 0 26px; padding: 18px 20px 16px; background: linear-gradient(var(--s-surface), var(--s-surface)) padding-box, var(--b) border-box; border: 1.5px solid transparent; border-radius: 22px; box-shadow: var(--shadow-md); animation: rise 0.5s var(--ease) both; }
.ans.busy { --b: conic-gradient(from var(--ang), #5b4fe0, #22c3ee, #a47bff, #3b82f0, #5b4fe0); animation: rise 0.5s var(--ease) both, ring-spin 3s linear infinite; }
.ans-handle, .ans-x { display: none; }
.ans-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; font: 700 0.92rem/1 var(--font-head); }
.ans-mark { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); }
.ans.busy .ans-mark::after { content: ""; position: absolute; inset: -3px; border-radius: 12px; border: 2px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent-2); animation: spin 0.9s linear infinite; }
.ans.busy .ans-mark img { animation: breathe 1.6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(0.82); opacity: 0.7; } }
.ans-state { margin-left: auto; font: 500 0.8rem/1 var(--font); color: var(--text-dim); }
.ans-src { display: flex; gap: 8px; margin: 0 0 14px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.ans-src::-webkit-scrollbar { display: none; }
.ans-src[hidden], .ans-foot[hidden], .ans-ask[hidden], .ans-skel[hidden], .ans-more[hidden] { display: none; }
.ans-src a { flex: none; display: inline-flex; align-items: center; gap: 7px; max-width: 220px; padding: 5px 12px 5px 5px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft); color: var(--text-dim); text-decoration: none; font-size: 0.8rem; transition: border-color 0.2s, color 0.2s, transform 0.2s var(--ease); animation: rise 0.35s calc(var(--i, 0) * 50ms) var(--ease) both; }
.ans-src a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.ans-src .fav { width: 22px; height: 22px; }
.ans-src .fav img { padding: 3px; }
.ans-src span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ans-skel { display: grid; gap: 10px; padding: 4px 0 6px; }
.ans-skel i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(100deg, var(--s-skel-a) 30%, var(--s-skel-b) 50%, var(--s-skel-a) 70%) 0 0 / 220% 100%; animation: shimmer 1.4s linear infinite; }
.ans-skel i:nth-child(1) { width: 92%; } .ans-skel i:nth-child(2) { width: 100%; } .ans-skel i:nth-child(3) { width: 64%; }
@keyframes shimmer { to { background-position: -220% 0; } }
.ans-clip { position: relative; overflow: hidden; transition: max-height 0.35s var(--ease); }
.ans-clip.clamp { max-height: 300px; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.ans-body:empty { display: none; }
.ans-body .md { font-size: 0.98rem; line-height: 1.65; }
.ans-body .md p { margin: 0 0 0.75em; }
.ans-body .md h1, .ans-body .md h2, .ans-body .md h3 { font-size: 1.04rem; margin: 1em 0 0.4em; }
.ans-body .md table { display: block; overflow-x: auto; }
.ans-body.typing .md > :last-child::after { content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 3px; vertical-align: -0.16em; border-radius: 2px; background: var(--accent); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.ans-fail { margin: 0; color: var(--text-dim); }
.ans-more { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 8px 16px; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; color: var(--accent); box-shadow: none; font: 600 0.86rem/1 var(--font); }
.ans-more:hover { background: var(--accent-soft); color: var(--accent); transform: none; box-shadow: none; }
.ans-more .ic { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.ans-more[aria-expanded="true"] .ic { transform: rotate(180deg); }
.ans-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-dim); }
.ans-ask { display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; padding: 11px 18px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--accent-soft); color: var(--accent); box-shadow: none; font: 600 0.88rem/1 var(--font); }
.ans-ask:hover { background: var(--accent); color: #fff; transform: none; box-shadow: none; }
.cite-tip { position: fixed; z-index: 70; max-width: 280px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--s-surface); box-shadow: var(--shadow-lg); font-size: 0.82rem; line-height: 1.35; pointer-events: none; animation: pop 0.14s var(--ease) both; }
.cite-tip b { display: block; margin-bottom: 3px; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cite-tip span { color: var(--text-dim); }

/* ---------- Texte formaté (réponse IA) ---------- */
.md { overflow-wrap: anywhere; }
.md > *:first-child { margin-top: 0; } .md > *:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 0.75em; padding-left: 1.4em; }
.md li { margin: 0.2em 0; } .md li::marker { color: var(--accent); }
.md a { color: var(--accent); text-underline-offset: 2px; }
.md strong { font-weight: 650; }
.md blockquote { margin: 0 0 0.75em; padding: 2px 0 2px 14px; border-left: 3px solid var(--accent); color: var(--text-dim); }
.md code.inline { padding: 0.1em 0.4em; border-radius: 6px; background: var(--accent-soft); font-size: 0.88em; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.md pre { overflow-x: auto; padding: 12px 14px; border-radius: 12px; background: var(--bg-soft); font-size: 0.85em; }
.md th, .md td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.md table { border-collapse: collapse; font-size: 0.92em; }
.md .cite { border: 0; cursor: pointer; }

/* ---------- Images ---------- */
.imgs { columns: 5 190px; column-gap: 14px; }
.img-card { display: block; break-inside: avoid; margin: 0 0 16px; color: inherit; text-decoration: none; }
.img-frame { display: block; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: linear-gradient(100deg, var(--s-skel-a) 30%, var(--s-skel-b) 50%, var(--s-skel-a) 70%) 0 0 / 220% 100%; animation: shimmer 1.6s linear infinite; }
.img-frame img { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--bg-soft); transition: transform 0.4s var(--ease); }
.img-card:hover .img-frame img { transform: scale(1.05); }
.img-card:hover .img-frame { box-shadow: var(--shadow-md); }
.img-cap { display: block; padding: 7px 4px 0; }
.img-cap b { font: 550 0.8rem/1.3 var(--font); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.img-cap i { display: block; font-style: normal; font-size: 0.74rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lb { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: 1fr auto; padding: 18px; background: rgba(4, 5, 20, 0.93); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #eceeff; animation: fade 0.2s both; touch-action: pan-y; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; }
.lb-img { max-width: min(94vw, 1500px); max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 12px; box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6); transition: opacity 0.25s; }
.lb-img.loading { opacity: 0.25; }
.lb-spin { position: absolute; width: 36px; height: 36px; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
.lb-spin[hidden] { display: none; }
.lb-cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; padding: 14px 8px calc(4px + env(safe-area-inset-bottom)); text-align: center; }
.lb-cap b { max-width: min(80vw, 760px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 0.95rem/1.3 var(--font); }
.lb-cap span { font-size: 0.82rem; color: #a4aad8; }
.lb-cap a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: 999px; background: var(--grad); color: #fff; text-decoration: none; font: 600 0.86rem/1 var(--font); }
.lb .ib { position: absolute; color: #eceeff; background: rgba(255, 255, 255, 0.1); z-index: 2; width: 46px; height: 46px; }
.lb .ib:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
.lb-x { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb .lb-prev:hover, .lb .lb-next:hover { transform: translateY(-50%); }

/* ---------- Vidéos ---------- */
.vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 26px 20px; }
.vid { min-width: 0; animation: rise 0.45s calc(var(--i, 0) * 32ms) var(--ease) both; }
.vid-th { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: var(--bg-soft); border: 1px solid var(--border); transition: box-shadow 0.25s, transform 0.25s var(--ease); }
.vid:hover .vid-th { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.vid-th img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s var(--ease); }
.vid:hover .vid-th img { transform: scale(1.04); }
.vid-play { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(transparent 55%, rgba(6, 8, 30, 0.45)); opacity: 0; transition: opacity 0.2s; }
.vid-play svg { width: 54px; height: 54px; padding: 15px 13px 15px 17px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); fill: #3b35b8; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.vid:hover .vid-play { opacity: 1; }
.vid-th.noimg { background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft)); }
.vid-th.noimg .vid-play { opacity: 1; background: none; }
.vid-len { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 7px; background: rgba(10, 12, 40, 0.84); color: #fff; font: 600 0.72rem/1.5 var(--font); }
.vid-tx { padding-top: 10px; }
.vid h3 { margin: 0 0 6px; font: 600 1rem/1.35 var(--font-head); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vid h3 a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.vid h3 a:hover { color: var(--accent); }
.vid-meta { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.8rem; color: var(--text-dim); }
.vid-meta .fav { width: 22px; height: 22px; }
.vid-meta .fav img { padding: 3px; }
.vid-meta span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-main.wide .res { max-width: 840px; }

/* ---------- Pagination, associées ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 30px 0 10px; font-size: 0.92rem; color: var(--text-dim); }
.pager a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 20px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--s-surface); color: var(--accent); text-decoration: none; font-weight: 600; transition: background 0.2s, color 0.2s, transform 0.2s var(--ease); }
.pager a:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-1px); }
.related { margin-top: 26px; }
.related h2 { margin: 0 0 10px; font-size: 1.05rem; }
.related-list { display: flex; flex-wrap: wrap; gap: 8px; }
.related-list a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--s-surface); color: var(--text); text-decoration: none; font-size: 0.88rem; }
.related-list a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Panneau latéral ---------- */
.side-in { position: sticky; top: 132px; display: grid; gap: 18px; max-height: calc(100vh - 150px); overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.info { overflow: hidden; background: var(--s-surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-sm); animation: rise 0.5s 0.1s var(--ease) both; }
.info-img { display: block; width: 100%; max-height: 230px; object-fit: cover; background: var(--bg-soft); }
.info-body { padding: 18px 20px 20px; }
.info h2 { margin: 0 0 8px; font-size: 1.3rem; }
.info p { margin: 0 0 14px; font-size: 0.92rem; line-height: 1.62; color: var(--s-snip); }
.facts { margin: 0 0 14px; padding: 4px 0 0; border-top: 1px solid var(--border); }
.facts > div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.86rem; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--text-dim); }
.facts dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.info-links { display: flex; flex-wrap: wrap; gap: 8px; }
.info-links a { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; padding: 5px 14px 5px 6px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text); text-decoration: none; font-size: 0.86rem; font-weight: 550; transition: border-color 0.2s, color 0.2s; }
.info-links a:hover { border-color: var(--accent); color: var(--accent); }
.info-links .fav { width: 26px; height: 26px; }
.info-links a span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-side { padding: 18px 8px 8px 20px; background: var(--s-surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-sm); animation: rise 0.5s 0.18s var(--ease) both; }
.related-side h2 { margin: 0 0 8px; font-size: 1rem; }
.related-side ul { margin: 0; padding: 0; list-style: none; }
.related-side a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px 6px 0; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 0.92rem; transition: color 0.2s; }
.related-side a .ic { color: var(--text-dim); width: 16px; height: 16px; }
.related-side a:hover { color: var(--accent); }
.related-side a:hover .ic { color: var(--accent); }

/* ---------- Tablette et mobile ---------- */
@media (max-width: 1000px) {
  .sr-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; grid-template-rows: none; align-content: start; gap: 0; }
  .ans-slot, .sr-col, .side, .side-in { grid-area: auto; display: contents; }
  .ans-slot { display: block; order: 1; }
  .info { order: 2; margin-bottom: 22px; }
  .sr-col { display: block; order: 3; }
  .related-side { order: 4; margin-top: 22px; }
  .side-in { position: static; max-height: none; overflow: visible; padding: 0; }
  .res { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 720px) {
  .home-top { padding: 12px 14px; }
  .home-main { justify-content: flex-start; min-height: 0; padding-top: 8vh; padding-bottom: 0; }
  .home-logo { margin-bottom: 26px; }
  .home-points { grid-template-columns: 1fr; gap: 26px; padding: 44px 24px 52px; }
  .sb-home .sb-go { display: none; }
  .sb-home .sb-in { padding-right: 18px; font-size: 1rem; }
  .sb-home .sb-ico { margin-left: 18px; }
  .sb-in { height: 52px; font-size: 1rem; }

  .sr-top { top: -56px; }
  .sr-bar { flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 0 14px 8px; }
  .sr-brand { display: flex; align-items: center; height: 50px; }
  .sr-brand img { width: 92px; }
  .sr-nav { margin-left: auto; height: 50px; }
  .sr-bar .sb { order: 3; max-width: none; flex: 1 0 100%; }
  .sr-bar .sb-go { display: none; }
  .sr-bar .sb-in { height: 48px; padding-right: 16px; }
  .sr-tabs { padding: 0 6px; gap: 0; }
  .sr-tabs a { min-height: 46px; padding: 0 13px; }
  .sr-tabs a.on::after { left: 10px; right: 10px; }
  .sb-sugg { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); }

  .sr-main { padding: 14px 14px calc(36px + env(safe-area-inset-bottom)); }
  .res h3 { font-size: 1.1rem; }
  .res { gap: 12px; margin-bottom: 4px; }
  .res-th { width: 88px; height: 66px; }
  .vids { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .imgs { columns: 2 140px; column-gap: 10px; }
  .ans { padding: 16px 16px 14px; }
  .sr-foot { padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); }
  .lb { padding: 10px; }
  .lb-prev, .lb-next { top: auto; bottom: calc(86px + env(safe-area-inset-bottom)); transform: none; }
  .lb .lb-prev:hover, .lb .lb-next:hover { transform: none; }
  .lb-prev { left: 10px; } .lb-next { right: 10px; }

  /* La réponse de Soelya s'ouvre comme une feuille qui monte du bas de l'écran. */
  .ans.sheet { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 90vh; max-height: 90dvh; margin: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; transform: translateY(105%); transition: transform 0.34s var(--ease); animation: none; box-shadow: 0 -12px 60px rgba(0, 0, 0, 0.35); }
  .ans.sheet.in { transform: none; }
  .ans.sheet .ans-handle { display: block; width: 44px; height: 5px; margin: 2px auto 12px; border-radius: 3px; background: var(--border-strong); touch-action: none; }
  .ans.sheet .ans-x { display: inline-grid; margin: -6px -8px -6px 0; }
  .ans.sheet .ans-state { margin-left: auto; margin-right: 4px; }
  .ans.sheet .ans-clip.clamp { max-height: none; -webkit-mask-image: none; mask-image: none; }
  .ans.sheet .ans-more { display: none; }
  .sheet-scrim { position: fixed; inset: 0; z-index: 59; background: var(--s-scrim); background-color: rgba(4, 5, 20, 0.55); animation: fade 0.25s both; }
  body.lock { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  @view-transition { navigation: none; }
}
