/* ====== Thème switch dans le profil ====== */
.theme-switch .theme-btn { flex: 1; }
.theme-switch .theme-btn:not(.is-active) { opacity: 0.5; }

/* ====== Dark theme ====== */
html.theme-dark {
  background: #1a1a2e;
  color-scheme: dark;
}
html.theme-dark body {
  background: #1a1a2e;
  color: #e0e0e0;
}
html.theme-dark .navbar,
html.theme-dark .navbar.is-link {
  background: #0f1e3d;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
html.theme-dark .card,
html.theme-dark .modal-card,
html.theme-dark .notification {
  background: #1e2a45;
  color: #e0e0e0;
}
html.theme-dark .card-header {
  background: #16213e;
}
html.theme-dark .card-header-title,
html.theme-dark .modal-card-title {
  color: #e0e0e0;
}
html.theme-dark .modal-card-head,
html.theme-dark .modal-card-foot {
  background: #16213e;
  border-color: #2a3a5e;
}
html.theme-dark .input,
html.theme-dark .textarea,
html.theme-dark .select select {
  background: #0f3460;
  border-color: #2a3a5e;
  color: #e0e0e0;
}
html.theme-dark .input::placeholder,
html.theme-dark .textarea::placeholder {
  color: #7a8baa;
}
html.theme-dark .table {
  background: transparent;
  color: #e0e0e0;
}
html.theme-dark .table th {
  color: #b0c4de;
  border-color: #2a3a5e;
}
html.theme-dark .table td {
  border-color: #2a3a5e;
}
html.theme-dark .fav-list-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.03);
}
html.theme-dark .fav-list-table tbody tr:hover {
  background: rgba(50,115,220,0.12);
}
html.theme-dark .tag.is-light:not(.fav-action-tag) {
  background: #2a3a5e;
  color: #c0d0e8;
}
html.theme-dark .button.is-light {
  background: #2a3a5e;
  color: #c0d0e8;
  border-color: #3a4a6e;
}
html.theme-dark .button.is-light:hover {
  background: #3a4a6e;
}
html.theme-dark .fav-row-notes,
html.theme-dark .fav-col-date,
html.theme-dark .fav-card-notes {
  color: #8899aa;
}
html.theme-dark a {
  color: #63b3ed;
}
html.theme-dark a:hover {
  color: #90cdf4;
}
html.theme-dark .fav-title-link {
  color: inherit;
}
html.theme-dark .fav-title-link:hover {
  color: #63b3ed;
}
html.theme-dark hr {
  background: #2a3a5e;
}
html.theme-dark .sidebar-pane {
  background: #16213e;
}
html.theme-dark .sidebar-toggle {
  background: #0f3460;
}
html.theme-dark .fab-new {
  background: #0f3460;
  box-shadow: 0 4px 16px rgba(15,52,96,0.6);
}
html.theme-dark .dropdown-content {
  background: #1e2a45;
  border-color: #2a3a5e;
}
html.theme-dark .dropdown-item {
  color: #e0e0e0;
}
html.theme-dark .dropdown-item:hover,
html.theme-dark .dropdown-item.is-active {
  background: #0f3460;
}
html.theme-dark footer.footer {
  background: #16213e;
  color: #7a8baa;
}
html.theme-dark .main-toolbar,
html.theme-dark .bulk-bar {
  background: #16213e;
  border-color: #2a3a5e;
}
html.theme-dark .fav-card-url-link {
  color: #63b3ed;
}
html.theme-dark .fav-card-foot.card-footer {
  border-color: #2a3a5e;
}

/* ====== Skeleton loading ====== */
@keyframes skeleton-pulse {
  0%   { opacity: 0.15; }
  50%  { opacity: 0.3; }
  100% { opacity: 0.15; }
}
.skeleton-line {
  height: 0.8rem;
  border-radius: 4px;
  background: currentColor;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
  margin-bottom: 0.4rem;
}
.skeleton-line.is-short { width: 40%; }
.skeleton-line.is-medium { width: 65%; }
.skeleton-line.is-long { width: 85%; }
.skeleton-tag {
  display: inline-block;
  width: 3.5rem;
  height: 1.4rem;
  border-radius: 4px;
  background: currentColor;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
  margin: 0.2rem 0.3rem 0.2rem 0;
}
.skeleton-card {
  border-radius: 6px;
  background: currentColor;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
  height: 140px;
  opacity: 0.12;
}

/* Favicon à côté du titre du favori (liste et carte) */
.fav-favicon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 2px;
  flex-shrink: 0;
}

/* La barre : fixed est fournie par Bulma (.navbar.is-fixed-top) — ne pas la remplacer par sticky. */
/* Layout pleine hauteur : scroll uniquement dans les volets Tags / Favoris */
html.has-navbar-fixed-top {
  box-sizing: border-box;
  height: 100%;
}
html.has-navbar-fixed-top body {
  box-sizing: border-box;
  height: 100%;
}
/*
 * Classe Bulma sur body : padding-top = hauteur nav. Sans hauteur bornée sur body, la colonne flex
 * dépasse le viewport et les panneaux ne se calent plus sous la nav.
 */
body.has-navbar-fixed-top {
  box-sizing: border-box;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
}
body {
  background:#f7f8fb;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  overflow: hidden;
}
main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
footer { flex-shrink:0; }
/* Navbar : Rubriques collé à gauche (navbar-brand), onglets + recherche */
.bookmarks-navbar-brand {
  display: flex;
  align-items: stretch;
}
.site-title.navbar-item {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: #fff !important;
  opacity: 0.9;
}
.site-title.navbar-item:hover {
  opacity: 1;
  background: transparent !important;
}
.bookmarks-navbar-brand .bookmarks-rubriques-item {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.bookmarks-navbar-menu {
  flex-wrap: wrap;
}
.bookmarks-navbar-start {
  flex: 1 1 auto;
  min-width: 0;
}
/* Menu déroulant des rubriques (choix de l’onglet / collection) */
.bookmarks-tab-dropdown .navbar-link {
  max-width: 14rem;
}
.bookmarks-tab-dropdown .navbar-link #tabsDropdownLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  max-width: 10rem;
  vertical-align: bottom;
}
.bookmarks-tab-dropdown .navbar-dropdown {
  max-height: min(70vh, 22rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.bookmarks-tab-dropdown .navbar-dropdown .navbar-item.is-active {
  background: #f0f4fa;
}
.navbar-item.navbar-search-slot .field.has-addons {
  flex-wrap: nowrap;
}
.navbar-item.navbar-search-slot .input {
  width: clamp(10rem, 22vw, 18rem);
  min-width: 8rem;
}
/* Modale paramètres (Administration + Rubriques + Import) */
.admin-modal-card {
  width: min(1040px, 96vw);
  max-height: calc(100vh - 1.5rem);
  display: flex;
  flex-direction: column;
}
.admin-modal-card .modal-card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
#adminModalTabs ul {
  flex-wrap: wrap;
}
.admin-modal-panel {
  min-height: 2rem;
}
/* Aperçu import HTML (liste scrollable dans la modale) */
.html-import-table-wrap {
  max-height: min(50vh, 420px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
}
.html-import-col-cb {
  width: 2.5rem;
  vertical-align: middle;
  text-align: center;
}
.html-import-tags-cell {
  max-width: 18rem;
  vertical-align: top;
}
.html-import-tags-cell .tag {
  font-size: 0.65rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.tabs-config-table input.input {
  font-size: 0.85rem;
}
.is-hidden { display:none !important; }
.nowrap { white-space:nowrap; }
.truncate { max-width:360px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Tableau favoris : largeurs stables + stripped */
.fav-list-table {
  table-layout: fixed;
  width: 100%;
}
.fav-list-table tbody tr:nth-child(even) {
  background: #f9fafb;
}
/* Colonne checkbox bulk (1ère) */
.bulk-cb-th, .bulk-cb-td {
  width: 2rem;
  text-align: center;
  vertical-align: middle;
}
/* Colonne étoile (2ème) */
.fav-list-table thead th:nth-child(2),
.fav-list-table tbody td:nth-child(2) {
  width: 2.25rem;
}
/* Colonne titre (3ème) */
.fav-list-table thead th:nth-child(3),
.fav-list-table tbody td:nth-child(3) {
  width: 28%;
  max-width: 28%;
  vertical-align: top;
}
/* Colonne URL (4ème) : tronquer */
.fav-list-table tbody td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
}
/* Colonne Tags (5ème) : ne pas déborder */
.fav-list-table tbody td:nth-child(5) {
  overflow: hidden;
  max-width: 0;
}
/* Colonne Actions (8ème, compact) */
.fav-list-table thead th:nth-child(8),
.fav-list-table tbody td:nth-child(8) {
  width: 3rem;
}
/* Bouton trigger actions en masse (à côté du select-all) */
.bulk-action-btn.button {
  padding: 0 0.4rem;
  height: 1.4rem;
  min-width: 1.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 10px;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.bulk-action-btn.is-hidden { display: none !important; }
/* Switch mode dans la modale bulk */
.bulk-mode-switch .bulk-mode-btn { flex: 1; }
.bulk-mode-switch .bulk-mode-btn:not(.is-active) { opacity: 0.5; }
.bulk-panel.is-hidden { display: none; }
.fav-row-title-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  margin-bottom: 0.15rem;
}
.fav-title-text {
  font-weight: 700;
}
/* Titre cliquable : apparence texte (hérite couleur), hover bleu souligné.
   Pas de truncation ici (gérée par le parent .fav-row-title-line / .fav-card-title-wrap). */
.fav-title-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.fav-title-link:hover {
  color: #3273dc;
  text-decoration: underline;
}
/* Picker des actions dans la modale d'édition : grille de checkboxes */
.fav-actions-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
}
.fav-action-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  user-select: none;
}
/* Badges d'actions sur les favoris (liste et cartes) */
.fav-actions-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.2rem;
  margin-bottom: 0.15rem;
}
.fav-action-tag.tag {
  font-weight: 600;
  letter-spacing: 0.01em;
}
/* Sélecteur de couleur pour les actions (Paramètres → Mes actions) */
.action-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-left: 0.25rem;
}
.action-color-swatch.tag {
  cursor: pointer;
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
}
.action-color-swatch.tag:hover {
  transform: scale(1.15);
}
.action-color-swatch.tag.is-selected {
  border-color: #363636;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #363636;
}
.user-action-row {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}
.fav-row-notes {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.35;
  font-size: 0.8rem;
  max-height: calc(1.35em * 2);
  min-height: calc(1.35em * 2);
  color: #7a7a7a;
}
.tag.is-clickable { cursor:pointer; }
.view-toggle .button.is-active { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); }
.grid-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:1rem; align-items:stretch; }
.card { height:100%; display:flex; flex-direction:column; }
.card-content { flex:1 1 auto; }
/* Bouton déclencheur de la modale recherche */
.search-trigger-btn {
  flex-shrink: 0;
  position: relative;
}
/* Modale de recherche avancée */
.search-modal-card {
  width: 520px;
  max-width: 95vw;
}
/* Bloc d'actions à droite du header Favoris : kind, recherche, vue list/cartes */
.fav-header-actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.fav-kind-dropdown {
  flex: 0 0 auto;
}
.fav-kind-trigger.button {
  font-weight: normal;
}
/* Masque l'X natif du type=search dans Chrome/Edge/Safari */
.search-modal-card input[type="search"]::-webkit-search-cancel-button,
.search-modal-card input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.search-modal-clear { color:#b5b5b5; }
.search-modal-clear:hover { color:#3273dc; }
/* Picker actions dans la modale recherche */
.search-actions-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.search-action-tag.tag {
  cursor: pointer;
  transition: opacity 0.15s;
  user-select: none;
}
.search-action-tag.tag.is-light {
  opacity: 0.55;
}
.search-action-tag.tag:not(.is-light) {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15);
}

/* FAB Nouveau : bouton rond flottant sticky en bas à droite */
.fab-new {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #3273dc;
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(50, 115, 220, 0.45), 0 2px 6px rgba(0,0,0,0.2);
  z-index: 28;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
}
.fab-new:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.fab-new:active {
  transform: scale(0.95);
}
.fab-new:focus-visible {
  outline: 2px solid #ffd43b;
  outline-offset: 3px;
}
.fab-new .icon .fas {
  font-size: 1.6rem;
}

/* Bouton d'ouverture/fermeture de la sidebar Tags.
   Position fixed : toujours entièrement visible et tactilement accessible.
   Collé au bord droit de la sidebar : viewport-left quand fermée, sidebar-right
   quand ouverte (desktop) ou viewport-right quand ouverte (mobile).
   Le chevron est mirroré en CSS via scaleX(-1) quand la sidebar est ouverte :
   > (fermée, invite à ouvrir) → < (ouverte, invite à fermer). */
.sidebar-toggle {
  position: fixed;
  /* Aligné verticalement avec le bouton "fermer" dans le header Tags
     (centre du header = haut sidebar 3.75rem + ~1.5rem demi-header). */
  top: calc(3.75rem + 1.5rem);
  left: 0;
  transform: translateY(-50%);
  height: 32px;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  z-index: 33;
  background: #3273dc;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0 0.4rem;
  box-shadow: 1px 1px 6px rgba(0,0,0,0.2);
  transition: left 0.25s ease, background 0.2s, border-radius 0.25s ease;
  touch-action: manipulation;
}
.sidebar-toggle-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}
.sidebar-toggle .icon { transition: transform 0.2s ease; }
.sidebar-toggle.is-open .icon { transform: scaleX(-1); }
.sidebar-toggle .icon .fas { font-size: 0.75rem; }
.sidebar-toggle:hover { filter: brightness(1.1); }
.sidebar-toggle:active { filter: brightness(0.92); }
.sidebar-toggle:focus-visible {
  outline: 2px solid #ffd43b;
  outline-offset: 2px;
}
.sidebar-toggle.is-open {
  background: #b5b5b5;
}
/* Sidebar ouverte : le bouton flottant disparaît, la fermeture se fait via
   le bouton "tags-sidebar-close" dans le header Tags (à côté de l'épingle). */
.sidebar-toggle.is-open {
  display: none;
}
.tags-sidebar-head .tags-sidebar-close {
  flex-shrink: 0;
}
/* Desktop/tablet ouverte : bouton au bord droit de la sidebar (sort vers la zone Favoris). */
@media (min-width: 769px) {
  .sidebar-toggle.is-open {
    left: clamp(300px, 35%, 520px);
  }
}
/* Mobile ouverte : sidebar pleine largeur, bouton collé au bord droit du viewport. */
@media (max-width: 768px) {
  .sidebar-toggle.is-open {
    left: calc(100vw - 44px);
    border-radius: 10px 0 0 10px;
  }
}
/* Backdrop mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 31;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.sidebar-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 769px) {
  .sidebar-backdrop { display: none; }
}
/* Etoile */
.star-btn { background: none; border: none; padding: 0; cursor: pointer; }
.star-on { color: #ffb400; }
.star-off { color: #b5b5b5; }
/* Entête triable */
.th-sort { cursor:pointer; user-select:none; }
.th-sort .tri { font-size: 12px; margin-left:4px; color:#7a7a7a; }
.th-sort:hover .tri { color:#4a4a4a; }
.th-sort.is-active { color:#3273dc; }
.th-sort.is-active .tri { color:#3273dc; opacity:1; }
/* Zone principale : limiter les marges Bulma (section + container) */
.bookmarks-main.section {
  padding-left: 5px;
  padding-right: 5px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0.5rem;
}
.bookmarks-main .container.is-fluid {
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
  max-width: none;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
footer.footer .container.is-fluid {
  padding-left: 5px;
  padding-right: 5px;
}
/* Sidebar Tags en overlay (layer) au-dessus du main pane.
   Mobile : 100% de la largeur. Tablet/desktop : ~35% (min 300, max 520). */
.main-split {
  display: block;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
}
body.has-navbar-fixed-top .main-split {
  height: 100%;
  max-height: 100%;
}
.sidebar-pane {
  position: fixed;
  /* Aligné sur le haut de la toolbar (navbar 3.25rem + section pt-2 0.5rem) */
  top: calc(3.25rem + 0.5rem);
  left: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  z-index: 32;
  background: #fff;
  box-shadow: 2px 0 14px rgba(0,0,0,0.18);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.sidebar-pane.is-open {
  transform: translateX(0);
}
@media (min-width: 769px) {
  .sidebar-pane {
    width: var(--sidebar-width, 35%);
    min-width: 240px;
    max-width: 40vw;
  }
}
/* Ancien redimensionneur de split (au cas où le DOM en garde un) : caché. */
.split-resizer { display: none !important; }

/* Poignée de redimensionnement de la sidebar Tags (desktop/tablet uniquement).
   Fine et discrète, à mi-hauteur sur le bord droit, hit-area élargi pour le tactile. */
.sidebar-resizer {
  display: none;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(50%, -50%);
  width: 14px;
  height: 80px;
  cursor: col-resize;
  z-index: 4;
  touch-action: none;
  user-select: none;
  align-items: center;
  justify-content: center;
}
.sidebar-resizer::before {
  content: '';
  width: 4px;
  height: 56px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  transition: background 0.15s ease, height 0.15s ease;
}
.sidebar-resizer:hover::before,
.sidebar-resizer:focus-visible::before,
.sidebar-resizer.is-dragging::before {
  background: #3273dc;
  height: 80px;
}
.sidebar-resizer:focus-visible {
  outline: none;
}
@media (min-width: 769px) {
  .sidebar-pane.is-open .sidebar-resizer { display: flex; }
}
/* Pendant le redimensionnement : on désactive les transitions pour un drag fluide. */
body.is-resizing,
body.is-resizing .sidebar-pane,
body.is-resizing .bookmarks-main .container.is-fluid {
  transition: none !important;
}

.main-pane {
  width: 100%;
  flex: 1 1 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
}
/* Cartes : en-tête fixe, corps scrollable indépendamment */
.sidebar-pane > .card,
.main-pane > .card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
}
.sidebar-pane > .card > .card-header,
.main-pane > .card > .card-header {
  flex-shrink: 0;
  /* Au-dessus du .card-content scrollable : sinon le contenu recouvre l’ombre Bulma du header */
  position: relative;
  z-index: 1;
}
.sidebar-pane > .card > .card-content,
.main-pane > .card > .card-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* Nuage de tags par lettre */
.tag-cloud-root { width: 100%; }
.tag-alpha-section { margin-bottom: 0.75rem; }
.tag-alpha-section:last-child { margin-bottom: 0; }
.tag-alpha-heading {
  font-weight: 700;
  color: #3273dc;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e1e6ef;
  padding-bottom: 3px;
  margin-bottom: 0.4rem !important;
}
/* Actions liste : boutons toujours côte à côte */
/* Colonnes dates (Créé le / Modifié le) — masquées sur mobile */
.fav-col-date {
  white-space: nowrap;
  font-size: 0.75rem;
  color: #7a7a7a;
  width: 6.5rem;
}
@media (max-width: 768px) {
  .fav-col-date { display: none !important; }
}
.fav-actions-th { width: 1%; white-space: nowrap; }
.fav-actions-cell {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  text-align: right !important;
}
.fav-row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}
/* Lien URL desktop : icône cachée, texte visible */
.fav-url-icon { display: none; }
/* === Vue liste responsive : sur mobile chaque ligne devient un bloc 2 lignes ===
   Ligne 1 : étoile + titre (étendu sur 2 colonnes pour plus de place)
   Ligne 2 : bouton "voir" (URL) + tags scrollables + bouton edit (bas-droite) */
@media (max-width: 768px) {
  .fav-list-table {
    table-layout: auto;
    display: block;
    width: 100%;
  }
  .fav-list-table thead { display: none; }
  .fav-list-table tbody { display: block; }
  .fav-list-table tr {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "star title title"
      "url  tags  actions";
    column-gap: 0.5rem;
    row-gap: 0.4rem;
    align-items: center;
    padding: 0.55rem 0.5rem;
    border-bottom: 1px solid #e5e9f2;
    width: auto;
  }
  .fav-list-table td {
    padding: 0;
    border: none;
    display: block;
    width: auto !important;
    max-width: none !important;
    vertical-align: middle;
  }
  /* Masquer la colonne checkbox sur mobile */
  .bulk-cb-th, .bulk-cb-td { display: none !important; }
  /* nth-child décalé de +1 par rapport à avant (checkbox = 1er) */
  .fav-list-table tbody td:nth-child(2) { grid-area: star; }
  .fav-list-table tbody td:nth-child(3) {
    grid-area: title;
    min-width: 0;
  }
  /* URL devient un bouton "voir" : icône externe seule */
  .fav-list-table tbody td:nth-child(4) {
    grid-area: url;
  }
  .fav-list-table tbody td:nth-child(4) .fav-url-text {
    display: none;
  }
  .fav-list-table tbody td:nth-child(4) .fav-url-icon {
    display: inline-flex;
  }
  .fav-list-table tbody td:nth-child(4) .fav-url-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #f0f2f7;
    color: #4a4a4a;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s;
  }
  .fav-list-table tbody td:nth-child(4) .fav-url-link:hover {
    background: #e0e4ee;
    color: #3273dc;
  }
  /* Tags : scroll horizontal */
  .fav-list-table tbody td:nth-child(5) {
    grid-area: tags;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .fav-list-table tbody td:nth-child(5)::-webkit-scrollbar { height: 3px; }
  .fav-list-table tbody td:nth-child(5)::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
  }
  .fav-list-table tbody td:nth-child(5) .tag {
    display: inline-flex;
    margin-right: 0.25rem !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
  }
  /* Bouton edit bas-droite (8ème colonne avec checkbox+dates) */
  .fav-list-table tbody td:nth-child(8) {
    grid-area: actions;
    text-align: right;
  }
  /* Notes plus compactes sur mobile (1 ligne au lieu de 2) */
  .fav-row-notes {
    min-height: 0;
    -webkit-line-clamp: 1;
    max-height: 1.35em;
  }
  /* Pas de scroll horizontal sur le wrapper : tout doit tenir dans la largeur */
  #viewList .table-container {
    overflow: visible;
  }
  /* Modale d'édition : footer empilé sur mobile pour Supprimer + Fermer visibles */
  .fav-edit-foot.modal-card-foot {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .fav-edit-actions-left,
  .fav-edit-actions-right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  /* Marges compactes du card-content sur mobile (sidebar Tags + main Favoris) */
  .sidebar-pane > .card > .card-content,
  .main-pane > .card > .card-content {
    padding: 0.5rem 0.5rem;
  }
  /* Idem pour le card-header : padding réduit sur mobile */
  .main-pane > .card > .card-header,
  .sidebar-pane > .card > .card-header {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .main-pane > .card > .card-header .card-header-title,
  .sidebar-pane > .card > .card-header .card-header-title {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}
/* Wrapper actions footer modale : flex avec gap (toutes tailles d'écran) */
.fav-edit-actions-left,
.fav-edit-actions-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* Vue cartes */
.fav-card {
  display: flex;
  flex-direction: column;
}
.fav-card-head.card-header {
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.fav-card-title-wrap.card-header-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-right: 0.75rem;
}
.fav-card-kind {
  flex-shrink: 0;
}
.fav-card-star {
  flex-shrink: 0;
}
.fav-card-title-link {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fav-card-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Contenu de la carte */
.fav-card-body.card-content {
  flex: 1 1 auto;
  padding: 0.75rem 1rem;
}
.fav-card-url {
  margin-bottom: 0.3rem;
}
.fav-card-url-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: #3273dc;
}
.fav-card-notes {
  font-size: 0.8rem;
  color: #7a7a7a;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  margin-bottom: 0.3rem;
}
/* Actions et tags : ligne unique scrollable */
.fav-card-actions-line,
.fav-card-tags-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  margin-top: 0.35rem;
}
.fav-card-actions-line::-webkit-scrollbar,
.fav-card-tags-line::-webkit-scrollbar { height: 3px; }
.fav-card-actions-line::-webkit-scrollbar-thumb,
.fav-card-tags-line::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 2px;
}
.fav-card-actions-line .tag,
.fav-card-tags-line .tag {
  flex-shrink: 0;
}
/* Footer carte : bouton edit discret, aligné à droite */
.fav-card-foot.card-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid #ededed;
  background: transparent;
}
.fav-card-edit-btn.button {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  height: auto;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.fav-card:hover .fav-card-edit-btn.button {
  opacity: 1;
}
/* Favoris : titre à gauche, filtres tags à droite avec scroll horizontal si besoin */
.main-pane > .card > .card-header.fav-main-card-head {
  flex-direction: column;
  align-items: stretch;
}
.fav-main-card-head-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}
/* Sélecteur de rubrique dans le header Favoris (même pattern que kind) */
.fav-rubrique-dropdown {
  flex: 0 0 auto;
}
.fav-rubrique-trigger.button {
  font-weight: normal;
}
.fav-rubrique-dropdown .dropdown-menu {
  padding-top: 0;
}
.fav-rubrique-dropdown .dropdown-content {
  max-height: 60vh;
  overflow-y: auto;
}
/* Mobile : on n'affiche que l'icône (pas le label) pour les dropdowns rubrique et type */
@media (max-width: 768px) {
  .fav-rubrique-trigger .fav-rubrique-label,
  .fav-kind-trigger .fav-kind-label {
    display: none;
  }
  /* Menus déroulants Rubrique/Type : sur mobile le trigger n'est pas au bord
     droit du viewport (search + view-toggle sont à sa droite), donc is-right
     ferait déborder le menu à gauche. On force l'ouverture vers la droite
     (default Bulma) pour que le menu reste collé au trigger ET dans le viewport. */
  .fav-rubrique-dropdown.is-right .dropdown-menu,
  .fav-kind-dropdown.is-right .dropdown-menu {
    left: 0;
    right: auto;
    max-width: calc(100vw - 1rem);
  }
}
.fav-header-active-tags {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.fav-header-active-tags.is-hidden {
  display: none !important;
}
.fav-header-filter-tag.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25em 0.45em 0.25em 0.55em;
  max-width: none;
}
.fav-header-filter-tag .delete {
  margin-left: 0.4rem;
  flex-shrink: 0;
  position: relative;
  background: rgba(0,0,0,0.12);
}
.fav-header-filter-tag .delete:hover {
  background: rgba(0,0,0,0.22);
}
/* Panneau latéral Tags : titre + bouton dans le header */
.tags-sidebar-head.card-header {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.tags-sidebar-head .card-header-title {
  margin-bottom: 0 !important;
  flex: 1 1 auto;
  min-width: 0;
}
.tags-sidebar-head .tags-sidebar-clear {
  flex-shrink: 0;
}
/* Sur desktop/tablet : mode push permanent — quand la sidebar est ouverte,
   le contenu Favoris est décalé vers la droite (pas d'overlay, pas d'ombre).
   Sur mobile : la sidebar reste un overlay pleine largeur par-dessus. */
.bookmarks-main .container.is-fluid {
  transition: padding-left 0.25s ease;
}
@media (min-width: 769px) {
  body.sidebar-is-open .bookmarks-main .container.is-fluid {
    padding-left: var(--sidebar-width, 35%);
  }
  .sidebar-pane {
    box-shadow: none;
  }
}
/* Toggle vue liste/cartes dans le header Favoris (dans .fav-header-actions) */
.fav-main-view-toggle {
  flex-shrink: 0;
}
.fav-main-view-toggle .buttons {
  margin-bottom: 0;
}
.fav-main-view-toggle .buttons .button {
  margin-bottom: 0;
}
/* OU / ET : interrupteur dans le header Tags */
.tags-logic-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  user-select: none;
}
.tags-logic-side {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #b5b5b5;
  min-width: 1.25rem;
  text-align: center;
  transition: color 0.15s;
}
.tags-logic-side.is-active {
  color: #3273dc;
}
.tags-logic-switch-label {
  position: relative;
  display: inline-block;
  width: 2.6rem;
  height: 1.4rem;
  flex-shrink: 0;
  cursor: pointer;
}
.tags-logic-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.tags-logic-track {
  position: absolute;
  inset: 0;
  background: #dfe4ec;
  border-radius: 999px;
  transition: background 0.2s;
}
.tags-logic-track::after {
  content: '';
  position: absolute;
  width: 1.12rem;
  height: 1.12rem;
  left: 0.14rem;
  top: 0.14rem;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: transform 0.2s ease;
}
.tags-logic-input:checked + .tags-logic-track {
  background: #a8c4f0;
}
.tags-logic-input:checked + .tags-logic-track::after {
  transform: translateX(1.2rem);
}
.tags-logic-input:focus-visible + .tags-logic-track {
  outline: 2px solid #3273dc;
  outline-offset: 2px;
}
/* Modale création / édition favori : plus large et plus haute */
#editModal.modal .modal-card.fav-edit-modal-card {
  width: min(960px, 94vw);
  max-width: min(960px, 94vw);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}
#editModal .modal-card.fav-edit-modal-card .modal-card-head,
#editModal .modal-card.fav-edit-modal-card .modal-card-foot {
  flex-shrink: 0;
}
#editModal .modal-card.fav-edit-modal-card .modal-card-body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: min(420px, calc(100vh - 14rem));
}
#editModal .modal-card.fav-edit-modal-card #favNotes {
  min-height: 12rem;
}
/* Sélecteur de type (icônes) dans la modale favori */
.fav-kind-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: stretch;
}
.fav-kind-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 4.5rem;
  padding: 0.4rem 0.35rem !important;
  height: auto !important;
  font-size: 0.75rem;
  line-height: 1.15;
}
.fav-kind-btn .icon {
  font-size: 1.1rem;
  margin: 0 !important;
}
/* État sélectionné : fond sombre + texte clair (évite blanc sur bleu très pâle avec .is-link) */
#editModal .fav-kind-btn.is-active.button,
#editModal .fav-kind-btn.is-active.button.is-link {
  background: #2c3e50 !important;
  color: #f5f7fa !important;
  border-color: #2c3e50 !important;
  box-shadow: inset 0 0 0 2px #1a252f;
}
#editModal .fav-kind-btn.is-active .icon,
#editModal .fav-kind-btn.is-active span {
  color: inherit !important;
}
