/* ==========================================================================
   AudiVid Theme — Textes durs, Documents, Autres, mots-clés, recherche
   Vues : resources/views/library/*  ·  Script : js/audivid.library.js
   ========================================================================== */

/* Police de lecture (articles) */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&display=swap');

:root { --av-font-reading: 'Source Serif 4', Georgia, 'Times New Roman', serif; }

/* ==========================================================================
   Éléments communs
   ========================================================================== */

/* Barre filtres + recherche */
.av-libbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--av-space-5);
}
.av-chips {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.av-chips::-webkit-scrollbar { display: none; }
.av-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 38px;
  padding: 0 .95rem;
  border: 1px solid var(--av-border);
  border-radius: 999px;
  background: var(--av-surface);
  color: var(--av-text-soft);
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color var(--av-dur-fast), background var(--av-dur-fast), color var(--av-dur-fast);
}
.av-chip span { font-size: .75rem; color: var(--av-text-muted); }
.av-chip:hover { border-color: var(--av-steel-700); color: var(--av-text); text-decoration: none; }
.av-chip.is-active { background: var(--av-text); border-color: var(--av-text); color: var(--av-bg); }
.av-chip.is-active span { color: inherit; opacity: .7; }

.av-libsearch {
  position: relative;
  flex: 0 1 300px;
  min-width: 200px;
}
.av-libsearch i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--av-text-muted); font-size: .85rem; }
.av-libsearch input {
  width: 100%;
  height: 40px;
  padding: 0 1rem 0 2.4rem;
  border: 1px solid var(--av-border);
  border-radius: 999px;
  background: var(--av-surface);
  color: var(--av-text);
  font: inherit;
  font-size: .9rem;
}
.av-libsearch input:focus { outline: none; border-color: var(--av-primary); box-shadow: var(--av-ring); }
@media (max-width: 767px) { .av-libsearch { flex-basis: 100%; } }

.av-libresult { margin: 0 0 var(--av-space-4); color: var(--av-text-muted); font-size: .9rem; }
.av-libresult a { font-weight: 600; }

/* Mots-clés */
.av-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.av-tags a, .av-tags__more {
  display: inline-block;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: var(--av-surface-2);
  color: var(--av-text-soft);
  font-size: .8rem;
  font-weight: 500;
  text-decoration: none;
}
.av-tags a:hover { background: var(--av-primary-soft); color: var(--av-primary-hover); text-decoration: none; }
.av-tags--sm a, .av-tags--sm .av-tags__more { padding: .15rem .5rem; font-size: .72rem; }
.av-tags--lg a { padding: .45rem .95rem; font-size: .9rem; }
.av-tags__more { color: var(--av-text-muted); }
.av-hashtag { font-weight: 600; color: var(--av-link); }

/* Encadrés de côté */
.av-sidebox { padding: 1.25rem; border: 1px solid var(--av-border); border-radius: 14px; background: var(--av-surface); }
.av-sidebox + .av-sidebox { margin-top: 1rem; }
.av-sidebox__title { margin: 0 0 1rem; font-family: var(--av-font-body); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--av-text-muted); }
.av-sidebox--cta { text-align: center; background: linear-gradient(160deg, var(--av-primary-soft), transparent 70%), var(--av-surface); }
.av-sidebox--cta > i { font-size: 1.6rem; color: var(--av-primary); margin-bottom: .75rem; }
.av-sidebox--cta .av-sidebox__title { color: var(--av-text); font-size: 1rem; letter-spacing: 0; text-transform: none; }
.av-sidebox--cta p { color: var(--av-text-muted); font-size: .9rem; }
.av-sidebox--inline { margin: var(--av-space-6) 0; }

/* Auteur / propriétaire */
.av-owner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; }
.av-owner form { margin: 0; }
.av-owner__del { color: var(--av-danger) !important; }
.av-gavatar--lg { --_size: 64px; }

/* Réactions + commentaires */
.av-reactions { margin-top: var(--av-space-6); }
.av-reactions__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem 1rem;
  padding: .6rem 0;
  border-top: 1px solid var(--av-border);
  border-bottom: 1px solid var(--av-border);
}
.av-reactions__bar form { margin: 0; }
.av-reactions__bar > .av-gaction:first-of-type,
.av-reactions__bar > form:first-child { margin-left: -.5rem; }
.av-reactions__count { font-size: .9rem; color: var(--av-text-muted); }
.av-reactions__count strong { color: var(--av-text); }
.av-reactions__share { display: flex; gap: .35rem; margin-left: auto; }
.av-reactions__share a {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--av-surface-2); color: var(--av-text-soft); text-decoration: none;
}
.av-reactions__share a:hover { background: var(--av-primary); color: #fff; }
.av-reactions__title { margin: var(--av-space-5) 0 1rem; font-family: var(--av-font-body); font-size: 1.1rem; font-weight: 700; }
.av-reactions__form { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1.5rem; }
.av-reactions__form textarea {
  flex: 1; min-width: 0; min-height: 46px; padding: .7rem .9rem;
  border: 1px solid var(--av-border); border-radius: 12px; background: var(--av-surface);
  color: var(--av-text); font: inherit; resize: vertical;
}
.av-reactions__form textarea:focus { outline: none; border-color: var(--av-primary); box-shadow: var(--av-ring); }
.av-reactions__form .av-btn { height: 46px; }
.av-reactions__list { display: grid; gap: 1.1rem; }
.av-reactions__empty, .av-reactions__login { color: var(--av-text-muted); }
.av-reactions__login a { font-weight: 700; }
@media (max-width: 575px) {
  .av-reactions__share { margin-left: 0; width: 100%; }
  .av-reactions__form { flex-wrap: wrap; }
  .av-reactions__form .av-gavatar { display: none; }
  .av-reactions__form .av-btn { width: 100%; }
}

/* Contenus liés */
.av-related { margin: var(--av-space-7) 0; padding-top: var(--av-space-5); border-top: 1px solid var(--av-border-soft); }
.av-related__title { margin: 0 0 var(--av-space-4); font-size: 1.15rem; }

/* ==========================================================================
   Textes durs
   ========================================================================== */
.av-tcard { display: grid; gap: 1rem; }
.av-tcard__media { display: block; overflow: hidden; border-radius: 12px; background: var(--av-surface-2); aspect-ratio: 16 / 9; }
.av-tcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--av-ease); }
.av-tcard:hover .av-tcard__media img { transform: scale(1.03); }
.av-tcard__placeholder {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: radial-gradient(120% 120% at 0% 0%, rgba(238, 28, 37, .25), transparent 60%), var(--av-surface-2);
  color: var(--av-text-muted); font-size: 1.8rem;
}
.av-tcard__body { min-width: 0; }
.av-tcard__cat {
  display: inline-block; margin-bottom: .45rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--av-primary);
}
.av-tcard__title { margin: 0 0 .5rem; font-family: var(--av-font-reading); font-size: 1.2rem; font-weight: 700; line-height: 1.3; letter-spacing: -.005em; }
.av-tcard__title a { color: var(--av-text); }
.av-tcard__title a:hover { color: var(--av-primary-hover); text-decoration: none; }
.av-tcard__excerpt { margin: 0 0 .6rem; color: var(--av-text-soft); font-size: .95rem; line-height: 1.6; }
.av-tcard__meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin: 0; color: var(--av-text-muted); font-size: .8rem; }
.av-tcard__meta span:first-child { color: var(--av-text-soft); font-weight: 600; }

/* Ligne de liste */
.av-tcard--row { grid-template-columns: 1fr; padding: 1.4rem 0; border-bottom: 1px solid var(--av-border-soft); }
.av-tcard--row:first-child { padding-top: 0; }
@media (min-width: 640px) {
  .av-tcard--row { grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }
}

/* À la une */
.av-tfeatured { margin-bottom: var(--av-space-6); }
.av-tcard--hero { gap: 1.5rem; padding-bottom: var(--av-space-6); border-bottom: 1px solid var(--av-border); }
.av-tcard--hero .av-tcard__title { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.5rem); line-height: 1.15; }
.av-tcard--hero .av-tcard__excerpt { font-family: var(--av-font-reading); font-size: 1.1rem; }
@media (min-width: 900px) {
  .av-tcard--hero { grid-template-columns: 1.35fr 1fr; align-items: center; gap: 2.5rem; }
  .av-tcard--hero .av-tcard__media { aspect-ratio: 4 / 3; }
}

/* Mise en page liste + colonne */
.av-tlayout { display: grid; gap: var(--av-space-6); margin-bottom: var(--av-space-7); }
@media (min-width: 992px) { .av-tlayout { grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; } }
.av-tlayout__side { align-self: start; }
@media (min-width: 992px) { .av-tlayout__side { position: sticky; top: calc(var(--av-nav-h) + 1rem); } }

.av-toplist { margin: 0; padding: 0; list-style: none; counter-reset: top; display: grid; gap: 1rem; }
.av-toplist li { display: grid; grid-template-columns: 2rem 1fr; gap: .1rem .5rem; counter-increment: top; }
.av-toplist li::before {
  content: counter(top); grid-row: span 2;
  font-family: var(--av-font-reading); font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--av-primary);
}
.av-toplist a { font-family: var(--av-font-reading); font-weight: 600; line-height: 1.35; color: var(--av-text); }
.av-toplist span { font-size: .75rem; color: var(--av-text-muted); }

/* Grille de cartes */
.av-tgrid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

/* ---------- Article ---------- */
.av-readprogress { position: fixed; inset: 0 0 auto 0; z-index: 1100; height: 3px; pointer-events: none; }
.av-readprogress span { display: block; height: 100%; background: var(--av-primary); transform: scaleX(0); transform-origin: left; }

.av-article { max-width: 1040px; margin: 0 auto var(--av-space-6); }
.av-article__head { max-width: 760px; margin: var(--av-space-5) auto var(--av-space-6); text-align: center; }
.av-article__head .av-breadcrumb { justify-content: center; margin-bottom: 1.5rem; }
.av-article__cat {
  display: inline-block; margin-bottom: 1rem; padding: .3rem .8rem; border-radius: 999px;
  background: var(--av-primary-soft); color: var(--av-primary-hover);
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.av-article__title {
  margin: 0 0 1rem;
  font-family: var(--av-font-reading);
  font-size: clamp(1.9rem, 1.2rem + 2.8vw, 3.1rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.015em;
}
.av-article__lead { margin: 0 auto 1.5rem; max-width: 640px; font-family: var(--av-font-reading); font-size: 1.2rem; line-height: 1.55; color: var(--av-text-soft); }
.av-article__meta { display: inline-flex; align-items: center; gap: .75rem; text-align: left; }
.av-article__meta > div { display: grid; line-height: 1.35; }
.av-article__author { font-weight: 700; color: var(--av-text); }
.av-article__meta span { font-size: .85rem; color: var(--av-text-muted); }
.av-article__head .av-owner { justify-content: center; }
.av-article__cover { margin: 0 0 var(--av-space-6); overflow: hidden; border-radius: 16px; background: var(--av-surface-2); }
.av-article__cover img { display: block; width: 100%; max-height: 640px; object-fit: cover; }
.av-article__body, .av-article__foot { max-width: 700px; margin-inline: auto; }
.av-article__foot { margin-top: var(--av-space-6); }

/* Typographie de lecture (article + éditeur) */
.av-reading { font-family: var(--av-font-reading); font-size: 1.15rem; line-height: 1.8; color: var(--av-text); overflow-wrap: break-word; }
.av-reading > * + * { margin-top: 1.25em; }
.av-reading p { margin: 0; }
.av-reading p + p { margin-top: 1.1em; }
.av-reading h2 { margin: 2em 0 .6em; font-family: var(--av-font-reading); font-size: 1.65rem; font-weight: 700; line-height: 1.25; }
.av-reading h3 { margin: 1.7em 0 .5em; font-family: var(--av-font-reading); font-size: 1.3rem; font-weight: 700; }
.av-reading a { color: var(--av-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.av-reading blockquote {
  margin: 1.8em 0; padding: .2em 0 .2em 1.4em; border-left: 3px solid var(--av-primary);
  font-size: 1.3rem; font-style: italic; line-height: 1.55; color: var(--av-text-soft);
}
.av-reading ul, .av-reading ol { padding-left: 1.4em; }
.av-reading li + li { margin-top: .4em; }
.av-reading img { display: block; max-width: 100%; height: auto; margin: 2em auto; border-radius: 10px; }
.av-reading iframe, .av-reading .ql-video { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; margin: 2em 0; border: 0; border-radius: 10px; }
.av-reading pre { padding: 1rem; overflow-x: auto; border-radius: 10px; background: var(--av-surface-2); font-size: .9rem; }
.av-reading .ql-align-center { text-align: center; }
.av-reading .ql-align-right { text-align: right; }
.av-reading .ql-align-justify { text-align: justify; }
.av-reading .ql-indent-1 { padding-left: 2em; }
.av-reading .ql-indent-2 { padding-left: 4em; }
.av-article__body > p:first-child::first-letter {
  float: left; margin: .08em .1em 0 0;
  font-size: 3.6em; font-weight: 700; line-height: .85; color: var(--av-primary);
}
@media (max-width: 575px) { .av-reading { font-size: 1.08rem; line-height: 1.75; } }

.av-authorbox {
  display: flex; align-items: center; gap: 1rem; margin-top: var(--av-space-5); padding: 1.25rem;
  border: 1px solid var(--av-border); border-radius: 14px; background: var(--av-surface);
}
.av-authorbox > div { display: grid; gap: .1rem; }
.av-authorbox__label { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--av-text-muted); }
.av-authorbox strong { font-size: 1.1rem; }
.av-authorbox__role { font-size: .85rem; color: var(--av-text-muted); }
.av-authorbox__link { font-size: .85rem; font-weight: 600; }

/* ---------- Formulaires de rédaction ---------- */
.av-editorform__grid { display: grid; gap: var(--av-space-4); align-items: start; }
@media (min-width: 1100px) { .av-editorform__grid { grid-template-columns: minmax(0, 1fr) 340px; } }
.av-editorform__side { display: grid; gap: var(--av-space-4); }
.av-editorform__side .av-panel + .av-panel { margin-top: 0; }
@media (min-width: 1100px) { .av-editorform__side { position: sticky; top: calc(var(--av-nav-h) + 1rem); } }
.av-editorform__view { margin-top: .6rem; }
.av-panel__title--spaced { margin-top: var(--av-space-5); }
.av-panel--tip p { margin: 0; color: var(--av-text-muted); font-size: .9rem; line-height: 1.55; }

.av-editor-title, .av-editor-lead {
  display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--av-text); resize: none; overflow: hidden;
}
.av-editor-title { font-family: var(--av-font-reading); font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); font-weight: 700; line-height: 1.2; }
.av-editor-lead { margin: .75rem 0 1.25rem; font-family: var(--av-font-reading); font-size: 1.15rem; line-height: 1.5; color: var(--av-text-soft); }
.av-editor-title:focus, .av-editor-lead:focus { outline: none; }
.av-editor-title::placeholder, .av-editor-lead::placeholder { color: var(--av-text-muted); opacity: .7; }
.av-editor-title.is-invalid { box-shadow: inset 0 -2px 0 var(--av-danger); }
.av-editor-status { margin-top: .6rem; text-align: right; }

/* Habillage de l'éditeur Quill */
.av-editor .ql-toolbar.ql-snow {
  position: sticky; top: var(--av-nav-h); z-index: 5;
  border: 1px solid var(--av-border); border-radius: 12px 12px 0 0; background: var(--av-surface-2);
  font-family: var(--av-font-body);
}
.av-editor .ql-container.ql-snow { border: 1px solid var(--av-border); border-top: 0; border-radius: 0 0 12px 12px; background: var(--av-bg); font-family: var(--av-font-reading); }
.av-editor .ql-editor { min-height: 420px; padding: 1.5rem 1.25rem; font-size: 1.12rem; line-height: 1.8; }
.av-editor .ql-editor.ql-blank::before { left: 1.25rem; color: var(--av-text-muted); font-style: normal; }
.av-editor .ql-snow .ql-stroke { stroke: var(--av-text-soft); }
.av-editor .ql-snow .ql-fill { fill: var(--av-text-soft); }
.av-editor .ql-snow .ql-picker { color: var(--av-text-soft); }
.av-editor .ql-snow .ql-picker-options { background: var(--av-surface); border-color: var(--av-border); }
.av-editor .ql-snow button:hover .ql-stroke, .av-editor .ql-snow button.ql-active .ql-stroke,
.av-editor .ql-snow .ql-picker-label:hover .ql-stroke, .av-editor .ql-snow .ql-picker-label.ql-active .ql-stroke { stroke: var(--av-primary); }
.av-editor .ql-snow button:hover .ql-fill, .av-editor .ql-snow button.ql-active .ql-fill { fill: var(--av-primary); }
.av-editor .ql-snow .ql-picker-label:hover, .av-editor .ql-snow .ql-picker-label.ql-active,
.av-editor .ql-snow .ql-picker-item:hover, .av-editor .ql-snow .ql-picker-item.ql-selected { color: var(--av-primary); }
.av-editor .ql-snow .ql-tooltip { z-index: 10; background: var(--av-surface); border-color: var(--av-border); color: var(--av-text); box-shadow: var(--av-shadow); }
.av-editor .ql-snow .ql-tooltip input[type=text] { background: var(--av-bg); color: var(--av-text); border-color: var(--av-border); }
.av-editor .ql-editor h2 { font-size: 1.55rem; }
.av-editor .ql-editor h3 { font-size: 1.25rem; }
.av-editor .ql-editor blockquote { border-left: 3px solid var(--av-primary); padding-left: 1.2em; color: var(--av-text-soft); font-style: italic; }
.av-editor .ql-editor img { max-width: 100%; border-radius: 8px; }
.av-editor .ql-editor .ql-video { width: 100%; aspect-ratio: 16 / 9; height: auto; }

/* Choix d'état */
.av-segment { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 1.1rem; padding: 4px; border-radius: 12px; background: var(--av-bg); border: 1px solid var(--av-border); }
.av-segment label { margin: 0; cursor: pointer; }
.av-segment input { position: absolute; opacity: 0; pointer-events: none; }
.av-segment span { display: flex; align-items: center; justify-content: center; gap: .45rem; height: 40px; border-radius: 9px; font-size: .88rem; font-weight: 600; color: var(--av-text-muted); }
.av-segment input:checked + span { background: var(--av-surface-3); color: var(--av-text); box-shadow: var(--av-shadow-sm); }
.av-segment input:focus-visible + span { box-shadow: var(--av-ring); }

/* Image de couverture */
.av-coverpick {
  position: relative; display: block; overflow: hidden; margin: 0 0 .75rem; aspect-ratio: 16 / 9;
  border: 2px dashed var(--av-border); border-radius: 12px; cursor: pointer; background: var(--av-bg);
}
.av-coverpick:hover { border-color: var(--av-primary); }
.av-coverpick img { width: 100%; height: 100%; object-fit: cover; }
.av-coverpick img[hidden], .av-coverpick__empty[hidden] { display: none; }
.av-coverpick__empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .3rem; text-align: center; color: var(--av-text-muted); }
.av-coverpick__empty i { font-size: 1.6rem; }
.av-coverpick__empty strong { color: var(--av-text); font-size: .9rem; }
.av-coverpick__empty small { font-size: .75rem; }
.av-coverpick input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* Sélecteur de fichier */
.av-filepick {
  position: relative; display: grid; justify-items: center; gap: .35rem; margin: 0; padding: 2rem 1rem;
  border: 2px dashed var(--av-border); border-radius: 14px; background: var(--av-bg);
  text-align: center; cursor: pointer; transition: border-color var(--av-dur), background var(--av-dur);
}
.av-filepick:hover, .av-filepick.has-file { border-color: var(--av-primary); background: var(--av-primary-soft); }
.av-filepick > i { font-size: 2.2rem; color: var(--av-text-soft); margin-bottom: .25rem; }
.av-filepick strong { font-size: 1rem; }
.av-filepick small { max-width: 46ch; color: var(--av-text-muted); font-size: .8rem; line-height: 1.45; }
.av-filepick__name { margin-top: .35rem; font-size: .85rem; font-weight: 600; color: var(--av-primary-hover); }
.av-filepick__name:empty { display: none; }
.av-filepick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.av-filepick--sm { padding: 1rem; }
.av-filepick--sm > i { font-size: 1.3rem; }
.av-filepick--sm strong { font-size: .88rem; }

.av-switchrow { display: flex; gap: .75rem; align-items: flex-start; margin: 0 0 1.1rem; cursor: pointer; }
.av-switchrow input { flex: none; width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--av-primary); }
.av-switchrow span { display: grid; gap: .1rem; }
.av-switchrow strong { font-size: .9rem; }
.av-switchrow small { font-size: .78rem; color: var(--av-text-muted); }

/* ==========================================================================
   Documents : bibliothèque
   ========================================================================== */
.av-shelfsection { margin-bottom: var(--av-space-6); }
.av-shelfsection__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin: 0 0 1.25rem; font-family: var(--av-font-body); font-size: 1.05rem; font-weight: 700; }
.av-shelfsection__title i { color: var(--av-primary); }
.av-shelfsection__clear { font-size: .85rem; font-weight: 600; }

.av-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  column-gap: 0;
  row-gap: 2.25rem;
}
@media (min-width: 1100px) { .av-shelf { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 575px) { .av-shelf { grid-template-columns: repeat(2, 1fr); row-gap: 1.75rem; } }
.av-shelf--scroll { display: flex; overflow-x: auto; gap: 0; padding-bottom: .5rem; scroll-snap-type: x proximity; scrollbar-width: thin; }
.av-shelf--scroll .av-book { flex: 0 0 170px; scroll-snap-align: start; }

.av-book { position: relative; padding: 0 .9rem; min-width: 0; }
.av-book__stand { position: relative; }
.av-book__stand::after {   /* l'étagère, sous chaque couverture ; elles se rejoignent d'un livre à l'autre */
  content: "";
  position: absolute;
  left: -.9rem; right: -.9rem;
  bottom: -12px;
  height: 14px;
  background: linear-gradient(180deg, #4a2b1d 0%, #2d1a11 60%, #1b0f0a 100%);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .45);
  z-index: 0;
}
:root[data-theme="light"] .av-book__stand::after { background: linear-gradient(180deg, #c99b70 0%, #a87b52 60%, #8a613d 100%); box-shadow: 0 8px 14px rgba(60, 30, 10, .18); }
.av-book__cover {
  position: relative;
  z-index: 1;
  display: block;
  aspect-ratio: 1 / 1.414;
  overflow: hidden;
  border-radius: 2px 6px 6px 2px;
  background: hsl(var(--hue, 0), 45%, 22%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 6px 8px 18px rgba(0, 0, 0, .45);
  transform-origin: bottom center;
  transition: transform .35s var(--av-ease-out), box-shadow .35s;
}
.av-book__cover:hover { transform: translateY(-8px) rotate(-1deg); box-shadow: 10px 16px 28px rgba(0, 0, 0, .5); text-decoration: none; }
.av-book__cover img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.av-book__spine {
  position: absolute; inset: 0 auto 0 0; width: 9px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .35), rgba(255, 255, 255, .12) 45%, rgba(0, 0, 0, .15));
}
.av-book__generated {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 1rem .8rem .9rem 1.2rem;
  background:
    radial-gradient(120% 70% at 100% 0%, hsla(var(--hue), 70%, 55%, .45), transparent 60%),
    linear-gradient(160deg, hsl(var(--hue), 45%, 26%), hsl(calc(var(--hue) + 30), 40%, 12%));
  color: #fff;
}
.av-book__gcat { font-size: .58rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.av-book__gtitle { margin-top: auto; font-family: var(--av-font-reading); font-size: .98rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.av-book__gauthor { margin-top: .5rem; font-size: .7rem; opacity: .8; }
.av-book__pages {
  position: absolute; right: 6px; bottom: 6px; padding: .1rem .4rem; border-radius: 4px;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: .62rem; font-weight: 700;
}
.av-book__read {
  position: absolute; inset: 0; display: grid; place-content: center; gap: .3rem; justify-items: center;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: .85rem; font-weight: 700; opacity: 0; transition: opacity var(--av-dur);
}
.av-book__read i { font-size: 1.5rem; }
.av-book__cover:hover .av-book__read, .av-book__cover:focus-visible .av-book__read { opacity: 1; }
.av-book__title { position: relative; z-index: 1; margin: 1.6rem 0 .15rem; font-family: var(--av-font-body); font-size: .88rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.av-book__title a { color: var(--av-text); }
.av-book__meta { position: relative; z-index: 1; margin: 0; font-size: .75rem; color: var(--av-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Liseuse ---------- */
.av-reader {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--av-nav-h) - 3rem);
  min-height: 480px;
  margin-bottom: var(--av-space-6);
  overflow: hidden;
  border: 1px solid var(--av-border);
  border-radius: 14px;
  background: #2a2a30;
  outline: none;
}
.av-reader.is-full, .av-reader:fullscreen { height: 100vh; border-radius: 0; border: 0; }
.av-reader__bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  padding: .6rem .9rem; background: #1c1c21; border-bottom: 1px solid rgba(255, 255, 255, .06); color: #eee;
}
.av-reader__title { display: grid; min-width: 0; line-height: 1.3; }
.av-reader__title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.av-reader__title span { font-size: .78rem; color: #aaa; }
.av-reader__tools { display: flex; align-items: center; gap: .2rem; }
.av-reader__tools button, .av-reader__dl {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; color: #ddd; cursor: pointer; text-decoration: none;
}
.av-reader__tools button:hover, .av-reader__dl:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.av-reader__pageinfo, .av-reader__zoom { min-width: 3.5rem; text-align: center; font-size: .82rem; font-variant-numeric: tabular-nums; color: #ccc; }
.av-reader__sep { width: 1px; height: 20px; margin: 0 .3rem; background: rgba(255, 255, 255, .15); }
.av-reader__pages {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 14px 12px 40px; overflow: auto; overscroll-behavior: contain;
  -webkit-user-select: none; user-select: none;
}
.av-reader__page { position: relative; flex: none; max-width: none; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .45); }
.av-reader__page:not(.is-ready)::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, #f2f2f2 30%, #e6e6e6 50%, #f2f2f2 70%) 0 0 / 200% 100%;
  animation: av-shimmer 1.4s linear infinite;
}
@keyframes av-shimmer { to { background-position: -200% 0; } }
.av-reader__page canvas { display: block; }
.av-reader__loading { margin: auto; color: #ccc; font-size: .95rem; }
.av-reader__loading.is-error { color: #ff8a8a; }
.av-reader__loading[hidden] { display: none; }
@media (max-width: 575px) {
  .av-reader { height: 78vh; margin-inline: -18px; border-radius: 0; border-left: 0; border-right: 0; }
  .av-reader__title { width: 100%; }
  .av-reader__tools { width: 100%; justify-content: space-between; }
  .av-reader__hide-sm, .av-reader__sep { display: none; }
  .av-reader__pages { padding: 8px 4px 30px; }
}

.av-docinfo { display: grid; gap: var(--av-space-6); margin-bottom: var(--av-space-6); }
@media (min-width: 992px) { .av-docinfo { grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; } }
.av-docinfo__head h1 { margin: .25rem 0 .35rem; font-family: var(--av-font-reading); font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.1rem); line-height: 1.2; }
.av-docinfo__author { margin: 0; font-family: var(--av-font-reading); font-style: italic; font-size: 1.1rem; color: var(--av-text-soft); }
.av-docinfo__desc { margin: var(--av-space-4) 0; font-size: 1rem; line-height: 1.7; color: var(--av-text-soft); }
.av-docinfo__desc + .av-tags { margin-bottom: var(--av-space-4); }
.av-docinfo__book { max-width: 200px; margin: 0 auto var(--av-space-4); }
.av-docinfo__book .av-book__stand::after { display: none; }
.av-docinfo__book .av-book__title, .av-docinfo__book .av-book__meta { display: none; }
.av-docinfo__side .av-dl { padding: 1.1rem; border: 1px solid var(--av-border); border-radius: 14px; background: var(--av-surface); }

/* Formulaire document */
.av-docdrop { display: grid; gap: 1rem; }
@media (min-width: 640px) { .av-docdrop { grid-template-columns: 1fr 150px; align-items: stretch; } }
.av-docdrop__preview { display: grid; gap: .4rem; justify-items: center; align-content: start; font-size: .75rem; color: var(--av-text-muted); }
.av-docdrop__preview img { width: 100%; aspect-ratio: 1 / 1.414; object-fit: cover; border-radius: 4px; background: #fff; box-shadow: 4px 6px 14px rgba(0, 0, 0, .35); }
.av-docdrop__preview img[hidden] { display: block; visibility: hidden; }
.av-docdrop__preview:has(img[hidden]) { display: none; }
.av-docdrop__note { display: flex; gap: .5rem; margin: .75rem 0 0; }
.av-docdrop__note i { color: var(--av-primary); margin-top: .15rem; }

/* ==========================================================================
   Autres
   ========================================================================== */
.av-finder { margin-bottom: 1rem; }
.av-finder__search { position: relative; margin-bottom: 1rem; }
.av-finder__search > i { position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); color: var(--av-text-muted); }
.av-finder__search input {
  width: 100%; height: 56px; padding: 0 9rem 0 3.1rem;
  border: 1px solid var(--av-border); border-radius: 16px; background: var(--av-surface);
  color: var(--av-text); font: inherit; font-size: 1.05rem;
}
.av-finder__search input:focus { outline: none; border-color: var(--av-primary); box-shadow: var(--av-ring); }
.av-finder__tagpill {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .5rem .35rem .8rem; border-radius: 999px;
  background: var(--av-primary-soft); color: var(--av-primary-hover); font-size: .85rem; font-weight: 600;
}
.av-finder__tagpill[hidden] { display: none; }
.av-finder__tagpill a { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: inherit; }
.av-finder__tagpill a:hover { background: rgba(238, 28, 37, .2); }
@media (max-width: 575px) { .av-finder__search input { padding-right: 1rem; } .av-finder__tagpill { position: static; transform: none; margin-top: .5rem; } }

.av-tagcloud { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin: 0 0 var(--av-space-5); padding: 1rem 1.2rem; border-radius: 14px; background: var(--av-surface); border: 1px solid var(--av-border-soft); }
.av-tagcloud a { font-size: calc(.85rem * var(--w, 1)); font-weight: 600; color: var(--av-text-soft); text-decoration: none; }
.av-tagcloud a:hover, .av-tagcloud a.is-active { color: var(--av-primary-hover); }
.av-tagcloud a.is-active { text-decoration: underline; text-underline-offset: 4px; }

.av-finder-results { transition: opacity .2s; min-height: 200px; }
.av-finder-results.is-loading { opacity: .45; pointer-events: none; }

.av-masonry { columns: 4 260px; column-gap: 1rem; margin-bottom: var(--av-space-5); }
@media (max-width: 575px) { .av-masonry { columns: 2 150px; column-gap: .65rem; } }
.av-icard {
  display: inline-block; width: 100%; margin: 0 0 1rem; overflow: hidden; break-inside: avoid;
  border: 1px solid var(--av-border); border-radius: 14px; background: var(--av-surface);
  transition: border-color var(--av-dur), transform var(--av-dur) var(--av-ease);
}
.av-icard:hover { border-color: var(--av-steel-700); transform: translateY(-2px); }
@media (max-width: 575px) { .av-icard { margin-bottom: .65rem; border-radius: 12px; } }
.av-icard__media { position: relative; display: block; background: var(--av-surface-2); }
.av-icard__media img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: cover; }
.av-icard__media--video img { aspect-ratio: 16 / 9; object-fit: cover; }
.av-icard__poster { display: grid; place-items: center; aspect-ratio: 16 / 9; font-size: 2rem; color: var(--av-text-muted); }
.av-icard__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 1.1rem; padding-left: 3px; transition: background var(--av-dur);
}
.av-icard:hover .av-icard__play { background: var(--av-primary); }
.av-icard__audio { display: grid; gap: .6rem; padding: 1.1rem 1rem .4rem; background: linear-gradient(160deg, rgba(238, 28, 37, .18), transparent 70%); }
.av-icard__wave { display: flex; align-items: flex-end; gap: 3px; height: 48px; }
.av-icard__wave span { flex: 1; height: var(--h); border-radius: 2px; background: linear-gradient(180deg, var(--av-red-400), rgba(238, 28, 37, .25)); }
.av-icard__audio audio { width: 100%; height: 36px; }
.av-icard__note {
  display: block; padding: 1.2rem 1.1rem;
  background: linear-gradient(180deg, #fff6c9, #ffe99a); color: #3d3410;
  font-family: var(--av-font-reading); font-size: 1.02rem; line-height: 1.55; white-space: pre-line; text-decoration: none;
}
.av-icard__note:hover { color: #1d1806; text-decoration: none; }
.av-icard__file { position: relative; display: grid; place-items: center; height: 130px; background: var(--av-surface-2); color: var(--av-text-muted); font-size: 2.4rem; text-decoration: none; }
.av-icard__ext {
  position: absolute; top: 12px; left: 12px; padding: .2rem .5rem; border-radius: 6px;
  background: var(--av-primary); color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .05em;
}
.av-icard__ext--lg { position: static; font-size: .9rem; padding: .3rem .7rem; }
.av-icard__body { padding: .85rem 1rem 1rem; }
.av-icard__kind { margin: 0 0 .3rem; font-size: .72rem; font-weight: 600; letter-spacing: .04em; color: var(--av-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-icard__title { margin: 0 0 .35rem; font-family: var(--av-font-body); font-size: .98rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.av-icard__title a { color: var(--av-text); }
.av-icard__desc { margin: 0 0 .5rem; font-size: .85rem; line-height: 1.5; color: var(--av-text-soft); }
.av-icard .av-tags { margin-top: .4rem; }
.av-icard--note .av-icard__kind { margin-top: 0; }

/* Page d'un contenu */
.av-ishow { display: grid; gap: var(--av-space-5); margin-bottom: var(--av-space-5); }
@media (min-width: 992px) { .av-ishow { grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: start; } }
.av-ishow__stage { display: grid; place-items: center; min-height: 320px; overflow: hidden; border: 1px solid var(--av-border); border-radius: 16px; background: var(--av-surface); }
.av-ishow--image .av-ishow__stage, .av-ishow--video .av-ishow__stage { background: #000; }
.av-ishow__img { display: block; max-width: 100%; max-height: 80vh; object-fit: contain; }
.av-ishow__embed { width: 100%; aspect-ratio: 16 / 9; }
.av-ishow__embed iframe { width: 100%; height: 100%; border: 0; }
.av-ishow__video { display: block; width: 100%; max-height: 80vh; background: #000; }
.av-ishow__audio { display: grid; justify-items: center; gap: 1.2rem; width: 100%; padding: 3rem 1.5rem; text-align: center; background: radial-gradient(80% 80% at 50% 0%, rgba(238, 28, 37, .25), transparent 70%); }
.av-ishow__disc {
  display: grid; place-items: center; width: 140px; height: 140px; border-radius: 50%;
  background: repeating-radial-gradient(circle, #1a1a1f 0 3px, #242429 3px 5px); border: 6px solid #111;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5); color: var(--av-primary); font-size: 1.6rem;
  animation: av-spin 6s linear infinite; animation-play-state: paused;
}
.av-ishow__audio:has(audio:not([paused])) .av-ishow__disc { animation-play-state: running; }
@keyframes av-spin { to { transform: rotate(360deg); } }
.av-ishow__audio strong { font-size: 1.15rem; }
.av-ishow__audio audio { width: min(100%, 520px); }
.av-ishow__linkcard { display: grid; width: 100%; color: var(--av-text); text-decoration: none; }
.av-ishow__linkcard:hover { color: var(--av-text); text-decoration: none; }
.av-ishow__linkcard img { width: 100%; max-height: 420px; object-fit: cover; }
.av-ishow__linkbody { display: grid; gap: .4rem; padding: 1.5rem; }
.av-ishow__linkbody small { color: var(--av-text-muted); }
.av-ishow__linkbody strong { font-size: 1.3rem; line-height: 1.3; }
.av-ishow__open { font-weight: 700; color: var(--av-primary); }
.av-ishow__note {
  width: 100%; align-self: stretch; padding: clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(180deg, #fff6c9, #ffe99a); color: #2e2709;
  font-family: var(--av-font-reading); font-size: 1.2rem; line-height: 1.7;
}
.av-ishow__note .av-hashtag { color: #8a5a00; }
.av-ishow__file { display: grid; justify-items: center; gap: .6rem; padding: 3rem 1.5rem; text-align: center; }
.av-ishow__file > i { font-size: 3.5rem; color: var(--av-text-muted); }
.av-ishow__file strong { overflow-wrap: anywhere; }
.av-ishow__file span { color: var(--av-text-muted); font-size: .9rem; }
.av-ishow__side { display: grid; gap: 1rem; }
@media (min-width: 992px) { .av-ishow__side { position: sticky; top: calc(var(--av-nav-h) + 1rem); } }
.av-ishow__title { margin: 0; font-family: var(--av-font-body); font-size: 1.5rem; line-height: 1.25; overflow-wrap: anywhere; }
.av-ishow__author { display: flex; align-items: center; gap: .6rem; font-size: .88rem; color: var(--av-text-muted); }
.av-ishow__author a { font-weight: 700; color: var(--av-text); }
.av-ishow__desc { color: var(--av-text-soft); line-height: 1.65; overflow-wrap: anywhere; }
.av-ishow__actions { display: grid; gap: .5rem; }
.av-ishow__actions small { font-weight: 400; opacity: .8; }
.av-ishow__stats { display: flex; gap: 1.2rem; margin: 0; padding: 0; list-style: none; font-size: .85rem; color: var(--av-text-muted); }
.av-ishow__reactions { max-width: 760px; }

/* Formulaire « Autres » */
.av-sourcepick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1.25rem; }
.av-sourcepick label { margin: 0; cursor: pointer; }
.av-sourcepick input { position: absolute; opacity: 0; pointer-events: none; }
.av-sourcepick span {
  display: grid; justify-items: center; gap: .2rem; height: 100%; padding: 1rem .6rem; text-align: center;
  border: 1px solid var(--av-border); border-radius: 12px; background: var(--av-bg); transition: border-color var(--av-dur-fast), background var(--av-dur-fast);
}
.av-sourcepick i { font-size: 1.3rem; color: var(--av-text-muted); margin-bottom: .3rem; }
.av-sourcepick strong { font-size: .9rem; }
.av-sourcepick small { font-size: .72rem; color: var(--av-text-muted); line-height: 1.35; }
.av-sourcepick input:checked + span { border-color: var(--av-primary); background: var(--av-primary-soft); box-shadow: inset 0 0 0 1px var(--av-primary); }
.av-sourcepick input:checked + span i { color: var(--av-primary); }
.av-sourcepick input:focus-visible + span { box-shadow: var(--av-ring); }
@media (max-width: 575px) { .av-sourcepick small { display: none; } }
[data-av-source-panel][hidden] { display: none; }

/* ==========================================================================
   Mots-clés, recherche, mes contenus
   ========================================================================== */
.av-taghead { position: relative; margin: var(--av-space-5) 0 var(--av-space-6); padding: 2rem 0 1.5rem; border-bottom: 1px solid var(--av-border); }
.av-taghead .av-breadcrumb { margin-bottom: 1.25rem; }
.av-taghead__hash { position: absolute; right: 0; top: -1rem; font-family: var(--av-font-display); font-size: 9rem; font-weight: 800; line-height: 1; color: var(--av-primary); opacity: .12; pointer-events: none; }
.av-taghead h1 { margin: 0; font-size: clamp(2rem, 1.4rem + 2.5vw, 3.2rem); }
.av-taghead h1::before { content: "#"; color: var(--av-primary); margin-right: .1rem; }
.av-taghead p { margin: .5rem 0 0; color: var(--av-text-muted); }
.av-tagsection { margin-bottom: var(--av-space-6); }
.av-tagsection > h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.1rem; font-family: var(--av-font-body); font-size: 1.1rem; font-weight: 700; }
.av-tagsection > h2 i { color: var(--av-primary); }
.av-tagsection > h2 span { padding: .1rem .5rem; border-radius: 999px; background: var(--av-surface-2); font-size: .75rem; color: var(--av-text-muted); }

.av-searchhead { max-width: 760px; margin: var(--av-space-6) auto var(--av-space-6); text-align: center; }
.av-searchhead h1 { margin: 0 0 1.25rem; font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); }
.av-searchhead__form { position: relative; display: flex; gap: .5rem; }
.av-searchhead__form > i { position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); color: var(--av-text-muted); }
.av-searchhead__form input {
  flex: 1; min-width: 0; height: 56px; padding: 0 1rem 0 3rem; border: 1px solid var(--av-border); border-radius: 14px;
  background: var(--av-surface); color: var(--av-text); font: inherit; font-size: 1.05rem;
}
.av-searchhead__form input:focus { outline: none; border-color: var(--av-primary); box-shadow: var(--av-ring); }
.av-searchhead__form .av-btn { height: 56px; padding-inline: 1.4rem; border-radius: 14px; }
.av-searchhead__count { margin: 1rem 0 0; color: var(--av-text-muted); }
@media (max-width: 575px) { .av-searchhead__form { flex-direction: column; } .av-searchhead__form > i { top: 28px; } }
.av-searchtags { justify-content: center; margin-bottom: var(--av-space-6); }
.av-reslist { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin: 0; padding: 0; list-style: none; }
.av-reslist a { display: flex; align-items: center; gap: .85rem; padding: .6rem; border: 1px solid var(--av-border-soft); border-radius: 12px; background: var(--av-surface); color: var(--av-text); text-decoration: none; }
.av-reslist a:hover { border-color: var(--av-steel-700); }
.av-reslist img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex: none; background: var(--av-surface-2); }
.av-reslist span { display: grid; min-width: 0; }
.av-reslist strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-reslist small { color: var(--av-text-muted); }
.av-reslist > li > a > i { margin-left: auto; color: var(--av-text-muted); }
.av-userlist { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.av-userlist a { display: inline-flex; align-items: center; gap: .6rem; padding: .4rem .9rem .4rem .4rem; border: 1px solid var(--av-border); border-radius: 999px; color: var(--av-text); font-weight: 600; text-decoration: none; }
.av-userlist a:hover { border-color: var(--av-primary); }
.av-searchhints { max-width: 960px; margin: 0 auto var(--av-space-7); }
.av-searchhints h2 { margin: var(--av-space-6) 0 1rem; font-family: var(--av-font-body); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--av-text-muted); text-align: center; }
.av-searchhints .av-tags { justify-content: center; }
.av-searchhints__grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.av-searchhints__grid a { display: grid; gap: .2rem; padding: 1.1rem; border: 1px solid var(--av-border); border-radius: 14px; background: var(--av-surface); color: var(--av-text); text-decoration: none; transition: border-color var(--av-dur); }
.av-searchhints__grid a:hover { border-color: var(--av-primary); }
.av-searchhints__grid i { font-size: 1.3rem; color: var(--av-primary); margin-bottom: .4rem; }
.av-searchhints__grid small { color: var(--av-text-muted); font-size: .8rem; }

.av-nav__search-label { display: none; }
@media (max-width: 991px) { .av-nav__search-label { display: inline; } }

/* Mes contenus */
.av-mytabs { display: flex; gap: .35rem; overflow-x: auto; margin-bottom: 1.25rem; padding: 4px; border: 1px solid var(--av-border); border-radius: 14px; background: var(--av-surface); scrollbar-width: none; }
.av-mytabs a { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 42px; padding: 0 1rem; border-radius: 10px; color: var(--av-text-muted); font-size: .9rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.av-mytabs a span { padding: .05rem .45rem; border-radius: 999px; background: var(--av-surface-3); font-size: .72rem; }
.av-mytabs a:hover { color: var(--av-text); }
.av-mytabs a.is-active { background: var(--av-primary); color: #fff; }
.av-mytabs a.is-active span { background: rgba(255, 255, 255, .25); }
.av-mytoolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.av-mytoolbar p { margin: 0; color: var(--av-text-muted); }
.av-mylist { display: grid; gap: .6rem; margin: 0 0 var(--av-space-5); padding: 0; list-style: none; }
.av-mylist__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 1rem; padding: .75rem; border: 1px solid var(--av-border); border-radius: 14px; background: var(--av-surface); }
.av-mylist__thumb { display: grid; place-items: center; width: 84px; height: 56px; overflow: hidden; border-radius: 8px; background: var(--av-surface-2); color: var(--av-text-muted); font-size: 1.2rem; }
.av-mylist__thumb--dokiman { width: 44px; height: 62px; border-radius: 3px; }
.av-mylist__thumb img { width: 100%; height: 100%; object-fit: cover; }
.av-mylist__title { display: block; font-weight: 700; color: var(--av-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-mylist__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; margin: .3rem 0 0; font-size: .78rem; color: var(--av-text-muted); }
.av-mylist__stats { display: flex; gap: .9rem; margin: 0; padding: 0; list-style: none; font-size: .82rem; color: var(--av-text-muted); }
.av-mylist__actions { display: flex; gap: .25rem; }
.av-mylist__actions form { margin: 0; }
@media (max-width: 767px) {
  .av-mylist__row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .av-mylist__stats { grid-column: 2 / -1; grid-row: 2; }
  .av-mylist__thumb { width: 64px; height: 48px; }
}
.av-badge--success { background: rgba(34, 197, 94, .15); color: #4ade80; }
:root[data-theme="light"] .av-badge--success { color: #15803d; }

/* Vignette vidéo absente (image externe indisponible) : on garde un fond 16:9 */
.av-icard__media--video { min-height: 0; aspect-ratio: 16 / 9; background: radial-gradient(80% 80% at 50% 40%, rgba(238, 28, 37, .25), transparent 70%), var(--av-surface-2); }
.av-icard__media--video img { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 575px) { .av-icard__note { font-size: .9rem; padding: 1rem .9rem; } }
