/* Hub Cours NSI — mise en page type accueil / bento */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nsi-hub-body {
  background: var(--light-bg, #f7f2ea);
}

html.theme-dark .nsi-hub-body {
  background: #0f172a;
}

.nsi-hub-body > header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.landing--nsi-hub {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* Hero */
.nsi-hero {
  padding: 2rem 0 1.25rem;
}

.nsi-hero__layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.nsi-hero__main {
  padding: 1.75rem 1.65rem;
  border-radius: 18px;
}

/* Hero degrade (sans hub-hero--light) */
.nsi-hero__main:not(.hub-hero--light) {
  background: linear-gradient(145deg, #ef4a34 0%, #ef4a34 42%, #b5590b 100%);
  color: #fff;
  box-shadow: 0 12px 40px rgba(20, 20, 26, 0.28);
}

.nsi-hero__main:not(.hub-hero--light) .home-hero__eyebrow {
  color: rgba(255, 255, 255, 0.85);
}

.nsi-hero__main:not(.hub-hero--light) .home-hero__title {
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-size: clamp(1.75rem, 3.5vw, 2.2rem);
}

.nsi-hero__main:not(.hub-hero--light) .nsi-hero__lead {
  color: rgba(255, 255, 255, 0.9);
}

.nsi-hero__main:not(.hub-hero--light) .home-cta--solid {
  background: #fff;
  color: #c93620 !important;
  border-color: #fff;
}

.nsi-hero__main:not(.hub-hero--light) .home-cta--solid:hover {
  background: #eef2ff;
  border-color: #eef2ff;
}

.nsi-hero__main:not(.hub-hero--light) .home-cta--outline {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.45);
}

.nsi-hero__main:not(.hub-hero--light) .home-cta--outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #fff;
  color: #fff !important;
}

.nsi-hero__main:not(.hub-hero--light) .nsi-hero__stats {
  border-top-color: rgba(255, 255, 255, 0.22);
}

.nsi-hero__main:not(.hub-hero--light) .nsi-hero__stats li {
  color: rgba(255, 255, 255, 0.88);
}

.nsi-hero__main:not(.hub-hero--light) .nsi-hero__stats strong {
  color: #fff;
}

/* Hero clair : accueil, NSI, programmation */
.nsi-hero__main.hub-hero--light {
  background: #fff;
  color: #111827;
  border: 1px solid var(--border, #dde3ed);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.nsi-hero__main.hub-hero--light .home-hero__eyebrow {
  color: var(--primary-dark, #c93620);
}

.nsi-hero__main.hub-hero--light .home-hero__title {
  color: #111827;
  -webkit-text-fill-color: #111827;
  font-size: clamp(1.75rem, 3.5vw, 2.2rem);
}

.nsi-hero__main.hub-hero--light .nsi-hero__lead,
.nsi-hero__main.hub-hero--light .hub-hero--light__lead {
  color: #5b6577;
}

.nsi-hero__main.hub-hero--light .home-cta--solid {
  background: var(--primary, #ef4a34);
  color: #fff !important;
  border-color: var(--primary, #ef4a34);
}

.nsi-hero__main.hub-hero--light .home-cta--solid:hover {
  background: var(--primary-dark, #c93620);
  border-color: var(--primary-dark, #c93620);
}

.nsi-hero__main.hub-hero--light .home-cta--outline {
  background: #fff;
  color: #111827 !important;
  border-color: var(--border, #cbd5e1);
}

.nsi-hero__main.hub-hero--light .home-cta--outline:hover {
  border-color: var(--primary, #ef4a34);
  color: var(--primary, #ef4a34) !important;
}

.nsi-hero__main.hub-hero--light .nsi-hero__stats,
.nsi-hero__main.hub-hero--light .hub-hero--light__stats {
  border-top-color: #e2e8f0;
}

.nsi-hero__main.hub-hero--light .nsi-hero__stats li {
  color: #64748b;
}

.nsi-hero__main.hub-hero--light .nsi-hero__stats strong {
  color: #111827;
}

html.theme-dark .nsi-hero__main.hub-hero--light {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  color: #e2e8f0;
}

html.theme-dark .nsi-hero__main.hub-hero--light .home-hero__title {
  color: #f8fafc;
  -webkit-text-fill-color: #f8fafc;
}

html.theme-dark .nsi-hero__main.hub-hero--light .nsi-hero__stats,
html.theme-dark .nsi-hero__main.hub-hero--light .hub-hero--light__stats {
  border-top-color: #475569;
}

html.theme-dark .nsi-hero__main.hub-hero--light .nsi-hero__stats li {
  color: #94a3b8;
}

html.theme-dark .nsi-hero__main.hub-hero--light .nsi-hero__stats strong {
  color: #f8fafc;
  -webkit-text-fill-color: #f8fafc;
}

html.theme-dark .nsi-hero__main.hub-hero--light .home-hero__eyebrow {
  color: #ffb199;
}

html.theme-dark .nsi-hero__main.hub-hero--light .nsi-hero__lead {
  color: #94a3b8;
}

html.theme-dark .nsi-hero__main.hub-hero--light .home-cta--outline {
  background: #0f172a;
  color: #e2e8f0 !important;
  border-color: #475569;
}

.nsi-hero__lead {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 42ch;
}

.nsi-hero__main .home-hero__cta {
  margin-top: 0;
}

.nsi-hero__stats {
  list-style: none;
  margin: 1.35rem 0 0;
  padding: 0.85rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
}

.nsi-hero__stats li {
  font-size: 0.82rem;
}

.nsi-hero__stats strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

/* Acces rapide chapitres (colonne droite) */
.nsi-hero__chapters {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.nsi-quick-card {
  display: block;
  padding: 0.75rem 0.9rem 0.55rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.nsi-quick-card:hover,
.nsi-quick-card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  border-color: color-mix(in srgb, var(--bar-color, #ef4a34) 40%, #e2e8f0);
}

.nsi-quick-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--bar-color, #ef4a34) 45%, transparent);
  outline-offset: 2px;
}

.nsi-quick-card__top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.nsi-quick-card__num {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.nsi-quick-card__name {
  flex: 1;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-dark, #0f172a);
}

.nsi-quick-card__count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light, #64748b);
}

.nsi-quick-card__bar {
  display: block;
  height: 3px;
  margin-top: 0.55rem;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
}

.nsi-quick-card__bar::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--pct, 50%);
  border-radius: inherit;
  background: var(--bar-color, #ef4a34);
}

.nsi-quick-card--c1 { --bar-color: #ef4a34; }
.nsi-quick-card--c1 .nsi-quick-card__num { background: rgba(239, 74, 52, 0.12); color: #ef4a34; }
.nsi-quick-card--c2 { --bar-color: #b5590b; }
.nsi-quick-card--c2 .nsi-quick-card__num { background: rgba(181, 89, 11, 0.12); color: #b5590b; }
.nsi-quick-card--c3 { --bar-color: #3b7a8f; }
.nsi-quick-card--c3 .nsi-quick-card__num { background: rgba(59, 122, 143, 0.12); color: #3b7a8f; }
.nsi-quick-card--c4 { --bar-color: #5c6f99; }
.nsi-quick-card--c4 .nsi-quick-card__num { background: rgba(92, 111, 153, 0.12); color: #5c6f99; }
.nsi-quick-card--c5 { --bar-color: #6b8e4e; }
.nsi-quick-card--c5 .nsi-quick-card__num { background: rgba(107, 142, 78, 0.12); color: #6b8e4e; }
.nsi-quick-card--c6 { --bar-color: #4a7a6e; }
.nsi-quick-card--c6 .nsi-quick-card__num { background: rgba(74, 122, 110, 0.12); color: #4a7a6e; }
.nsi-quick-card--c7 { --bar-color: #8a5a6e; }
.nsi-quick-card--c7 .nsi-quick-card__num { background: rgba(138, 90, 110, 0.12); color: #8a5a6e; }
.nsi-quick-card--c8 { --bar-color: #8a6a3a; }
.nsi-quick-card--c8 .nsi-quick-card__num { background: rgba(138, 106, 58, 0.12); color: #8a6a3a; }
.nsi-quick-card--c9 { --bar-color: #6a5a8a; }
.nsi-quick-card--c9 .nsi-quick-card__num { background: rgba(106, 90, 138, 0.12); color: #6a5a8a; }

.nsi-quick-card--java { --bar-color: #b45309; }
.nsi-quick-card--c { --bar-color: #64748b; }

.nsi-quick-card__chev {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-light, #94a3b8);
  transition: transform 0.2s ease;
}

.home-lang-flyout.is-open .nsi-quick-card__chev {
  transform: rotate(45deg);
}

/* Grille chapitres (hub programmation) */
.nsi-chapter-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.nsi-chapter-grid--prog {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nsi-chapter-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.95rem 1.05rem;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.nsi-chapter-card::before {
  display: none;
}

.nsi-chapter-card:hover,
.nsi-chapter-card:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ch-accent, #ef4a34) 35%, #e2e8f0);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ch-accent, #ef4a34) 12%, transparent);
  background: color-mix(in srgb, var(--ch-num-bg, #eef2ff) 45%, #fff);
}

.nsi-chapter-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ch-accent, #ef4a34) 50%, transparent);
  outline-offset: 2px;
}

.nsi-chapter-card__num {
  flex-shrink: 0;
  min-width: 4.85rem;
  padding: 0.28rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.62rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: var(--ch-num-bg, #eef2ff);
  color: var(--ch-accent, #ef4a34);
  border: 1px solid color-mix(in srgb, var(--ch-accent, #ef4a34) 18%, transparent);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.nsi-chapter-card:hover .nsi-chapter-card__num,
.nsi-chapter-card:focus-visible .nsi-chapter-card__num {
  background: color-mix(in srgb, var(--ch-num-bg, #eef2ff) 70%, #fff);
  border-color: color-mix(in srgb, var(--ch-accent, #ef4a34) 28%, transparent);
}

.nsi-chapter-card__icon-img {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.nsi-chapter-card__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nsi-chapter-card__name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-dark, #111827);
}

.nsi-chapter-card__desc {
  font-size: 0.8rem;
  color: #64748b;
}

.nsi-chapter-card__arrow {
  flex-shrink: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ch-accent, #ef4a34);
  opacity: 0.45;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nsi-chapter-card:hover .nsi-chapter-card__arrow,
.nsi-chapter-card:focus-visible .nsi-chapter-card__arrow {
  opacity: 1;
  transform: translateX(3px);
}

.nsi-chapter-card--py { --ch-accent: #2563eb; --ch-num-bg: #eff6ff; }
.nsi-chapter-card--js { --ch-accent: #ca8a04; --ch-num-bg: #fefce8; }
.nsi-chapter-card--html { --ch-accent: #ea580c; --ch-num-bg: #fff7ed; }
.nsi-chapter-card--css { --ch-accent: #0891b2; --ch-num-bg: #ecfeff; }
.nsi-chapter-card--java { --ch-accent: #b45309; --ch-num-bg: #fff7ed; }
.nsi-chapter-card--c { --ch-accent: #475569; --ch-num-bg: #f1f5f9; }

/* Hub programmation : langages (pas chapitres NSI) */
.nsi-chapter-card--lang::before {
  display: none;
}

.nsi-chapter-card--lang {
  padding: 0.9rem 1rem;
  gap: 0.85rem;
}

.nsi-chapter-card--lang:hover,
.nsi-chapter-card--lang:focus-visible {
  background: #fff;
  border-color: color-mix(in srgb, var(--ch-accent, #ef4a34) 42%, #e2e8f0);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.nsi-chapter-card__icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ch-accent, #ef4a34) 10%, #f8fafc);
  border: 1px solid color-mix(in srgb, var(--ch-accent, #ef4a34) 22%, #e2e8f0);
}

.nsi-chapter-card--lang .nsi-chapter-card__icon-img {
  width: 28px;
  height: 28px;
}

.nsi-chapter-card--lang:hover .nsi-chapter-card__icon-wrap,
.nsi-chapter-card--lang:focus-visible .nsi-chapter-card__icon-wrap {
  background: color-mix(in srgb, var(--ch-accent, #ef4a34) 14%, #f8fafc);
  border-color: color-mix(in srgb, var(--ch-accent, #ef4a34) 35%, #e2e8f0);
}

.prog-hub-body {
  background: #f3f4f8;
}

html.theme-dark .prog-hub-body,
html.theme-dark .nsi-hub-body {
  background: #0f172a;
}

.landing--prog-hub,
.landing--nsi-hub {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

html.theme-dark .landing--prog-hub,
html.theme-dark .landing--nsi-hub {
  background: transparent;
}

.nsi-pill--prog-hub {
  background: #eef2ff;
  border-color: #ffb199;
  color: #8a4308;
  font-weight: 700;
}

/* Grille 6 langages : tout visible sans defiler */
.nsi-hero__chapters--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  max-height: none;
  overflow: visible;
}

.nsi-hero__chapters--grid .nsi-quick-card {
  padding: 0.5rem 0.6rem;
}

.nsi-hero__chapters--grid .nsi-quick-card__top {
  gap: 0.4rem;
}

.nsi-hero__chapters--grid .nsi-quick-card__name {
  font-size: 0.82rem;
}

.nsi-hero__chapters--grid .nsi-quick-card__count {
  font-size: 0.68rem;
  min-width: 1.1rem;
  text-align: right;
}

.nsi-hero__chapters--grid .nsi-quick-card__bar {
  margin-top: 0.35rem;
  height: 2px;
}

.nsi-hero__chapters--grid .nsi-quick-card__logo {
  width: 24px;
  height: 24px;
}

/* Hub NSI : 2 colonnes à partir du sm pour 8 chapitres */
.nsi-hero__chapters--nsi {
  grid-template-columns: 1fr;
}
@media (min-width: 520px) {
  .nsi-hero__chapters--nsi {
    grid-template-columns: 1fr 1fr;
  }
}

.nsi-hero__chapters--nsi .nsi-quick-card__num {
  width: auto;
  min-width: 4.75rem;
  height: auto;
  min-height: 1.65rem;
  padding: 0.22rem 0.5rem;
  font-size: 0.62rem;
  line-height: 1.15;
  white-space: nowrap;
}

/* Pills */
.nsi-panel {
  margin-bottom: 1.25rem;
}

.nsi-pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nsi-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem 0.5rem 0.65rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nsi-pill:hover,
.nsi-pill:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.nsi-pill__icon {
  font-size: 1rem;
  line-height: 1;
}

.nsi-pill__img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.nsi-quick-card__logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
}

.nsi-pill__badge {
  min-width: 1.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  background: rgba(15, 23, 42, 0.08);
}

.nsi-pill--complexite { background: rgba(239, 74, 52, 0.08); border-color: rgba(239, 74, 52, 0.35); }
.nsi-pill--recherche { background: rgba(181, 89, 11, 0.08); border-color: rgba(181, 89, 11, 0.35); }
.nsi-pill--reseau { background: rgba(59, 122, 143, 0.08); border-color: rgba(59, 122, 143, 0.35); }
.nsi-pill--os { background: rgba(92, 111, 153, 0.08); border-color: rgba(92, 111, 153, 0.35); }
.nsi-pill--tableaux-1d { background: rgba(107, 142, 78, 0.08); border-color: rgba(107, 142, 78, 0.35); }
.nsi-pill--tableaux-2d { background: rgba(74, 122, 110, 0.08); border-color: rgba(74, 122, 110, 0.35); }
.nsi-pill--entiers { background: rgba(138, 90, 110, 0.08); border-color: rgba(138, 90, 110, 0.35); }
.nsi-pill--tri { background: rgba(138, 106, 58, 0.08); border-color: rgba(138, 106, 58, 0.35); }
.nsi-pill--booleens { background: rgba(106, 90, 138, 0.08); border-color: rgba(106, 90, 138, 0.35); }
.nsi-pill--pieges { background: rgba(138, 138, 146, 0.1); border-color: rgba(138, 138, 146, 0.4); }

.nsi-pill--py { background: #eff6ff; border-color: #bfdbfe; }
.nsi-pill--js { background: #fefce8; border-color: #fde047; }
.nsi-pill--html { background: #fff7ed; border-color: #fdba74; }
.nsi-pill--css { background: #ecfeff; border-color: #a5f3fc; }
.nsi-pill--java { background: #fff7ed; border-color: #fed7aa; }
.nsi-pill--c { background: #f8fafc; border-color: #cbd5e1; }
.nsi-pill--nsi-hub { background: #eef2ff; border-color: #ffb199; }

.nsi-quick-card--py { --bar-color: #2563eb; }
.nsi-quick-card--js { --bar-color: #ca8a04; }
.nsi-quick-card--html { --bar-color: #ea580c; }
.nsi-quick-card--css { --bar-color: #0891b2; }

.nsi-bento-flash--py {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
}

.nsi-bento-flash--py .nsi-bento-flash__front {
  color: #1d4ed8;
}

.nsi-bento-flash--py .nsi-bento-flash__back {
  color: #1e40af;
}

/* Bento 2x2 */
.nsi-bento {
  margin-bottom: 1.25rem;
}

.nsi-bento__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.nsi-bento-card {
  display: block;
  padding: 1.1rem 1.15rem;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 9.5rem;
}

.nsi-bento-card:hover,
.nsi-bento-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  border-color: #ffb199;
}

.nsi-bento-card__label {
  display: inline-block;
  margin-bottom: 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light, #64748b);
}

.nsi-bento-card__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-dark, #0f172a);
  margin-bottom: 0.55rem;
}

.nsi-bento-code-win {
  margin: 0;
}

.nsi-bento-code-win .py-code-win__body {
  font-size: 0.68rem;
  line-height: 1.5;
  padding: 0.75rem 0.85rem;
}

.nsi-bento-card__text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-light, #64748b);
}

.nsi-bento-card__question {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-light, #64748b);
}

.nsi-bento-card__choices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.nsi-bento-card__choices li {
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text-dark, #334155);
}

.nsi-bento-card__choices li.is-hint {
  border-color: #ffb199;
  background: #eef2ff;
  color: #c93620;
}

.nsi-bento-flash {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #bbf7d0;
}

.nsi-bento-flash__front {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: #047857;
}

.nsi-bento-flash__back {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #065f46;
}

/* Liste acces rapide (pas de dates fictives) */
.nsi-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nsi-links a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.nsi-links a:hover,
.nsi-links a:focus-visible {
  background: rgba(239, 74, 52, 0.06);
}

.nsi-links__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nsi-links__dot--fiche { background: #ef4a34; }
.nsi-links__dot--tool { background: #c1650b; }
.nsi-links__dot--quiz { background: #f59e0b; }

.nsi-links__text {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark, #0f172a);
}

.nsi-links__tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
}

.nsi-about {
  max-width: none;
  padding: 2rem 0 0;
  margin: 0;
}

/* Mode sombre */
html.theme-dark .nsi-quick-card,
html.theme-dark .nsi-bento-card {
  background: #1e293b;
  border-color: #334155;
}

html.theme-dark .nsi-quick-card__name,
html.theme-dark .nsi-bento-card__title,
html.theme-dark .nsi-links__text {
  color: #f1f5f9;
}

html.theme-dark .nsi-pill {
  color: #f1f5f9;
}

html.theme-dark .nsi-pill__badge {
  background: rgba(255, 255, 255, 0.12);
}

html.theme-dark .nsi-pill--complexite { background: rgba(239, 74, 52, 0.15); }
html.theme-dark .nsi-pill--recherche { background: rgba(124, 58, 237, 0.15); }
html.theme-dark .nsi-pill--reseau { background: rgba(5, 150, 105, 0.15); }
html.theme-dark .nsi-pill--os { background: rgba(3, 105, 161, 0.2); }
html.theme-dark .nsi-pill--tableaux-1d { background: rgba(194, 65, 12, 0.15); }
html.theme-dark .nsi-pill--tableaux-2d { background: rgba(13, 148, 136, 0.15); }
html.theme-dark .nsi-pill--entiers { background: rgba(190, 24, 93, 0.15); }
html.theme-dark .nsi-pill--tri { background: rgba(161, 98, 7, 0.15); }
html.theme-dark .nsi-pill--pieges { background: rgba(245, 158, 11, 0.12); }

html.theme-dark .nsi-pill--py { background: rgba(37, 99, 235, 0.15); }
html.theme-dark .nsi-pill--js { background: rgba(202, 138, 4, 0.15); }
html.theme-dark .nsi-pill--html { background: rgba(234, 88, 12, 0.12); }
html.theme-dark .nsi-pill--css { background: rgba(8, 145, 178, 0.15); }
html.theme-dark .nsi-pill--java { background: rgba(180, 83, 9, 0.12); }
html.theme-dark .nsi-pill--c { background: rgba(100, 116, 139, 0.2); }
html.theme-dark .nsi-pill--nsi-hub { background: rgba(239, 74, 52, 0.15); }

html.theme-dark .nsi-pill--prog-hub {
  background: rgba(239, 74, 52, 0.22);
  border-color: #ef4a34;
  color: #e0e7ff;
}

html.theme-dark .nsi-chapter-card {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

html.theme-dark .nsi-chapter-card:hover,
html.theme-dark .nsi-chapter-card:focus-visible {
  background: #243044;
  border-color: color-mix(in srgb, var(--ch-accent, #ff8a72) 40%, #475569);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

html.theme-dark .nsi-chapter-card__name,
html.theme-dark .nsi-chapter-card strong.nsi-chapter-card__name,
html.theme-dark .nsi-chapter-card:hover .nsi-chapter-card__name,
html.theme-dark .nsi-chapter-card:hover strong.nsi-chapter-card__name {
  color: #f8fafc;
  -webkit-text-fill-color: #f8fafc;
}

html.theme-dark .nsi-chapter-card__desc,
html.theme-dark .nsi-chapter-card:hover .nsi-chapter-card__desc {
  color: #94a3b8;
}

html.theme-dark .nsi-chapter-card__num {
  background: color-mix(in srgb, var(--ch-accent, #ff8a72) 16%, #1e293b);
  color: color-mix(in srgb, var(--ch-accent, #ff8a72) 75%, #e2e8f0);
  border-color: color-mix(in srgb, var(--ch-accent, #ff8a72) 28%, #475569);
}

html.theme-dark .nsi-chapter-card:hover .nsi-chapter-card__num,
html.theme-dark .nsi-chapter-card:focus-visible .nsi-chapter-card__num {
  background: color-mix(in srgb, var(--ch-accent, #ff8a72) 22%, #334155);
  border-color: color-mix(in srgb, var(--ch-accent, #ff8a72) 38%, #64748b);
}

html.theme-dark .nsi-chapter-card--py { --ch-accent: #60a5fa; }
html.theme-dark .nsi-chapter-card--js { --ch-accent: #fbbf24; }
html.theme-dark .nsi-chapter-card--html { --ch-accent: #fb923c; }
html.theme-dark .nsi-chapter-card--css { --ch-accent: #22d3ee; }
html.theme-dark .nsi-chapter-card--java { --ch-accent: #f59e0b; }
html.theme-dark .nsi-chapter-card--c { --ch-accent: #94a3b8; }

html.theme-dark .nsi-chapter-card--lang:hover,
html.theme-dark .nsi-chapter-card--lang:focus-visible {
  background: #243044;
  border-color: color-mix(in srgb, var(--ch-accent, #ff8a72) 45%, #475569);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

html.theme-dark .nsi-chapter-card--lang .nsi-chapter-card__icon-wrap {
  background: color-mix(in srgb, var(--ch-accent, #ff8a72) 14%, #1e293b);
  border-color: color-mix(in srgb, var(--ch-accent, #ff8a72) 30%, #475569);
}

html.theme-dark .nsi-chapter-card--lang:hover .nsi-chapter-card__icon-wrap,
html.theme-dark .nsi-chapter-card--lang:focus-visible .nsi-chapter-card__icon-wrap {
  background: color-mix(in srgb, var(--ch-accent, #ff8a72) 20%, #334155);
}

html.theme-dark .nsi-quick-card:hover,
html.theme-dark .nsi-quick-card:focus-visible {
  background: #243044;
  border-color: color-mix(in srgb, var(--bar-color, #ff8a72) 45%, #475569);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

html.theme-dark .nsi-quick-card:hover .nsi-quick-card__name {
  color: #f8fafc;
}

html.theme-dark .home-panel .home-panel__title,
html.theme-dark .home-panel .home-panel__group {
  color: #94a3b8;
}

html.theme-dark .home-panel {
  background: #1e293b;
  border-color: #334155;
}

html.theme-dark .nsi-links a:hover {
  background: rgba(239, 74, 52, 0.12);
}

html.theme-dark .nsi-links__tag {
  background: #334155;
  color: #94a3b8;
}

html.theme-dark .nsi-bento-card__choices li {
  background: #0f172a;
  border-color: #475569;
  color: #e2e8f0;
}

html.theme-dark .nsi-bento-flash {
  background: rgba(5, 150, 105, 0.15);
  border-color: rgba(52, 211, 153, 0.35);
}

@media (max-width: 900px) {
  .nsi-hero__layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nsi-bento__grid {
    grid-template-columns: 1fr;
  }

  .nsi-hero__stats {
    gap: 0.5rem 1rem;
  }
}
