/* ============================================================
   Tutoriels — tutos.html, tuto.php et aperçu de l'éditeur
   ------------------------------------------------------------
   Côté public, chargée après css/styles.css (variables, Bootstrap)
   et css/outils.css (.tool-tag, .mono-label, .guard-list).

   Le back-office la charge aussi pour l'aperçu de l'éditeur
   (admin/tutos-edit.php), sans Bootstrap ni police d'icônes et
   avec un reset qui met toutes les marges à zéro : tout ce qui
   sert au corps d'un tuto (.tuto-body et ce qu'il contient) doit
   donc fixer ses propres marges et ne dépendre que des variables
   ci-dessous. Elle est servie même site bloqué (section 10 du
   .htaccess racine), comme java/tuto.js.
   ============================================================ */

.tuto-body,
.tuto-page {
  --tuto-mono: 'Fragment Mono', 'Consolas', monospace;
  --tuto-ok: #00C758;
  --tuto-warn: #FE6E00;
  --tuto-danger: #FB2C36;
  --tuto-info: #0ea5e9;
}

/* ── Icônes SVG dessinées par java/tuto.js ── */
.ti {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
}

.tuto-accent { color: var(--primary, #FE6E00); }
.tuto-copie-tampon { position: fixed; top: -1000px; left: 0; opacity: 0; }

/* ── Couleur de chaque thème ── */
.cat-linux  { --cat: #0ea5e9; }
.cat-cyber  { --cat: #FE6E00; }
.cat-reseau { --cat: #14b8a6; }
.cat-dev    { --cat: #6366f1; }
.tool-tag.tag-net { border-color: #14b8a6; color: #14b8a6; }

/* ── Niveau : trois carrés ── */
.lvl { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.lvl .sq {
  width: 7px; height: 7px;
  border: 1px solid var(--primary, #FE6E00);
  display: inline-block;
}
.lvl[data-level="1"] .sq:nth-child(-n+1),
.lvl[data-level="2"] .sq:nth-child(-n+2),
.lvl[data-level="3"] .sq { background: var(--primary, #FE6E00); }
.lvl .lvl-txt { margin-left: 5px; }

.badge-new {
  font-family: var(--tuto-mono, monospace);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--primary, #FE6E00);
  color: #FAF9F6;
  padding: 2px 7px;
  white-space: nowrap;
}

/* ============================================================
   Corps d'un tuto (public + aperçu)
   ============================================================ */
.tuto-body { max-width: 800px; color: var(--text); }
.tuto-body [hidden] { display: none !important; }

.tuto-prose p,
.tuto-prose li { font-size: 1rem; line-height: 1.7; }
.tuto-prose p { margin: 0 0 1rem; }
.tuto-prose ul,
.tuto-prose ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.tuto-prose ul { list-style: disc; }
.tuto-prose ol { list-style: decimal; }
.tuto-prose li { margin: 0 0 0.3rem; }
.tuto-prose li > ul,
.tuto-prose li > ol { margin: 0.3rem 0 0; }
.tuto-prose h3,
.tuto-prose h4,
.tuto-prose h5,
.tuto-prose h6 { font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.tuto-prose h3 { font-size: 1.15rem; margin: 1.5rem 0 0.6rem; }
.tuto-prose h4 { font-size: 1.02rem; margin: 1.25rem 0 0.5rem; }
.tuto-prose h5,
.tuto-prose h6 { font-size: 0.95rem; margin: 1rem 0 0.4rem; }
.tuto-prose a { color: var(--primary, #FE6E00); text-underline-offset: 2px; }
.tuto-prose a:hover { text-decoration: none; }
.tuto-prose strong { font-weight: 700; }
.tuto-prose em { font-style: italic; }
.tuto-prose del { color: var(--muted); }
.tuto-prose hr { border: 0; border-top: 1px solid var(--border-color); margin: 1.5rem 0; opacity: 1; }
.tuto-prose blockquote {
  margin: 0 0 1rem;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 3px solid var(--primary, #FE6E00);
  color: var(--muted);
}
.tuto-prose blockquote p:last-child { margin-bottom: 0; }
.tuto-prose > :last-child { margin-bottom: 0; }

.tuto-body :not(pre) > code {
  font-family: var(--tuto-mono);
  font-size: 0.86em;
  color: var(--text);
  background: rgba(236, 218, 162, 0.28);
  border: 0;
  border-radius: 0;
  padding: 1px 5px;
  word-break: break-word;
}
html.dark .tuto-body :not(pre) > code,
.tuto-apercu:not(.clair) .tuto-body :not(pre) > code { background: rgba(236, 218, 162, 0.1); }

.tuto-body kbd {
  font-family: var(--tuto-mono);
  font-size: 0.8em;
  color: var(--text);
  background: var(--card-bg, transparent);
  border: 1px solid var(--border-color);
  border-bottom-width: 2px;
  padding: 1px 6px;
  border-radius: 0;
  box-shadow: none;
}
.tuto-body var { font-style: normal; }

.tuto-figure { margin: 1.25rem 0; }
.tuto-figure a { display: block; }
.tuto-figure img,
.tuto-prose p img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
}
.tuto-prose p img { display: inline-block; vertical-align: middle; }
.tuto-figure figcaption {
  font-family: var(--tuto-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.tuto-table { overflow-x: auto; margin: 1rem 0; }
.tuto-table table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tuto-table th,
.tuto-table td {
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.tuto-table th {
  font-family: var(--tuto-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.tuto-task { display: inline-flex; margin-right: 0.4rem; color: var(--muted); }
.tuto-task.fait { color: var(--tuto-ok); }
.tuto-prose li:has(> .tuto-task) { list-style: none; margin-left: -1.2rem; }

/* ── Encadrés « Ce qu'il vous faut » / « Adapter les commandes » ── */
.tuto-box {
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.25rem;
}
.tuto-box h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.9rem;
  color: var(--text);
}
.tuto-box h2 .ti { color: var(--primary, #FE6E00); }
.tuto-muted { color: var(--muted); font-size: 0.88rem; margin: 0 0 1rem; }

/* Listes cochées : prérequis et « Ce qui est en place » */
.tuto-checklist ul { list-style: none; padding-left: 0; }
.tuto-checklist ul > li { position: relative; padding-left: 1.7rem; margin-bottom: 0.55rem; }
.tuto-checklist ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 1.05em;
  height: 1.05em;
  background: var(--tuto-ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='16.5 9 10.5 15 7.5 12'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='16.5 9 10.5 15 7.5 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tuto-checklist ul ul > li::before { background: var(--muted); }

.tuto-vars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
}
.tuto-var { display: flex; flex-direction: column; gap: 0.3rem; margin: 0; }
.tuto-var span {
  font-family: var(--tuto-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.tuto-var input {
  width: 100%;
  font-family: var(--tuto-mono);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--input-bg, transparent);
  border: 1px solid var(--input-border, var(--border-color));
  border-radius: 0;
  padding: 0.45rem 0.7rem;
  outline: none;
}
.tuto-var input:focus { border-color: var(--primary, #FE6E00); }

/* ── Étapes ── */
.tuto-step {
  padding: 2.25rem 0 2rem;
  border-top: 1px solid var(--border-color);
  scroll-margin-top: 80px;
}
#prerequis,
#fin { scroll-margin-top: 96px; }
@media (max-width: 991.98px) {
  .tuto-page .tuto-step,
  .tuto-page #prerequis,
  .tuto-page #fin { scroll-margin-top: 136px; }
}
.tuto-step-head { display: flex; align-items: flex-start; gap: 1rem; margin: 0 0 1rem; }
.tuto-step-num {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--primary, #FE6E00);
  color: var(--primary, #FE6E00);
  font-family: var(--tuto-mono);
  font-size: 1.15rem;
  font-weight: 700;
  transition: background 200ms ease, color 200ms ease;
}
.tuto-step.is-done .tuto-step-num { background: var(--primary, #FE6E00); color: #FAF9F6; }
.tuto-step-head h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0.15rem 0 0.25rem;
  color: var(--text);
}
.tuto-step-where {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--tuto-mono);
  font-size: 0.7rem;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.tuto-step-where .ti { color: var(--primary, #FE6E00); }
.tuto-step-body,
.tuto-step-foot { padding-left: calc(52px + 1rem); }
@media (max-width: 575.98px) {
  .tuto-step-body,
  .tuto-step-foot { padding-left: 0; }
  .tuto-step-num { width: 42px; height: 42px; font-size: 1rem; }
  .tuto-step-head h2 { font-size: 1.2rem; }
}
/* Le pied d'étape est un <footer> : styles.css trace un trait au-dessus de
   tout footer. Écrit ici pour que l'aperçu du back-office soit identique. */
.tuto-step-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  background: transparent;
  color: inherit;
}
.tuto-step-done {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.tuto-step-done:hover { border-color: var(--primary, #FE6E00); }
.tuto-step-done[aria-pressed="true"],
.tuto-step-done[aria-pressed="true"]:hover {
  background: var(--primary, #FE6E00);
  border-color: var(--primary, #FE6E00);
  color: #FAF9F6;
}
.tuto-step-next {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--tuto-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.tuto-step-next:hover { color: var(--primary, #FE6E00); }

/* ── Blocs de code : toujours sombres, façon terminal ── */
.code-block {
  background: #171717;
  border: 1px solid #171717;
  color: #FAF9F6;
  margin: 1rem 0;
}
html.dark .code-block,
.tuto-apercu:not(.clair) .code-block { background: #0b0b0a; border-color: var(--border-color); }
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 36px;
  padding: 0 0.4rem 0 0.85rem;
  border-bottom: 1px solid rgba(250, 249, 246, 0.12);
  font-family: var(--tuto-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a3a394;
}
.code-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.code-label .ti { color: var(--primary, #FE6E00); }
.code-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(250, 249, 246, 0.22);
  border-radius: 0;
  color: #FAF9F6;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  padding: 3px 9px;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}
.code-copy:hover { border-color: var(--primary, #FE6E00); color: var(--primary, #FE6E00); }
.code-copy.copied { border-color: var(--tuto-ok); color: var(--tuto-ok); }
.code-tabs { display: flex; align-self: stretch; min-width: 0; overflow-x: auto; }
.code-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #a3a394;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  padding: 0 10px;
  white-space: nowrap;
  cursor: pointer;
}
.code-tab:first-child { margin-left: -10px; }
.code-tab:hover { color: #FAF9F6; }
.code-tab.active { color: #FAF9F6; border-bottom-color: var(--primary, #FE6E00); }
.code-block pre {
  margin: 0;
  padding: 0.95rem 1rem;
  overflow-x: auto;
  font-family: var(--tuto-mono);
  font-size: 0.84rem;
  line-height: 1.7;
  color: #FAF9F6;
  background: transparent;
  border: 0;
  white-space: pre;
  scrollbar-color: #4a4a40 transparent;
  scrollbar-width: thin;
}
.code-block pre code {
  color: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  border: 0;
  white-space: inherit;
}
.code-block .prompt { color: var(--primary, #FE6E00); user-select: none; margin-right: 0.6ch; }
.code-block .out { color: #a3a394; }
.code-block .com { color: #7c7c6c; font-style: italic; }
.code-block .key { color: #7dd3fc; }
.code-block var {
  font-style: normal;
  color: #FFB066;
  border-bottom: 1px dashed rgba(254, 110, 0, 0.7);
}
.code-block.is-output { background: transparent; border: 1px dashed var(--border-color); color: var(--text); }
.code-block.is-output .code-head { border-bottom: 1px dashed var(--border-color); color: var(--muted); }
.code-block.is-output .code-label .ti { color: var(--tuto-ok); }
.code-block.is-output pre { color: var(--text); }
.code-block.is-output .out { color: var(--muted); }
.code-block.is-output var { color: inherit; }

/* ── Encadrés astuce / attention / stop / info ── */
.callout {
  --c: var(--tuto-info);
  display: flex;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  margin: 1.1rem 0;
  border: 1px solid var(--c);
  border-left-width: 4px;
  background: color-mix(in srgb, var(--c) 6%, transparent);
  font-size: 0.94rem;
  line-height: 1.6;
}
.callout > .ti { color: var(--c); font-size: 1.15rem; margin-top: 0.15rem; }
.callout-body { min-width: 0; flex: 1; }
.callout-body p,
.callout-body li { font-size: 0.94rem; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-title {
  display: block;
  font-family: var(--tuto-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c);
  margin-bottom: 0.15rem;
}
.callout-tip    { --c: var(--tuto-ok); }
.callout-warn   { --c: var(--tuto-warn); }
.callout-danger { --c: var(--tuto-danger); }
.callout-info   { --c: var(--tuto-info); }

/* ── Bloc dépliable ── */
.tuto-details { border: 1px solid var(--border-color); margin: 1rem 0; }
.tuto-details summary {
  cursor: pointer;
  padding: 0.65rem 1rem;
  font-family: var(--tuto-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}
.tuto-details summary:hover { color: var(--primary, #FE6E00); }
.tuto-details[open] summary { border-bottom: 1px solid var(--border-color); }
.tuto-details-body { padding: 1rem; }
.tuto-details-body > :last-child { margin-bottom: 0; }
.tuto-details-body .tuto-table { margin: 0; }

/* ── Fin du tuto ── */
.tuto-end { border-top: 1px solid var(--border-color); padding-top: 2.25rem; }
.tuto-done-box,
.tuto-remain-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.5rem;
}
.tuto-done-box { border: 1px solid var(--tuto-ok); background: rgba(0, 199, 88, 0.06); }
.tuto-done-box > .ti { color: var(--tuto-ok); font-size: 1.8rem; }
.tuto-done-box strong { display: block; }
.tuto-done-box span { color: var(--muted); font-size: 0.88rem; }
.tuto-remain-box { border: 1px dashed var(--border-color); color: var(--muted); font-size: 0.92rem; }
.tuto-remain-box > .ti { color: var(--primary, #FE6E00); font-size: 1.4rem; }
.tuto-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--primary, #FE6E00);
  padding-bottom: 0.4rem;
  margin: 1.5rem 0 1.25rem;
  display: inline-block;
}
.tuto-end > .tuto-section-title:first-child,
.tuto-end > [hidden] + [hidden] + .tuto-section-title { margin-top: 0; }

/* ============================================================
   Page d'un tuto (tuto.php)
   ============================================================ */
.tuto-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem) !important;
  max-width: 22ch;
}
.tuto-hero .lead { max-width: 62ch; }
.tuto-cover {
  border: 1px solid var(--border-color);
  background: var(--bg);
}
.tuto-cover img { display: block; width: 100%; height: auto; }
.tuto-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  margin: 1.75rem 0 0;
  max-width: 860px;
}
.tuto-meta-strip > div { flex: 1 1 140px; background: var(--bg); padding: 0.65rem 1rem; }
.tuto-meta-strip dt {
  font-family: var(--tuto-mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.tuto-meta-strip dd { margin: 0; font-weight: 600; font-size: 0.92rem; }

/* Colonne latérale */
.tuto-aside { position: sticky; top: 96px; }
.tuto-progress-box {
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.tuto-progress-box .progress { margin: 0.5rem 0 0.75rem; }
.tuto-progress-num {
  font-family: var(--tuto-mono);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
}
.tuto-progress-num small { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.link-reset {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--tuto-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-reset:hover { color: var(--primary); }

.tuto-steps-nav { border-left: 1px solid var(--border-color); }
.tuto-steps-nav a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.42rem 0.75rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.87rem;
  line-height: 1.35;
}
.tuto-steps-nav a:hover { color: var(--text); }
.tuto-steps-nav a.is-current { color: var(--text); border-left-color: var(--primary); font-weight: 600; }
.tuto-steps-nav .sn {
  font-family: var(--tuto-mono);
  font-size: 0.72rem;
  color: var(--primary);
  min-width: 1.6em;
  flex-shrink: 0;
}
.tuto-steps-nav a.is-done .sn { color: var(--tuto-ok); }

/* Barre mobile : progression collée sous la navbar */
.tuto-mobilebar {
  position: sticky;
  top: 72px;
  z-index: 20;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(4px);
}
.tuto-mobilebar summary {
  list-style: none;
  cursor: pointer;
  padding: 0.6rem 16px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.tuto-mobilebar summary::-webkit-details-marker { display: none; }
.tuto-mobilebar summary .mono-label { margin: 0; flex-shrink: 0; color: var(--primary); }
.tuto-mobilebar summary .cur { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tuto-mobilebar summary .bi { transition: transform 150ms ease; }
.tuto-mobilebar[open] summary .bi { transform: rotate(180deg); }
.tuto-mobilebar .progress { height: 3px; }
.tuto-mobilebar .tuto-steps-nav { border-left: 0; padding: 0.25rem 0 0.75rem; max-height: 60vh; overflow-y: auto; }
.tuto-mobilebar .tuto-steps-nav a { padding-left: 16px; }

.tuto-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin: 2rem 0;
  font-size: 0.92rem;
  max-width: 800px;
}
.tuto-feedback a { color: var(--muted); }
.tuto-feedback a:hover { color: var(--primary); }

.tuto-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  max-width: 800px;
}
@media (max-width: 575.98px) { .tuto-pager { grid-template-columns: 1fr; } }
.tuto-pager a,
.tuto-pager span {
  background: var(--card-bg);
  padding: 1rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.35;
  transition: color 150ms ease;
}
.tuto-pager a:hover { color: var(--primary); }
.tuto-pager small {
  display: block;
  font-family: var(--tuto-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.tuto-pager .next { text-align: right; }

.tuto-absent {
  border: 1px dashed var(--border-color);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--tuto-mono);
  font-size: 0.85rem;
}

/* ============================================================
   Catalogue (tutos.html)
   ============================================================ */
.tuto-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--border-color);
  background: var(--bg);
}
.tuto-stats > div { padding: 0.75rem 1rem; border-left: 1px solid var(--border-color); }
.tuto-stats > div:first-child { border-left: 0; }
.tuto-stats strong {
  display: block;
  font-family: var(--tuto-mono);
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--primary);
}
.tuto-stats span {
  font-family: var(--tuto-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* À la une */
.tuto-featured { border: 1px solid var(--border-color); margin-bottom: 2.5rem; position: relative; }
.tuto-featured::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; bottom: -1px;
  width: 4px;
  background: var(--cat);
  z-index: 1;
}
.tuto-featured-body { padding: 2rem; }
.tuto-featured h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.75rem 0 0.5rem;
}
.tuto-featured h2 a { color: inherit; text-decoration: none; }
.tuto-featured h2 a:hover { color: var(--primary); }
.tuto-featured-visual {
  height: 100%;
  min-height: 240px;
  border-left: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tuto-featured-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tuto-featured-num {
  font-family: var(--tuto-mono);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  color: var(--cat);
  line-height: 1;
}
@media (max-width: 991.98px) {
  .tuto-featured-visual { border-left: 0; border-top: 1px solid var(--border-color); min-height: 180px; }
  .tuto-featured-body { padding: 1.5rem 1.25rem; }
}

/* Barre de filtres */
.tuto-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.tuto-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.tuto-search { position: relative; flex: 1 1 260px; max-width: 440px; }
.tuto-search > i {
  position: absolute;
  left: 0.8rem; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.tuto-search input { padding-left: 2.25rem; height: 42px; }
.tuto-search input::placeholder { color: var(--muted); }
.tuto-count { font-family: var(--tuto-mono); font-size: 0.78rem; color: var(--muted); }
.tuto-count strong { color: var(--primary); }

.chip-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.chip-label {
  font-family: var(--tuto-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.35rem;
}
.chip {
  font-family: var(--tuto-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .dot { width: 8px; height: 8px; background: var(--cat); display: inline-block; }
.chip .chip-count { color: var(--muted); }
.chip.active .chip-count { color: inherit; opacity: 0.65; }

/* Cartes */
.tuto-card { display: flex; flex-direction: column; height: 100%; }
.tuto-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 3px;
  background: var(--cat);
  z-index: 1;
}
.tuto-card:focus-within { border-color: var(--primary) !important; }
.tuto-card .card-body { flex: 1; display: flex; flex-direction: column; }
.tuto-card .card-text { flex: 1; }
.tuto-card-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg);
}
.tuto-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease;
}
.tuto-card:hover .tuto-card-cover img { transform: scale(1.03); }
.tuto-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.tuto-num {
  font-family: var(--tuto-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.tuto-card h2 { font-size: 1.08rem; line-height: 1.3; margin-bottom: 0.5rem; }
.tuto-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-family: var(--tuto-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
html.dark .tuto-meta li { color: var(--muted); }
.tuto-meta .bi { margin-right: 4px; }
.tuto-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-color);
}
.tuto-date { font-family: var(--tuto-mono); font-size: 0.7rem; color: var(--muted); }
.tuto-card-progress { margin-bottom: 0.9rem; }
.tuto-card-progress .mono-label { font-size: 0.68rem; margin-bottom: 0.3rem; color: var(--primary); }
.tuto-card-progress .progress { height: 3px; }

.tuto-empty {
  border: 1px dashed var(--border-color);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--tuto-mono);
  font-size: 0.85rem;
}
.tuto-empty i { font-size: 1.6rem; display: block; margin-bottom: 0.6rem; }
