/* ── Calendrier Transit Thème Natal ─────────────────────────── */
.tncal-natal-planet {
  opacity: 0.7;
}


/* ══════════════════════════════════════════════════════════════
   ÉPHÉMÉRIDE TRANSIT (transit-positions)
   ══════════════════════════════════════════════════════════════ */

/* ── Loading / empty ─────────────────────────────────────────── */
.tpos-loading, .tpos-empty {
  padding: 32px; text-align: center;
  color: var(--text-muted); font-size: 0.85rem;
}

/* ── Table ───────────────────────────────────────────────────── */
.tpos-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.80rem; color: var(--text);
}
.tpos-table thead {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg);
}
.tpos-table th {
  padding: 5px 8px;
  text-align: left; font-weight: 600;
  font-size: 0.70rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; user-select: none;
}
.tpos-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  vertical-align: middle; white-space: nowrap;
}
.tpos-row:hover td              { background: var(--hover-bg); }
.tpos-row-retro td              { background: rgba(196,68,68,0.04); }
.tpos-row-retro:hover td        { background: rgba(196,68,68,0.08); }
.tpos-row-date-start td         { border-top: 1px solid rgba(0,0,0,0.07); }

/* ── Column widths ───────────────────────────────────────────── */
.tpos-th-date, .tpos-td-date   { width: 120px; min-width: 110px; color: var(--text-muted); font-size: 0.74rem; }
.tpos-th-planet                { min-width: 110px; }
.tpos-th-sign                  { min-width: 120px; }
.tpos-th-deg, .tpos-td-deg     { width: 72px; font-variant-numeric: tabular-nums; font-size: 0.78rem; }
.tpos-th-retro, .tpos-td-retro { width: 46px; text-align: center; }

/* ── Filter button in header (Excel-style ▾) ─────────────────── */
.tpos-flt-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; margin-left: 3px;
  border: none; border-radius: 3px;
  background: transparent; color: var(--text-muted);
  font-size: 0.92rem; cursor: pointer; vertical-align: middle;
  transition: background 0.12s, color 0.12s;
  line-height: 1;
}
.tpos-flt-btn:hover   { background: var(--hover-bg); color: var(--text); }
.tpos-flt-active      { background: var(--indigo) !important; color: #fff !important;
                         border-color: var(--indigo) !important; }

/* ── Column-filter dropdown (shared popup) ───────────────────── */
.tpos-col-dropdown {
  background: var(--surface, #fff);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.14);
  min-width: 180px; max-width: 240px;
  overflow: hidden;
  font-size: 0.80rem; color: var(--text);
}
.tpos-dd-head  { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.tpos-dd-sep   { height: 1px; background: var(--border); margin: 0; }
.tpos-dd-list  { max-height: 220px; overflow-y: auto; padding: 4px 0; }
.tpos-dd-radios{ padding: 6px 0; }
.tpos-dd-row   {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; cursor: pointer;
  white-space: nowrap;
}
.tpos-dd-row:hover { background: var(--hover-bg); }
.tpos-dd-row input[type="checkbox"],
.tpos-dd-row input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  opacity: 0.6;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
  transition: background-color .15s, border-color .15s, opacity .15s;
}
.tpos-dd-row input[type="checkbox"]:hover:not(:checked),
.tpos-dd-row input[type="radio"]:hover:not(:checked) {
  border-color: var(--indigo);
  opacity: 0.9;
}
.tpos-dd-row input[type="checkbox"]:checked {
  opacity: 1;
  background-color: var(--indigo);
  border-color: var(--indigo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.5l2.5 2.5 4.5-5' stroke='%23fff' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.tpos-dd-row input[type="radio"]:checked {
  opacity: 1;
  background-color: var(--indigo);
  border-color: var(--indigo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='2.5' fill='%23fff'/%3E%3C/svg%3E");
}
.tpos-dd-all   { font-weight: 600; }
.tpos-dd-foot  { padding: 6px 10px; border-top: 1px solid var(--border); text-align: right; }
.tpos-dd-ok {
  padding: 3px 14px; border-radius: 5px; border: none;
  background: var(--indigo); color: #fff;
  font-size: 0.78rem; cursor: pointer;
}
.tpos-dd-ok:hover { opacity: 0.85; }

/* ── Inline elements ─────────────────────────────────────────── */
.tpos-retro { color: #c44; font-weight: 600; font-style: italic; }
.tpos-time  {
  display: inline-block; margin-left: 4px;
  font-size: 0.66rem; color: var(--indigo); opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

/* ── Bouton Année (en-tête du bloc) ──────────────────────────── */
.tpos-year-btn {
  margin-left: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--indigo);
  background: var(--indigo);
  color: #fff;
  font-size: 0.80rem; font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.tpos-year-btn:hover { opacity: 0.82; }

.tpos-header-refresh,
.tpos-header-clear {
  flex-shrink: 0;
}
/* Effacer les filtres : icône nue, sans fond ni encadré, plus grande
   (même patron que #btn-comp-save / boutons du footer lunaire) */
.tpos-header-clear {
  background: transparent;
  border: none;
  padding: 0 4px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
}
.tpos-header-clear:hover { color: var(--text); border: none; background: transparent; }
.tpos-header-clear[hidden] { display: none; }

/* ── Grille de sélection d'année ─────────────────────────────── */
.tpos-year-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 3px; padding: 8px;
  max-height: 260px; overflow-y: auto;
  min-width: 160px;
}
.tpos-year-option {
  padding: 5px 4px; border-radius: 6px;
  border: none; background: transparent;
  color: var(--text); font-size: 0.82rem;
  cursor: pointer; text-align: center;
  transition: background 0.1s;
}
.tpos-year-option:hover    { background: var(--hover-bg); }
.tpos-year-selected        { background: var(--indigo) !important; color: #fff !important;
                              font-weight: 700; }

/* ── Theme overrides ─────────────────────────────────────────── */
[data-theme="glass"] .tpos-table td       { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="glass"] .tpos-row-retro td   { background: rgba(255,100,100,0.06); }
[data-theme="glass"] .tpos-row-date-start td { border-top-color: rgba(255,255,255,0.12); }
[data-theme="glass"] .tpos-retro          { color: #ff9090; }
[data-theme="glass"] .tpos-col-dropdown   { background: rgba(30, 39, 80, 0.97); border-color: rgba(255,255,255,0.15); }

[data-theme="lishu"]  .tpos-row-retro td  { background: rgba(160,60,60,0.06); }
[data-theme="lishu"]  .tpos-retro         { color: #a03028; }
[data-theme="aurora"] .tpos-row-retro td  { background: rgba(180,60,60,0.06); }
[data-theme="aurora"] .tpos-retro         { color: #a03030; }

[data-theme="forest"] .tpos-retro         { color: #8B3030; }
[data-theme="forest"] .tpos-col-dropdown  { background: rgba(240,233,219,0.97); }

[data-theme="forest"] .tpos-sign-sel { background: rgba(240,233,219,0.60); }
[data-theme="forest"] .tpos-retro { color: #8B3030; }

/* ── Rapport Révolution Solaire ─────────────────────────────── */
.sr-table { width: 100%; border-collapse: collapse; font-size: 0.80rem; color: var(--text); }
.sr-table thead { position: sticky; top: 0; z-index: 2; background: var(--bg); }
.sr-th {
  padding: 6px 12px; text-align: center; font-weight: 700;
  font-size: 0.72rem; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.sr-th-label {
  position: sticky; left: 0; z-index: 3; background: var(--bg);
  text-align: left; padding: 4px 8px; min-width: 36px;
  border-bottom: 1px solid var(--border);
}
.sr-td {
  padding: 5px 12px; border-bottom: 1px solid rgba(0,0,0,0.04);
  vertical-align: middle; white-space: nowrap; text-align: center;
}
.sr-td-label {
  font-weight: 600; white-space: nowrap; padding: 5px 10px 5px 14px;
  position: sticky; left: 0; background: var(--bg); z-index: 1;
  text-align: left; border-bottom: 1px solid rgba(0,0,0,0.04);
}
/* Colonne année courante */
.sr-th-current { color: var(--indigo) !important; font-weight: 800; border-bottom: 2px solid var(--indigo); }
.sr-td-current { background: rgba(99,102,241,0.07); font-weight: 600; }
.sr-row:hover .sr-td, .sr-row:hover .sr-td-label { background: var(--hover-bg); }

/* Lishu — tableau warm */
[data-theme="lishu"] .sr-td,
[data-theme="lishu"] .sr-td-label             { border-bottom-color: rgba(122,76,56,0.24); }
[data-theme="lishu"] .sr-td-current            { background: rgba(122,76,56,0.10); }
[data-theme="lishu"] .sr-table thead           { background: rgba(255,248,234,0.97); }
[data-theme="lishu"] .sr-th-label              { background: rgba(255,248,234,0.97); }
[data-theme="lishu"] .sr-td-label              { background: rgba(255,248,234,0.97); }
/* hover : la colonne sticky garde son fond quoi qu'il arrive */
[data-theme="lishu"] .sr-row:hover .sr-td-label { background: rgba(255,248,234,0.97); }

/* Ocean — tableaux des RAPPORTS (RS / RL / Profection partagent .sr-table) :
   en-tête et colonne de libellés en blanc lumineux UNI et OPAQUE #f3fbf7, sans flou,
   sans dégradé, sans ombre (décision Mélanie 2026-11-12, après essais sur le seul
   Rapport RS puis « fais pareil pour tous les rapports du thème Océan »). Le beige
   sable rgba(251,246,232,0.97) du 2026-07-31 ne reste QUE sur Positions planétaires
   (.tpos-table), qui n'est pas un rapport. */
[data-theme="ocean"] .tpos-table thead           { background: rgba(251,246,232,0.97); }
[data-theme="ocean"] .sr-table thead             { background: transparent; }
[data-theme="ocean"] .sr-th,
[data-theme="ocean"] .sr-td-label,
[data-theme="ocean"] .sr-row:hover .sr-td-label  { background: #f3fbf7; box-shadow: none; }
[data-theme="ocean"] .sr-th                      { border-bottom: 1px solid rgba(46,95,120,0.18); }
[data-theme="ocean"] .sr-th-current              { border-bottom: 2px solid var(--indigo); }
[data-theme="ocean"] .sr-td,
[data-theme="ocean"] .sr-td-label                { border-bottom-color: rgba(46,95,120,0.14); }
/* Glyphe planète dans label */
.sr-planet-glyph { font-size: 0.95em; }
/* Bouton filtre dans th-label */
.sr-filter-btn {
  width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--border); border-radius: 4px;
  background: transparent; cursor: pointer;
  color: var(--text-muted); font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.sr-filter-btn:hover { color: var(--indigo); border-color: var(--indigo); }

/* Profection report – age subtitle in column header */
.pr-th-age { font-weight: 400; font-size: 0.68rem; opacity: .7; }


/* ── Option "Fonds de blocs blancs" ──────────────────────────────
   N'affecte pas le thème Nocturne (glass) — texte clair incompatible.
──────────────────────────────────────────────────────────────────── */
html:not([data-theme="glass"]) .blocks-white .block {
  --block-bg:          #ffffff;
  --block-backdrop:    none;
  --block-header-grad: linear-gradient(to bottom, #fefefe, #faf9f6);
}

/* Les DEUX calendriers de transits : fond blanc QUOI QU'IL ARRIVE (décision
   Mélanie 2026-08-17), option « Fonds de blocs blancs » cochée ou non, dans
   tous les thèmes — même exclusion Nocturne que l'option (texte clair
   incompatible ; ses cartes y restent sombres, décision cartes du 16/08).
   OUVERTS dans le workspace seulement (précision Mélanie le jour même) : en
   bibliothèque comme dans le dock, ils restent habillés comme les autres. */
html:not([data-theme="glass"]) #block-transit-cal:not(.block-in-sidebar):not(.block-in-dock),
html:not([data-theme="glass"]) #block-transit-natal-cal:not(.block-in-sidebar):not(.block-in-dock) {
  --block-bg:          #ffffff;
  --block-backdrop:    none;
  --block-header-grad: linear-gradient(to bottom, #fefefe, #faf9f6);
}

/* ── Poignée de réorganisation du dock ───────────────────────────
   Apparaît à gauche du titre uniquement quand le bloc est dans le dock.
──────────────────────────────────────────────────────────────────── */
/* ── Bouton × — ranger dans la bibliothèque (côté gauche) ──── */
.btn-to-sidebar {
  display: flex;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0 4px 0 4px;
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 4px;
  opacity: .45;
  transition: color .15s, opacity .15s;
}
.btn-to-sidebar:hover {
  color: var(--text);
  opacity: 1;
}
/* × masqué quand le bloc est dans la sidebar */
.block-in-sidebar .btn-to-sidebar { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   Sidebar bibliothèque — panneau fixe latéral gauche
   ══════════════════════════════════════════════════════════════ */

#lib-sidebar {
  position: fixed;
  left: 0; top: 96px; bottom: 0;
  width: 260px;
  z-index: 200;
  background: var(--block-bg);
  -webkit-backdrop-filter: var(--block-backdrop);
  backdrop-filter: var(--block-backdrop);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 28px rgba(26,26,46,.12);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  overflow: hidden;
}
#lib-sidebar.lib-anim {
  transition: transform .28s cubic-bezier(.4,0,.2,1),
              width .18s ease;
}
#lib-sidebar.lib-open {
  transform: translateX(0);
}

/* ── Header ─────────────────────────────────────────────────── */
#lib-header {
  display: flex;
  align-items: center;
  padding: 0 10px 0 14px;
  height: 44px;
  min-height: 44px;
  border-bottom: 1px solid var(--border);
  background: var(--block-header-grad);
  gap: 4px;
  flex-shrink: 0;
}
.lib-title {
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;   /* « Bibliothèque » au lieu de « BIBLIOTHÈQUE » */
  color: var(--text-muted);
  flex: 1;
  opacity: .8;
}
.lib-actions {
  display: flex;
  gap: 1px;
  align-items: center;
}
.lib-btn {
  width: 26px; height: 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: color .15s, background .15s, border-color .15s;
  flex-shrink: 0;
}
.lib-btn:hover {
  color: var(--indigo);
  background: var(--hover-bg);
  border-color: var(--border);
}
.lib-btn.lib-btn-on {
  color: var(--indigo);
  background: rgba(91,81,216,.08);
  border-color: var(--indigo-l);
}

/* ── Corps scrollable ───────────────────────────────────────── */
#lib-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
#lib-body::-webkit-scrollbar { width: 4px; }
#lib-body::-webkit-scrollbar-track { background: transparent; }
#lib-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Blocs avec contenu dans la sidebar */
#lib-content-blocks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 6px 50px;
  flex-shrink: 0;
}
#lib-content-blocks:empty { padding: 0; }

/* ── Blocs affichés avec contenu dans la sidebar ────────────── */
.block-in-sidebar {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  height: auto !important;
  box-sizing: border-box !important;
  box-shadow: 0 1px 4px rgba(26,26,46,.06) !important;
  z-index: auto !important;
  flex-shrink: 0;
}
.block-in-sidebar .block-header {
  cursor: default !important;
}
.block-in-sidebar .btn-export,
/* Boutons d'en-tête stylés par ID (débarrassés de la classe .btn-export pour
   qu'export-image.js ne les adopte pas — leçon loupe 2026-09-04/05) : ils
   doivent rejoindre CETTE liste pour rester masqués en bibliothèque. */
.block-in-sidebar #btn-tcal-ics,
.block-in-sidebar #btn-tncal-ics,
.block-in-sidebar #btn-sky-search,
.block-in-sidebar .btn-fullscreen,
.block-in-sidebar .btn-restore,
.block-in-sidebar .resize-handle {
  display: none !important;
}

/* ── Header style lib-item pour tous les blocs dans la sidebar ── */
.block-in-sidebar .block-header {
  background: transparent !important;
  padding: 0 8px 0 6px !important;
  height: 32px !important;
  gap: 8px !important;
}
.block-in-sidebar .block-title {
  font-size: 12.5px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}
.block-in-sidebar:not(.block-collapsed) .block-title {
  font-weight: 500 !important;
}
.block-in-sidebar .block-action-btns {
  margin-left: auto !important;
}
/* Boutons action dans la sidebar : même style léger que lib-ghost-btn */
.block-in-sidebar .btn-collapse,
.block-in-sidebar .btn-popout {
  width: 20px; height: 20px;
  border: none !important;
  border-radius: 4px;
  background: transparent;
  outline: none;
}
.block-in-sidebar .btn-collapse:hover,
.block-in-sidebar .btn-popout:hover {
  background: var(--hover-bg);
  color: var(--text);
}
.block-in-sidebar .block-header:hover {
  background: var(--hover-bg) !important;
  border-bottom-color: var(--border) !important;
  cursor: pointer;
}

/* Bloc réduit dans la sidebar = même forme qu'un item de liste */
.block-in-sidebar.block-collapsed {
  box-shadow: none !important;
  border-radius: 8px !important;
  border-color: transparent !important;
}
.block-in-sidebar.block-collapsed:hover {
  border-color: var(--border) !important;
  background: var(--lib-item-hover) !important;
}

/* ── Barre de recherche ─────────────────────────────────────────── */
#lib-search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--block-bg);
}
#lib-search {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  background: var(--hover-bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s, background .15s;
  min-width: 0;
}
#lib-search::placeholder { color: var(--text-muted); opacity: .6; }
#lib-search:focus {
  border-color: var(--indigo);
  background: var(--block-bg);
}

/* Drag-to-reorder */
/* ── Ghosts — blocs actifs dans le workspace ────────────────── */
.lib-ghost {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 14px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.lib-ghost:hover {
  background: var(--lib-item-hover);
  border-color: var(--border);
}
.lib-ghost-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--indigo);
  flex-shrink: 0;
  opacity: .85;
}
.lib-ghost-title {
  flex: 1;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .75;
}
.lib-ghost:hover .lib-ghost-title { opacity: 1; }
.lib-ghost-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity .1s, background .1s;
  padding: 0;
}
.lib-ghost:hover .lib-ghost-btn { opacity: 1; }
.lib-ghost-btn:hover { background: var(--hover-bg); color: var(--text); }

/* Bouton œil (masquer / afficher) dans le header sidebar */
.btn-hide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  opacity: 0;
  cursor: pointer;
  border-radius: 3px;
  transition: opacity .15s, color .15s;
}
.block-header:hover .btn-hide {
  opacity: 1;
}
.btn-hide:hover {
  color: var(--text);
  background: var(--hover-bg);
}
.btn-hide.btn-hide-on {
  opacity: .55;
  color: var(--text-muted);
}

/* Icône inline dans le séparateur de catégorie */
.lib-cat-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
  opacity: .7;
  vertical-align: middle;
}

/* Section Masqués — apparence atténuée */
.lib-cat-label[data-cat="Masqués"] {
  opacity: .5;
}
.lib-cat-label[data-cat="Masqués"]:hover {
  opacity: .85;
}

/* Flash au clic sur un bloc actif */
@keyframes lib-flash {
  0%   { outline: 2px solid var(--indigo); outline-offset: 2px; }
  100% { outline: 2px solid transparent;  outline-offset: 6px; }
}
.lib-flash { animation: lib-flash .65s ease-out; }

/* ── Poignée de redimensionnement (bord droit) ──────────────── */
#lib-resize {
  position: absolute;
  top: 44px; right: 0; bottom: 0;
  width: 6px;
  cursor: ew-resize;
}
#lib-resize::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 3px;
  background: var(--indigo);
  border-radius: 2px 0 0 2px;
  opacity: 0;
  transition: opacity .2s;
}
#lib-sidebar:hover #lib-resize::after { opacity: .15; }
#lib-resize:hover::after,
#lib-resize:active::after { opacity: .7; }

/* ── Tab de toggle ──────────────────────────────────────────── */
#lib-tab {
  display: none;
}
#lib-tab.lib-anim {
  transition: left .28s cubic-bezier(.4,0,.2,1), color .15s, background .15s;
}
#lib-tab:hover {
  color: var(--indigo);
  background: var(--hover-bg);
}
.lib-arrow {
  flex-shrink: 0;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}

/* ── Bouton Feedback ────────────────────────────────────────────── */
#btn-feedback {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 11.5px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color .15s, border-color .15s;
}
#btn-feedback:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Feedback modal ─────────────────────────────────────────────── */
#feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;          /* caché par défaut — ne bloque ni scroll ni clics */
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
#feedback-overlay:not([hidden]) { display: flex; }
#feedback-overlay.feedback-visible { opacity: 1; }

#feedback-modal {
  background: var(--block-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 28px 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  position: relative;
}
/* Les thèmes avec --block-bg semi-transparent : fond plus opaque pour le modal feedback */
[data-theme="lishu"]  #feedback-modal { background: rgba(255, 250, 240, 0.93); }
[data-theme="glass"]  #feedback-modal { background: rgba(30, 39, 80, 0.90); }
[data-theme="aurora"] #feedback-modal { background: rgba(255, 248, 250, 0.92); }
[data-theme="forest"] #feedback-modal { background: rgba(240, 233, 219, 0.92); }

#feedback-close {
  position: absolute;
  top: 14px; right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: .5;
  transition: opacity .15s;
}
#feedback-close:hover { opacity: 1; }

.feedback-title {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  color: var(--text);
  margin: 0 0 6px;
}
.feedback-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

#feedback-text {
  width: 100%;
  box-sizing: border-box;
  background: var(--input-bg, var(--bg));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color .15s;
  line-height: 1.55;
}
#feedback-text:focus { border-color: var(--indigo); }
#feedback-text::placeholder { color: var(--text-muted); opacity: .55; }

#feedback-send {
  margin-top: 12px;
  width: 100%;
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s;
}
#feedback-send:hover:not(:disabled) { opacity: .88; }
#feedback-send:disabled { opacity: .45; cursor: default; }

#feedback-success {
  text-align: center;
  padding: 12px 0 4px;
}
.feedback-thanks {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: var(--text);
  margin: 0 0 6px;
}
.feedback-thanks-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Panier d'impression ──────────────────────────────────────── */
#btn-print-basket {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color .15s;
}
#btn-print-basket:hover { color: var(--text); }

#print-basket-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#print-basket-overlay[hidden] { display: none; }

#print-basket-modal {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.28);
  overflow: hidden;
  color: #1a1a2e;
}
html[data-theme="dark"] #print-basket-modal  { background: #1e1e2e; color: #e8e6f0; }
html[data-theme="glass"] #print-basket-modal { background: #1e2750; color: #e8e6f0; }
html[data-theme="warm"] #print-basket-modal  { background: #faf8f3; color: #2c2a22; }
html[data-theme="earth"] #print-basket-modal { background: #f5f0e8; color: #2c2a22; }

.pb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.pb-title {
  font-family: 'DM Serif Display', serif;
  font-size: 17px;
  color: inherit;
}
#pb-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}
#pb-close:hover { color: var(--text); background: var(--hover-bg); }

.pb-hint {
  font-size: 12px;
  color: #666;
  margin: 0;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  line-height: 1.5;
}
html[data-theme="dark"] .pb-hint,
html[data-theme="glass"] .pb-hint { color: #aaa; border-bottom-color: rgba(255,255,255,.08); }

.pb-hint-safari {
  background: rgba(220,160,0,.12);
  border-bottom: 1px solid rgba(180,130,0,.2);
  color: #7a5800;
  font-size: 12px;
}
html[data-theme="dark"] .pb-hint-safari,
html[data-theme="glass"] .pb-hint-safari { background: rgba(255,200,50,.1); color: #f0c040; border-bottom-color: rgba(255,200,50,.2); }

#pb-list {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}

.pb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background .1s;
}
.pb-row:hover { background: rgba(0,0,0,.04); }
html[data-theme="dark"] .pb-row:hover,
html[data-theme="glass"] .pb-row:hover { background: rgba(255,255,255,.06); }
.pb-row-empty { opacity: .45; cursor: default; }
.pb-row input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--indigo); flex-shrink: 0; }
.pb-row-empty input[type="checkbox"] { cursor: default; }
.pb-row span:nth-child(2) { flex: 1; font-size: 13px; color: inherit; }

.pb-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
  letter-spacing: .02em;
}

.pb-badge-ready  { background: rgba(112,176,128,.25); color: #5aaa6a; border: 1px solid rgba(112,176,128,.45); }
.pb-badge-empty  { background: var(--hover-bg); color: var(--text-muted); border: 1px solid transparent; }

.pb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  gap: 12px;
}
.pb-count {
  font-size: 12px;
  color: var(--text-muted);
}
#pb-print-btn {
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 18px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
#pb-print-btn:hover:not(:disabled) { opacity: .88; }
#pb-print-btn:disabled { opacity: .4; cursor: default; }

/* ── Catégorie (accordéon) ─────────────────────────────────── */
.lib-cat {
  margin: 2px 0;
}

.lib-cat-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 12px;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  transition: background .12s;
}
.lib-cat-header:hover { background: var(--hover-bg); }

.lib-cat-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;   /* casse normale (« Relationnel », plus « RELATIONNEL ») */
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  color: var(--text-muted);
  opacity: .8;
}

.lib-cat-count {
  font-size: 10px;
  color: var(--text-muted);
  opacity: .55;
  min-width: 12px;
  text-align: right;
}

.lib-cat-arrow {
  color: var(--text-muted);
  opacity: .5;
  flex-shrink: 0;
  transition: transform .2s ease;
}
.lib-cat.lib-cat-closed .lib-cat-arrow { transform: rotate(-90deg); }

/* Accordéon animé via CSS grid */
.lib-cat-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .22s ease;
}
.lib-cat.lib-cat-closed .lib-cat-body {
  grid-template-rows: 0fr;
}
.lib-cat-inner {
  overflow: hidden;
  min-height: 0;
  padding: 2px 4px 4px;
}


.lib-cat-empty {
  font-size: 11px;
  color: var(--text-muted);
  opacity: .6;
  text-align: center;
  padding: 10px 8px;
  font-style: italic;
}

/* ── Item module ───────────────────────────────────────────── */
.lib-item {
  padding: 6px 8px 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
  margin: 1px 0;
}
.lib-item:hover { background: var(--lib-item-hover); }

.lib-item-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Point coloré : visible uniquement si le bloc est ouvert */
.lib-item-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--indigo);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}
.lib-item.lib-item-active .lib-item-dot { opacity: .85; }

.lib-item-title {
  flex: 1;
  font-size: 12.5px;
  color: var(--text);
  opacity: .82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .12s;
}
.lib-item:hover .lib-item-title,
.lib-item.lib-item-active .lib-item-title { opacity: 1; }

/* Bouton étoile */
.lib-item-star {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity .12s, color .12s, transform .12s;
  border-radius: 3px;
}
.lib-item:hover .lib-item-star,
.lib-item-star.lib-item-star-on { opacity: 1; }
.lib-item-star:hover            { color: #e8a020; transform: scale(1.2); }
.lib-item-star.lib-item-star-on { color: #e8a020; }

/* Tags */
.lib-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
  padding-left: 10px;
}

.lib-tag {
  font-size: 9.5px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--indigo-l);
  color: var(--indigo);
  white-space: nowrap;
  opacity: .75;
}
.lib-item:hover .lib-tag { opacity: 1; }

/* ── Séparateurs de catégorie ───────────────────────────────── */
.lib-cat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  opacity: 0.4;
  padding: 14px 12px 5px;
  cursor: pointer;
  user-select: none;
}
.lib-cat-label:first-child { padding-top: 8px; }
.lib-cat-label:hover { opacity: 0.65; }
/* Chevron Lishu (#ico-chev-right, 2026-10-30) : tourné vers le bas quand la
   catégorie est ouverte, vers la droite quand elle est repliée. */
.lib-cat-chev {
  display: inline-flex;
  width: 14px; height: 14px;
  flex-shrink: 0;
  transform: rotate(90deg);
  transition: transform .15s;
}
.lib-cat-chev svg { width: 14px; height: 14px; display: block; }
.lib-cat-collapsed .lib-cat-chev { transform: rotate(0deg); }

/* ── Tooltip ───────────────────────────────────────────────── */
#lib-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  line-height: 1.45;
  padding: 6px 10px;
  border-radius: 7px;
  max-width: 220px;
  box-shadow: 0 3px 12px rgba(0,0,0,.22);
  white-space: normal;
  opacity: 0;
  transition: opacity .15s;
}
#lib-tooltip.lib-tooltip-visible { opacity: 1; }

/* ── Thème glass ────────────────────────────────────────────── */
[data-theme="glass"] #lib-tooltip {
  background: rgba(255,255,255,.92);
  color: #0a0b1a;
}
[data-theme="glass"] .lib-tag {
  background: rgba(142,184,255,.18);
  color: var(--indigo);
}

/* ── Onboarding : styles déménagés dans onboarding.css (2026-10-10) ── */

/* Mot de vacances du modal feedback (2026-08-14) : dévoilé automatiquement du
   8 au 26 septembre 2026 par le script du modal (index.html), masqué sinon. */
.feedback-vacances {
  font-size: 12.5px;
  color: var(--gold, #b8912f);
  margin: -6px 0 14px;
  line-height: 1.5;
}
