/* ============================================================
   DevWeb Portal — feuille de style principale
   Thème sombre, élégant, sans iconographie emoji.
   ============================================================ */

:root {
  --bg: #070b14;
  --bg-soft: #0c1220;
  --panel: #0e1626;
  --panel-2: #111b2e;
  --line: #1d2941;
  --line-soft: #16203a;
  --ink: #e8edf6;
  --muted: #94a0b5;
  --faint: #5b6779;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.14);
  --green: #2ee6a8;
  --red: #ff5470;
  --orange: #ffb04f;
  --header-bg: rgba(7, 11, 20, 0.82);
  --surface-tint: rgba(14, 22, 38, 0.5);
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

/* ---------- Thème clair ---------- */
html[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #eef1f8;
  --panel: #ffffff;
  --panel-2: #f7f9fd;
  --line: #d9e0ee;
  --line-soft: #e6ebf5;
  --ink: #131a28;
  --muted: #57627a;
  --faint: #8b96ab;
  --accent: #3b6fe0;
  --accent-soft: rgba(59, 111, 224, 0.1);
  --green: #0da678;
  --red: #d93654;
  --orange: #c77618;
  --header-bg: rgba(246, 248, 252, 0.85);
  --surface-tint: rgba(232, 237, 247, 0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1; }

::selection { background: var(--accent); color: #fff; }

/* Fond quadrillé discret */
.bg-grid {
  position: fixed; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(79, 140, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 140, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
}

.wrap { width: min(1160px, 92vw); margin-inline: auto; }

h1, h2, h3, .brand-text, .tp-code {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.mono { font-family: var(--font-mono); font-size: 0.86em; }
.mt { margin-top: 1.4rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.78rem 1.5rem; border-radius: 9px; border: 1px solid transparent;
  font-family: var(--font-body); font-weight: 600; font-size: 0.93rem;
  text-decoration: none; cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #4f8cff, #3b6fe0);
  color: #fff;
  box-shadow: 0 8px 26px rgba(79, 140, 255, 0.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(79, 140, 255, 0.42); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-sm { padding: 0.5rem 1.05rem; font-size: 0.86rem; }
.btn-block { width: 100%; }
.btn-google { background: #fff; color: #1a1f2b; border-color: #fff; }
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255, 255, 255, 0.12); }
.btn-google.is-disabled { opacity: 0.55; }
.inline-form { display: inline; }

.text-link {
  color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.text-link:hover { border-bottom-color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-nav { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 0; gap: 1rem; flex-wrap: nowrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-mark { color: var(--accent); display: grid; place-items: center; }
.brand-text { font-weight: 700; font-size: 1.06rem; }
.brand-dot { color: var(--accent); }

.nav-links { display: flex; gap: 1.3rem; list-style: none; flex-wrap: nowrap; align-items: center; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.92rem;
  position: relative; padding: 0.3rem 0; transition: color 0.2s; white-space: nowrap;
}
.nav-links .nav-drop-btn { white-space: nowrap; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 2px;
  background: var(--accent); border-radius: 2px; transition: width 0.25s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after, .nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 0.7rem; }
.user-chip {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.3rem 0.85rem 0.3rem 0.3rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.87rem; color: var(--muted);
}
.user-initial {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
}

.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.burger span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.3s; }
.burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: clamp(4rem, 9vw, 7.5rem) 0 clamp(2.5rem, 5vw, 4.5rem); }
.eyebrow {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 4.2rem); line-height: 1.06; font-weight: 700; max-width: 22ch;
}
.hero .hl {
  background: linear-gradient(120deg, #4f8cff 20%, #2ee6a8 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { margin-top: 1.4rem; font-size: clamp(1rem, 1.9vw, 1.18rem); color: var(--muted); max-width: 58ch; }
.hero-cta { margin-top: 2.2rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-credit {
  margin-top: 1.3rem; padding-left: 1.1rem;
  border-left: 2px solid var(--accent);
  font-size: 0.88rem; color: var(--faint); font-style: italic;
  max-width: 58ch; line-height: 1.7;
}
.hero-credit strong { color: var(--muted); font-style: normal; font-weight: 600; }

/* Panneau graphique du hero */
.hero-panel {
  margin-top: 3.4rem; background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.panel-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--line-soft);
}
.panel-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.panel-bar .panel-dot:first-child { background: #ff5f56; }
.panel-bar .panel-dot:nth-child(2) { background: #ffbd2e; }
.panel-bar .panel-dot:nth-child(3) { background: #27c93f; }
.panel-title { margin-left: 0.7rem; font-family: var(--font-mono); font-size: 0.76rem; color: var(--faint); }
.panel-live {
  margin-left: auto; display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; color: var(--green);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 230, 168, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(46, 230, 168, 0); }
}
.panel-chart { display: block; width: 100%; height: clamp(120px, 22vw, 190px); }
.chart-line { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.4s ease-out forwards 0.4s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.panel-ticker {
  display: flex; flex-wrap: wrap; gap: 1.6rem;
  padding: 0.85rem 1.2rem; border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--faint); letter-spacing: 0.05em;
}
.panel-ticker strong { color: var(--ink); margin-left: 0.4rem; }
.panel-ticker .up, .up { color: var(--green); }
.down { color: var(--red); }

/* ---------- Bandeau de chiffres ---------- */
.strip { border-block: 1px solid var(--line-soft); background: var(--surface-tint); }
.strip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.strip-item { padding: 1.9rem 1rem; text-align: center; border-left: 1px solid var(--line-soft); }
.strip-item:first-child { border-left: none; }
.strip-num { display: block; font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: var(--ink); }
.strip-label { font-size: 0.84rem; color: var(--muted); }

/* ---------- Sections ---------- */
.block { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.block-alt { background: var(--surface-tint); border-block: 1px solid var(--line-soft); }
.sec-head { margin-bottom: 2.6rem; max-width: 62ch; }
.sec-num {
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
}
.sec-head h2, .split-2 h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin-top: 0.5rem; line-height: 1.15; }
.sec-head p { color: var(--muted); margin-top: 0.9rem; }

.split-2 { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split-2 p { color: var(--muted); }

.check-list { list-style: none; }
.check-list li { padding-left: 1.6rem; position: relative; margin-bottom: 0.55rem; color: var(--muted); }
.check-list li::before {
  content: ''; position: absolute; left: 0; top: 0.52em;
  width: 9px; height: 9px; border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--green));
}

/* ---------- Cartes TP (accueil) ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.3rem; }
.tp-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line); border-radius: 14px; padding: 1.7rem;
  display: flex; flex-direction: column; gap: 0.85rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.tp-card:hover {
  transform: translateY(-6px); border-color: rgba(79, 140, 255, 0.45);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4);
}
.tp-card-top { display: flex; justify-content: space-between; align-items: center; }
.tp-code {
  font-weight: 700; font-size: 0.92rem; color: var(--accent);
  background: var(--accent-soft); padding: 0.28rem 0.7rem; border-radius: 7px;
}
.tp-card h3 { font-size: 1.16rem; line-height: 1.3; }
.tp-card p { color: var(--muted); font-size: 0.92rem; flex: 1; }
.tp-card-actions { padding-top: 0.4rem; border-top: 1px solid var(--line-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  font-size: 0.74rem; font-weight: 500; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.22rem 0.7rem;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; font-size: 0.74rem; font-weight: 600;
  padding: 0.24rem 0.68rem; border-radius: 999px; letter-spacing: 0.03em; white-space: nowrap;
}
.badge-ok { background: rgba(46, 230, 168, 0.12); color: var(--green); border: 1px solid rgba(46, 230, 168, 0.3); }
.badge-ko { background: rgba(255, 84, 112, 0.12); color: var(--red); border: 1px solid rgba(255, 84, 112, 0.3); }
.badge-neutral { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(79, 140, 255, 0.3); }
.badge-google { background: rgba(255, 255, 255, 0.08); color: var(--ink); border: 1px solid var(--line); }
.badge-html { background: rgba(255, 176, 79, 0.12); color: var(--orange); border: 1px solid rgba(255, 176, 79, 0.3); }
.badge-lg { font-size: 0.86rem; padding: 0.4rem 1rem; }

/* ---------- Terminal factice ---------- */
.mini-terminal {
  background: #0a101d; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.terminal-body {
  padding: 1.2rem 1.3rem; font-family: var(--font-mono); font-size: 0.8rem;
  line-height: 1.9; color: var(--muted); overflow-x: auto;
}
.t-ok { color: var(--green); }
.t-ko { color: var(--red); }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.3rem; }
.feature {
  border: 1px solid var(--line); border-radius: 14px; padding: 1.7rem;
  background: linear-gradient(180deg, rgba(17, 27, 46, 0.6), transparent);
}
.feature h3 { font-size: 1.08rem; margin-bottom: 0.55rem; }
.feature p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Pages internes ---------- */
.page-main { padding: clamp(2.5rem, 5vw, 4rem) 0 4rem; width: min(1160px, 92vw); }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem;
  flex-wrap: wrap; margin-bottom: 2.2rem;
}
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-top: 0.3rem; }
.center-main { text-align: center; padding-top: 8vh; }
.err-code { font-family: var(--font-mono); font-size: 5rem; color: var(--accent); opacity: 0.5; font-weight: 600; }

/* ---------- Auth ---------- */
.auth-main { display: grid; place-items: center; padding: clamp(2rem, 6vh, 5rem) 4vw; }
.auth-card {
  display: grid; grid-template-columns: 1fr 1.15fr; width: min(920px, 100%);
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}
.auth-side {
  padding: 2.6rem 2.4rem; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(79, 140, 255, 0.18), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, rgba(46, 230, 168, 0.1), transparent 60%),
    var(--bg-soft);
  border-right: 1px solid var(--line-soft);
}
.auth-side h1 { font-size: 2rem; margin-top: 0.4rem; }
.auth-side-text { color: var(--muted); margin-top: 1rem; font-size: 0.95rem; }
.auth-side-foot {
  margin-top: auto; padding-top: 2.5rem; display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.8rem; color: var(--faint);
}
.auth-form-zone { padding: 2.6rem 2.4rem; }
.auth-form-zone h2 { font-size: 1.4rem; margin-bottom: 1.4rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.45rem; }
.auth-form label { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-top: 0.8rem; }
.label-hint { font-weight: 400; color: var(--faint); }
.auth-form input {
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  padding: 0.8rem 1rem; color: var(--ink); font-family: var(--font-body); font-size: 1rem;
  min-height: 44px; transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-form input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-form .btn { margin-top: 1.3rem; min-height: 46px; }

.divider {
  display: flex; align-items: center; gap: 1rem; margin: 1.4rem 0;
  color: var(--faint); font-size: 0.8rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.form-hint { font-size: 0.78rem; color: var(--faint); margin-top: 0.6rem; }
.auth-switch { margin-top: 1.6rem; font-size: 0.9rem; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }

.alert {
  padding: 0.8rem 1rem; border-radius: 9px; font-size: 0.88rem; margin-bottom: 1.2rem;
}
.alert-error { background: rgba(255, 84, 112, 0.1); border: 1px solid rgba(255, 84, 112, 0.35); color: #ff8ba0; }
.alert-info { background: var(--accent-soft); border: 1px solid rgba(79, 140, 255, 0.35); color: #9dbeff; }

/* ---------- Dashboard ---------- */
.range-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.range-btn {
  background: transparent; border: 0; color: var(--muted); font-family: var(--font-body);
  font-size: 0.85rem; font-weight: 600; padding: 0.5rem 1.1rem; cursor: pointer; transition: 0.2s;
}
.range-btn.active { background: var(--accent-soft); color: var(--accent); }

.ticker-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--panel); margin-bottom: 1.4rem;
}
.ticker-cell {
  padding: 1.15rem 1.4rem; border-left: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 0.2rem;
}
.ticker-cell:first-child { border-left: none; }
.ticker-label {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint);
}
.ticker-value { font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; }
.ticker-value.mono { font-family: var(--font-mono); font-size: 1.02rem; font-weight: 600; padding-top: 0.45rem; }

.chart-card, .table-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; margin-bottom: 1.4rem;
}
.chart-card-head {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line-soft);
}
.chart-card-head h2 { font-size: 1.05rem; }
.chart-legend { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); display: inline-block; }
.legend-dot.legend-ko { background: var(--red); margin-left: 1rem; }
.chart-host { height: 340px; width: 100%; }
.chart-empty { padding: 2rem 1.4rem; color: var(--faint); text-align: center; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
  text-align: left; padding: 0.85rem 1.4rem;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line-soft);
}
.data-table td { padding: 0.85rem 1.4rem; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(79, 140, 255, 0.05); }
.ua-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Cours ---------- */
.cours-group { margin-bottom: 2.4rem; }
.cours-group-title {
  font-size: 1.05rem; color: var(--accent); margin-bottom: 0.9rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--line-soft);
}
.cours-list { list-style: none; }
.cours-row {
  display: flex; align-items: center; gap: 1.1rem;
  padding: 0.85rem 1rem; border-radius: 10px; transition: background 0.18s;
}
.cours-row:hover { background: rgba(79, 140, 255, 0.06); }
.cours-titre { flex: 1; font-size: 0.95rem; }

/* ---------- Liste TP ---------- */
.tp-rows { display: flex; flex-direction: column; gap: 1.2rem; }
.tp-row {
  display: grid; grid-template-columns: 130px 1fr auto; gap: 1.6rem; align-items: center;
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line); border-radius: 14px; padding: 1.6rem 1.8rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.tp-row:hover { border-color: rgba(79, 140, 255, 0.45); transform: translateX(4px); }
.tp-row-code { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; }
.tp-row-body h2 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.tp-row-body p { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.7rem; }
.tp-row-actions { display: flex; flex-direction: column; gap: 0.6rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); background: var(--surface-tint); margin-top: auto; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem;
  padding: 2.6rem 0; align-items: start;
}
.footer-brand { margin-bottom: 0.5rem; }
.footer-note { color: var(--faint); font-size: 0.85rem; max-width: 34ch; }
.footer-links { display: flex; flex-direction: column; gap: 0.55rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--ink); }
.footer-meta { display: flex; flex-direction: column; gap: 0.4rem; color: var(--faint); font-size: 0.84rem; text-align: right; }

/* ---------- Hero : arrière-plan « monarque des ombres » ---------- */
.hero-monarch-zone { position: relative; overflow: hidden; }
.hero-backdrop { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg-image {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  opacity: 0.22;
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.hero-monarch {
  position: absolute; right: -4%; bottom: -12%;
  height: 118%; max-height: 860px;
  opacity: 0.5;
  filter: drop-shadow(0 0 60px rgba(124, 58, 237, 0.35));
  mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
  animation: monarch-float 9s ease-in-out infinite;
}
@keyframes monarch-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.hero-violet-glow {
  position: absolute; right: -10%; top: -20%;
  width: 60%; height: 130%;
  background: radial-gradient(ellipse 50% 45% at 65% 40%, rgba(124, 58, 237, 0.2), transparent 70%);
}
@media (max-width: 940px) {
  .hero-monarch { opacity: 0.24; right: -30%; }
}

/* ---------- Cartes d'accès ---------- */
.access-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.3rem; }
.access-card {
  display: block; text-decoration: none; color: inherit;
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line); border-radius: 14px; padding: 1.6rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.access-card:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 20px 50px rgba(124, 58, 237, 0.18);
}
.access-card h3 { font-size: 1.12rem; margin: 0.8rem 0 0.45rem; }
.access-card p { color: var(--muted); font-size: 0.9rem; }
.access-state {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--green);
  border: 1px solid rgba(46, 230, 168, 0.3); background: rgba(46, 230, 168, 0.08);
  padding: 0.22rem 0.6rem; border-radius: 999px;
}
.access-card.locked .access-state {
  color: var(--faint); border-color: var(--line); background: transparent;
}
.access-card.locked { opacity: 0.82; }
.access-card.locked:hover { border-color: rgba(79, 140, 255, 0.4); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); }

/* ---------- Visionneuse intégrée ---------- */
.viewer-main {
  flex: 1; display: flex; flex-direction: column;
  width: min(1240px, 96vw); margin-inline: auto; padding: 1.2rem 0 1.6rem;
}
.viewer-bar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.viewer-title { font-size: 1.05rem; flex: 1; min-width: 200px; }
.viewer-frame-zone {
  flex: 1; display: flex; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: #fff; min-height: 72vh;
}
.viewer-frame { flex: 1; width: 100%; border: 0; display: block; }

/* ---------- Animations reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .split-2 { grid-template-columns: 1fr; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { border-right: none; border-bottom: 1px solid var(--line-soft); }
  .tp-row { grid-template-columns: 1fr; gap: 1rem; }
  .tp-row-code { flex-direction: row; align-items: center; }
  .tp-row-actions { flex-direction: row; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-meta { text-align: left; }
}

@media (max-width: 900px) {
  .nav-links {
    position: fixed; inset: 61px 0 auto 0; z-index: 99;
    max-height: calc(100vh - 70px); overflow-y: auto;
    flex-direction: column; gap: 0.4rem;
    background: var(--bg-soft); border-bottom: 1px solid var(--line);
    padding: 1.2rem 6vw 1.6rem;
    transform: translateY(-130%); transition: transform 0.32s ease;
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.45);
  }
  .nav-links.show { transform: translateY(0); }
  .nav-links a { display: block; padding: 0.65rem 0; font-size: 1rem; }
  .burger { display: flex; }
  .user-name { display: none; }
}

@media (max-width: 520px) {
  .hero-cta .btn { width: 100%; }
  .auth-side, .auth-form-zone { padding: 1.8rem 1.4rem; }
  .panel-ticker { gap: 0.9rem; }
  .chart-host { height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Bouton de bascule de thème
   ============================================================ */
.theme-toggle {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 9px;
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }

/* Ajustements thème clair */
html[data-theme="light"] .btn-google { border-color: var(--line); box-shadow: 0 2px 8px rgba(19, 26, 40, 0.06); }
html[data-theme="light"] .hero-monarch { opacity: 0.3; }
html[data-theme="light"] .hero-panel,
html[data-theme="light"] .mini-terminal { box-shadow: 0 24px 60px rgba(19, 26, 40, 0.12); }
html[data-theme="light"] .mini-terminal { background: #10182b; }
html[data-theme="light"] .hero-code { box-shadow: 0 16px 40px rgba(19, 26, 40, 0.12); }
html[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(59, 111, 224, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 111, 224, 0.06) 1px, transparent 1px);
}
html[data-theme="light"] .tp-card:hover,
html[data-theme="light"] .access-card:hover { box-shadow: 0 18px 44px rgba(19, 26, 40, 0.12); }
html[data-theme="light"] .auth-card { box-shadow: 0 30px 80px rgba(19, 26, 40, 0.14); }

/* ============================================================
   Atelier — chrome façon VS Code
   ============================================================ */
.vsc {
  --vsc-titlebar: #323233;
  --vsc-activity: #333333;
  --vsc-chrome: #252526;
  --vsc-editor: #1e1e1e;
  --vsc-tab-inactive: #2d2d2d;
  --vsc-border: #1a1a1a;
  --vsc-border-soft: #2d2d30;
  --vsc-text: #cccccc;
  --vsc-text-dim: #858585;
  --vsc-hover: #2a2d2e;
  --vsc-selected: #37373d;
  --vsc-status: #007acc;
  --vsc-accent: #0e639c;
}
html[data-theme="light"] .vsc {
  --vsc-titlebar: #dddddd;
  --vsc-activity: #2c2c2c;
  --vsc-chrome: #f3f3f3;
  --vsc-editor: #ffffff;
  --vsc-tab-inactive: #ececec;
  --vsc-border: #d4d4d4;
  --vsc-border-soft: #e0e0e0;
  --vsc-text: #333333;
  --vsc-text-dim: #717171;
  --vsc-hover: #e8e8e8;
  --vsc-selected: #d5e4f2;
  --vsc-status: #007acc;
  --vsc-accent: #0e639c;
}

.atelier-body {
  overflow: hidden; height: 100vh; display: flex; flex-direction: column;
  background: var(--vsc-editor, #1e1e1e);
}
.vsc {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  background: var(--vsc-editor); color: var(--vsc-text);
  font-family: var(--font-body); font-size: 13px;
}

/* Barre de titre */
.vsc-titlebar {
  display: flex; align-items: center;
  height: 35px; padding: 0 10px;
  background: var(--vsc-titlebar); border-bottom: 1px solid var(--vsc-border);
  flex-shrink: 0;
}
.vsc-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--vsc-text); text-decoration: none; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 5px;
}
.vsc-back:hover { background: var(--vsc-hover); }
.vsc-title {
  flex: 1; text-align: center; font-size: 12px; color: var(--vsc-text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 12px;
}
.vsc-title-right { width: 120px; }

.vsc-body { flex: 1; display: flex; min-height: 0; }

/* Barre d'activité */
.vsc-activitybar {
  width: 48px; flex-shrink: 0;
  background: var(--vsc-activity);
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0; gap: 2px;
}
.act-btn {
  width: 48px; height: 44px;
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: rgba(255, 255, 255, 0.45);
  border-left: 2px solid transparent;
  transition: color 0.15s;
}
.act-btn:hover { color: #ffffff; }
.act-btn.active { color: #ffffff; border-left-color: #ffffff; }
.act-spacer { flex: 1; }

/* Explorateur */
.vsc-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--vsc-chrome);
  border-right: 1px solid var(--vsc-border);
  display: flex; flex-direction: column; min-height: 0;
  overflow: hidden;
}
.vsc-sidebar.collapsed { display: none; }
.vsc-sidebar-title {
  padding: 10px 18px 8px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--vsc-text-dim);
}
.vsc-project {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--vsc-text); cursor: default;
}
.vsc-files { list-style: none; overflow-y: auto; flex: 1; padding-bottom: 12px; }
.vsc-file {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 22px; cursor: pointer;
  font-size: 13px; color: var(--vsc-text);
  white-space: nowrap;
}
.vsc-file:hover { background: var(--vsc-hover); }
.vsc-file.active { background: var(--vsc-selected); }
.file-ico {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  width: 18px; flex-shrink: 0; text-align: center;
}
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.file-actions { display: none; gap: 2px; }
.vsc-file:hover .file-actions { display: inline-flex; }
.file-act {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 4px;
  background: none; border: 0; cursor: pointer;
  color: var(--vsc-text-dim);
}
.file-act:hover { background: rgba(128, 128, 128, 0.25); color: var(--vsc-text); }
.file-act.rm:hover { color: #f48771; }

/* Zone éditeur */
.vsc-editorzone {
  flex: 1.2; min-width: 0; display: flex; flex-direction: column;
  background: var(--vsc-editor);
  border-right: 1px solid var(--vsc-border);
}
.vsc-tabs {
  display: flex; overflow-x: auto; flex-shrink: 0;
  background: var(--vsc-chrome);
  min-height: 35px;
}
.vsc-tabs::-webkit-scrollbar { height: 3px; }
.vsc-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 8px 0 12px; height: 35px;
  background: var(--vsc-tab-inactive);
  border-right: 1px solid var(--vsc-border);
  font-size: 13px; color: var(--vsc-text-dim);
  cursor: pointer; white-space: nowrap; user-select: none;
}
.vsc-tab.active {
  background: var(--vsc-editor); color: var(--vsc-text);
  border-top: 1px solid var(--vsc-status); margin-top: -1px;
}
.tab-close {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 4px;
  background: none; border: 0; cursor: pointer;
  color: var(--vsc-text-dim); font-size: 15px; line-height: 1;
}
.tab-close:hover { background: rgba(128, 128, 128, 0.25); color: var(--vsc-text); }
.tab-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--vsc-text); display: inline-block;
}
.vsc-breadcrumb {
  padding: 4px 16px; font-size: 12px; color: var(--vsc-text-dim);
  border-bottom: 1px solid var(--vsc-border-soft); flex-shrink: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vsc-editor-host { flex: 1; min-height: 0; }
.vsc-binary, .vsc-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: var(--vsc-text-dim); text-align: center; padding: 20px;
}
.vsc-binary img { max-width: 85%; max-height: 55vh; border: 1px solid var(--vsc-border-soft); border-radius: 6px; }

/* Aperçu */
.vsc-preview { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--vsc-chrome); }
.vsc-preview-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 35px; padding: 0 8px 0 0; flex-shrink: 0;
  border-bottom: 1px solid var(--vsc-border);
}
.vsc-preview-tab {
  display: inline-flex; align-items: center; height: 35px; padding: 0 14px;
  background: var(--vsc-editor); color: var(--vsc-text);
  font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  border-right: 1px solid var(--vsc-border); border-top: 1px solid var(--vsc-status);
}
.vsc-preview-actions { display: inline-flex; gap: 2px; }
.mini-btn {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 5px;
  background: none; border: 0; cursor: pointer; color: var(--vsc-text-dim);
}
.mini-btn:hover { background: var(--vsc-hover); color: var(--vsc-text); }
.vsc-preview-frame { flex: 1; border: 0; width: 100%; background: #ffffff; }

/* Barre d'état */
.vsc-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 24px; padding: 0 4px; flex-shrink: 0;
  background: var(--vsc-status); color: #ffffff;
  font-size: 12px;
}
.status-left, .status-right { display: flex; align-items: center; height: 100%; }
.status-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 8px; height: 100%; white-space: nowrap;
}
.status-btn { background: none; border: 0; color: inherit; font-size: 12px; cursor: pointer; font-family: inherit; }
.status-btn:hover, .status-remote:hover { background: rgba(255, 255, 255, 0.14); }
.status-remote { background: var(--vsc-accent); }

/* Toast (notifications de l'atelier) */
.toast {
  position: fixed; bottom: 2.4rem; right: 1.4rem; transform: translateY(16px);
  background: var(--vsc-chrome, #252526); border: 1px solid var(--vsc-border-soft, #2d2d30);
  color: var(--vsc-text, #ccc);
  padding: 0.65rem 1.2rem; border-radius: 8px; font-size: 0.85rem;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45); z-index: 200;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { border-color: rgba(244, 135, 113, 0.6); color: #f48771; }

@media (max-width: 1080px) {
  .atelier-body { overflow: auto; height: auto; }
  .vsc-body { flex-direction: column; }
  .vsc-activitybar { flex-direction: row; width: 100%; height: 48px; }
  .act-btn { border-left: 0; border-bottom: 2px solid transparent; }
  .act-btn.active { border-bottom-color: #ffffff; }
  .vsc-sidebar { width: 100%; max-height: 220px; border-right: 0; border-bottom: 1px solid var(--vsc-border); }
  .vsc-editor-host { min-height: 420px; }
  .vsc-preview-frame { min-height: 420px; }
}

/* ============================================================
   Landing : bandeau défilant, icônes d'accès, titre animé
   ============================================================ */
.hero .hl {
  background: linear-gradient(120deg, #4f8cff 10%, #8b5cf6 45%, #2ee6a8 90%);
  background-size: 220% 220%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hl-slide 7s ease-in-out infinite;
}
@keyframes hl-slide {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.marquee {
  overflow: hidden; border-block: 1px solid var(--line-soft);
  background: var(--surface-tint); padding: 0.7rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: inline-flex; gap: 2.2rem; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint);
  animation: marquee-scroll 30s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.access-top { display: flex; justify-content: space-between; align-items: center; }
.access-ico {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 11px;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--line);
  transition: transform 0.25s ease;
}
.access-card:hover .access-ico { transform: scale(1.08) rotate(-3deg); }

/* ============================================================
   Supervision : contrôles, panneaux méthodes / IP
   ============================================================ */
.dash-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.auto-switch { display: inline-flex; align-items: center; gap: 0.55rem; cursor: pointer; user-select: none; }
.auto-switch input { display: none; }
.auto-slider {
  width: 36px; height: 20px; border-radius: 999px;
  background: var(--line); position: relative; transition: background 0.2s;
}
.auto-slider::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); transition: transform 0.2s;
}
.auto-switch input:checked + .auto-slider { background: var(--accent); }
.auto-switch input:checked + .auto-slider::after { transform: translateX(16px); background: #fff; }
.auto-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.dash-panels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-bottom: 1.4rem;
}
.panel-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.panel-body { padding: 1.2rem 1.4rem; }

.meter-row {
  display: grid; grid-template-columns: 70px 1fr auto; gap: 0.9rem;
  align-items: center; margin-bottom: 0.9rem;
}
.meter-row:last-child { margin-bottom: 0; }
.meter-label { font-size: 0.86rem; font-weight: 600; }
.meter-track {
  height: 10px; border-radius: 5px; background: var(--line-soft); overflow: hidden;
}
.meter-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #4f8cff, #3b6fe0);
  box-shadow: 0 0 8px rgba(79, 140, 255, 0.4);
  transition: width 0.6s ease;
}
.meter-fill.fill-google {
  background: linear-gradient(90deg, #2ee6a8, #0da678);
  box-shadow: 0 0 8px rgba(46, 230, 168, 0.35);
}
.meter-value { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

.ip-list { list-style: none; }
.ip-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--line-soft);
  font-size: 0.88rem;
}
.ip-list li:last-child { border-bottom: none; }
.ip-meta { color: var(--faint); font-size: 0.78rem; white-space: nowrap; }

@media (max-width: 820px) {
  .dash-panels { grid-template-columns: 1fr; }
}

/* ============================================================
   Correctif global : l'attribut hidden doit toujours gagner,
   même sur les éléments avec display:flex/grid explicite.
   ============================================================ */
[hidden] { display: none !important; }

/* ============================================================
   Atelier : volets multiples (1 à 4) redimensionnables
   ============================================================ */
.vsc-tabsbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--vsc-chrome); flex-shrink: 0;
}
.vsc-tabs-actions { display: flex; gap: 2px; padding-right: 6px; }

.vsc-panes {
  flex: 1; min-height: 0;
  display: flex; flex-wrap: wrap; align-content: stretch;
  gap: 3px; background: var(--vsc-border); padding: 0;
  overflow: auto;
}
.vsc-pane {
  flex: 1 1 calc(50% - 3px);
  min-width: 240px; min-height: 180px;
  display: flex; flex-direction: column;
  background: var(--vsc-editor);
  resize: both; overflow: hidden;
  outline: 1px solid transparent;
}
.vsc-panes[data-count="1"] .vsc-pane { flex-basis: 100%; resize: none; }
.vsc-pane.focused { outline-color: var(--vsc-status); z-index: 1; }
.pane-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 8px 3px 12px; flex-shrink: 0;
  background: var(--vsc-chrome); border-bottom: 1px solid var(--vsc-border-soft);
  font-size: 12px; color: var(--vsc-text-dim);
}
.pane-file { display: inline-flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsc-pane.focused .pane-file { color: var(--vsc-text); }
.pane-close {
  background: none; border: 0; cursor: pointer; color: var(--vsc-text-dim);
  font-size: 15px; line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.pane-close:hover { background: rgba(128, 128, 128, 0.25); color: var(--vsc-text); }
.pane-body { flex: 1; min-height: 0; position: relative; }

/* Fond élégant des volets vides */
.pane-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--vsc-text-dim); text-align: center; font-size: 12.5px;
  background:
    radial-gradient(60% 50% at 50% 35%, rgba(0, 122, 204, 0.07), transparent 70%),
    radial-gradient(50% 40% at 70% 80%, rgba(139, 92, 246, 0.05), transparent 70%);
}
.pane-keys { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; }
.pane-keys .kbd {
  border-color: var(--vsc-border-soft); color: var(--vsc-text-dim);
  margin-right: 6px; margin-left: 0; opacity: 1;
}
.pane-binary {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(60% 50% at 50% 40%, rgba(0, 122, 204, 0.06), transparent 70%);
}
.pane-binary img { max-width: 92%; max-height: 92%; border: 1px solid var(--vsc-border-soft); border-radius: 6px; }

/* ============================================================
   Atelier : panneau d'aides
   ============================================================ */
.vsc-aides {
  width: 265px; flex-shrink: 0;
  background: var(--vsc-chrome); border-left: 1px solid var(--vsc-border);
  overflow-y: auto; padding-bottom: 16px;
}
.aides-group { padding: 10px 14px 4px; }
.aides-group-title {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--vsc-text-dim); margin-bottom: 10px;
  border-bottom: 1px solid var(--vsc-border-soft); padding-bottom: 5px;
}
.aide-toggle {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--vsc-text);
  padding: 5px 0; cursor: pointer; user-select: none;
}
.aide-toggle input { display: none; }
.aide-toggle .auto-slider { flex-shrink: 0; }
.aide-toggle input:checked + .auto-slider { background: var(--accent); }
.aide-toggle input:checked + .auto-slider::after { transform: translateX(16px); background: #fff; }
.snippet-list { display: flex; flex-wrap: wrap; gap: 6px; }
.snippet-btn {
  background: var(--vsc-tab-inactive); border: 1px solid var(--vsc-border-soft);
  color: var(--vsc-text); font-size: 11.5px; font-family: var(--font-body);
  padding: 5px 9px; border-radius: 5px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.snippet-btn:hover { background: var(--vsc-hover); border-color: var(--vsc-status); }
.aide-search {
  width: 100%; background: var(--vsc-editor); border: 1px solid var(--vsc-border-soft);
  color: var(--vsc-text); font-size: 12.5px; padding: 6px 9px; border-radius: 5px;
  margin-bottom: 8px; font-family: var(--font-body);
}
.aide-search:focus { outline: 1px solid var(--vsc-status); }
.aide-result {
  background: var(--vsc-editor); border: 1px solid var(--vsc-border-soft);
  border-radius: 6px; padding: 8px 10px; margin-bottom: 6px;
}
.aide-result strong { font-size: 12px; color: var(--vsc-text); display: block; margin-bottom: 3px; }
.aide-result p { font-size: 11.5px; color: var(--vsc-text-dim); line-height: 1.5; }
.aide-none { font-size: 11.5px; color: var(--vsc-text-dim); padding: 4px 0; }
.aide-links { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.aide-links .btn { justify-content: flex-start; font-size: 12px; padding: 0.4rem 0.8rem; }

@media (max-width: 1080px) {
  .vsc-aides { width: 100%; border-left: 0; border-top: 1px solid var(--vsc-border); }
  .vsc-pane { min-height: 300px; }
}

/* ============================================================
   Sous-navigation (Supervision), paramètres, ajout d'énoncé
   ============================================================ */
.subnav {
  display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
}
.subnav-link {
  padding: 0.5rem 1.2rem; text-decoration: none; color: var(--muted);
  font-size: 0.88rem; font-weight: 600; transition: 0.2s;
}
.subnav-link:hover { color: var(--ink); }
.subnav-link.active { background: var(--accent-soft); color: var(--accent); }

.settings-main { max-width: 640px; }
.settings-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.8rem; margin-bottom: 1.4rem;
}
.settings-card h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.settings-note { color: var(--muted); font-size: 0.9rem; }
.settings-form input:disabled { opacity: 0.55; cursor: not-allowed; }

.add-tp-card {
  background: var(--panel); border: 1px solid var(--accent); border-radius: 14px;
  padding: 1.8rem; margin-bottom: 1.6rem;
  box-shadow: 0 16px 44px rgba(79, 140, 255, 0.12);
}
.add-tp-card h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.add-tp-form { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 1rem; }
.add-tp-form label { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-top: 0.7rem; }
.add-tp-form input[type="text"], .add-tp-form input[type="file"] {
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  padding: 0.7rem 1rem; color: var(--ink); font-family: var(--font-body); font-size: 0.95rem;
}
.add-tp-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.add-tp-row { display: flex; gap: 1rem; }
.add-tp-row > div { display: flex; flex-direction: column; gap: 0.45rem; }
.add-tp-row .grow { flex: 1; }
.add-tp-actions { display: flex; justify-content: flex-end; gap: 0.7rem; margin-top: 1.2rem; }

.tp-row-new { animation: tp-pop 0.6s ease; border-color: var(--accent); }
@keyframes tp-pop {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.lead-sm { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; }
.ws-block { border: 1px solid var(--line-soft); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.ws-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.ws-files { list-style: none; }
.ws-files li {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.35rem 0; border-bottom: 1px dashed var(--line-soft); font-size: 0.88rem;
}
.ws-files li:last-child { border-bottom: none; }
.ws-files li .mono { margin-right: auto; }
.btn-view-code { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }

.ws-code {
  margin: 0.6rem 0 0; padding: 0.9rem 1rem; border-radius: 8px;
  background: var(--bg-code, #0d1117); color: #c9d1d9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem; line-height: 1.5; max-height: 420px; overflow: auto;
  white-space: pre; border: 1px solid var(--line-soft);
}
.ws-code code { font: inherit; color: inherit; background: none; }

.ws-reviews { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line-soft); }
.ws-reviews-title { font-size: 0.9rem; margin: 0 0 0.6rem; }
.ws-reviews-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.8rem; }
.ws-review-item { background: var(--bg-soft, rgba(127,127,127,.06)); border-radius: 8px; padding: 0.6rem 0.8rem; }
.ws-review-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.78rem; margin-bottom: 0.3rem; }
.ws-review-meta .mono { opacity: 0.7; }
.ws-review-del { background: none; border: none; cursor: pointer; font: inherit; padding: 0; margin-left: auto; }
.ws-review-msg { margin: 0; font-size: 0.88rem; white-space: pre-wrap; }
.ws-review-form { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.ws-review-input { width: 100%; resize: vertical; }

.nav-badge {
  display: inline-block; min-width: 1.15em; padding: 0 0.35em;
  border-radius: 999px; background: var(--accent, #4f8cff); color: #fff;
  font-size: 0.72rem; font-weight: 700; text-align: center; line-height: 1.4;
}

.ws-review-controls { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.ws-review-file-tag { opacity: 0.75; }

/* ============================================================
   Cloche de notifications
   ============================================================ */
.notif-menu { position: relative; }
.notif-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: none; border: 1px solid var(--line-soft); color: inherit; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.notif-btn:hover { background: var(--bg-soft, rgba(127,127,127,.08)); }
.notif-btn.has-unread { color: var(--accent, #4f8cff); border-color: var(--accent, #4f8cff); }
.notif-btn.has-unread svg { animation: notif-ring 1.4s ease 1; }
@keyframes notif-ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); }
}
.notif-dot {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 999px; background: #e5484d; color: #fff;
  font-size: 0.66rem; font-weight: 700; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg, #0d1117);
}
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: 340px; max-width: 88vw;
  background: var(--bg-panel, var(--bg, #161b22)); border: 1px solid var(--line-soft);
  border-radius: 12px; box-shadow: 0 18px 44px rgba(0,0,0,.34); z-index: 120; overflow: hidden;
}
.notif-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--line-soft); font-size: 0.9rem;
}
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif-empty { padding: 1.4rem 1rem; text-align: center; opacity: 0.6; font-size: 0.88rem; margin: 0; }
.notif-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  border-bottom: 1px solid var(--line-soft); padding: 0.7rem 1rem; cursor: pointer;
  color: inherit; font: inherit;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-soft, rgba(127,127,127,.06)); }
.notif-item.is-unread { background: rgba(79,140,255,.09); }
.notif-item-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.76rem; margin-bottom: 0.3rem; }
.notif-item-top .notif-date { margin-left: auto; opacity: 0.6; }
.notif-file { opacity: 0.75; }
.notif-msg {
  margin: 0; font-size: 0.85rem; line-height: 1.4;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.notif-msg.expanded { display: block; -webkit-line-clamp: unset; white-space: pre-wrap; }
.notif-detail { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.6rem; }
.notif-author { font-size: 0.8rem; opacity: 0.8; }

/* Fil des commentaires reçus (côté utilisateur) */
.review-feed { display: flex; flex-direction: column; gap: 0.9rem; }
.review-item { border: 1px solid var(--line-soft); border-radius: 10px; padding: 1rem 1.2rem; }
.review-item-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.5rem; font-size: 0.82rem; }
.review-item-head .review-date { margin-left: auto; opacity: 0.7; }
.review-file { opacity: 0.75; }
.review-body { margin: 0 0 0.6rem; white-space: pre-wrap; }

/* ============================================================
   Landing : arrière-plan aurora élégant
   ============================================================ */
.aurora {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.5; pointer-events: none;
  will-change: transform;
}
.aurora-1 {
  width: 55vw; height: 42vh; right: -12vw; top: -14vh;
  background: radial-gradient(closest-side, rgba(79, 140, 255, 0.5), transparent);
  animation: aurora-drift 16s ease-in-out infinite;
}
.aurora-2 {
  width: 40vw; height: 36vh; right: 8vw; top: 26vh;
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.38), transparent);
  animation: aurora-drift 22s ease-in-out infinite reverse;
}
.aurora-3 {
  width: 34vw; height: 30vh; left: -10vw; top: 42vh;
  background: radial-gradient(closest-side, rgba(46, 230, 168, 0.22), transparent);
  animation: aurora-drift 27s ease-in-out infinite;
}
@keyframes aurora-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-4vw, 3vh) scale(1.12); }
  66% { transform: translate(3vw, -2vh) scale(0.94); }
}
.hero-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 28%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 32% 62%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.6px 1.6px at 54% 18%, rgba(158, 190, 255, 0.55), transparent),
    radial-gradient(1px 1px at 68% 48%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1.3px 1.3px at 82% 26%, rgba(196, 181, 253, 0.5), transparent),
    radial-gradient(1px 1px at 90% 66%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.2px 1.2px at 22% 84%, rgba(158, 190, 255, 0.4), transparent),
    radial-gradient(1px 1px at 44% 40%, rgba(255, 255, 255, 0.28), transparent);
  animation: stars-twinkle 6s ease-in-out infinite alternate;
}
@keyframes stars-twinkle {
  from { opacity: 0.55; }
  to { opacity: 1; }
}
html[data-theme="light"] .aurora { opacity: 0.35; }
html[data-theme="light"] .hero-stars { opacity: 0.25; }

/* ============================================================
   Bouton GitHub (signature, sur chaque page)
   ============================================================ */
.github-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--line); color: var(--muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}
.github-btn:hover { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.footer-github {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 0.9rem; color: var(--muted); text-decoration: none;
  font-size: 0.86rem; font-weight: 600; transition: color 0.2s;
}
.footer-github:hover { color: var(--accent); }

/* ============================================================
   Vérification e-mail / réinitialisation
   ============================================================ */
.verify-card {
  width: min(460px, 100%); text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 2.6rem 2.4rem;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
}
.verify-ico {
  display: grid; place-items: center; margin: 0 auto 1.2rem;
  width: 64px; height: 64px; border-radius: 18px;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line);
}
.verify-card h1 { font-size: 1.5rem; margin-bottom: 0.8rem; }
.verify-text { color: var(--muted); font-size: 0.93rem; margin-bottom: 1.4rem; }
.verify-form { display: flex; flex-direction: column; gap: 0.9rem; }
.code-input {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.9rem 1rem; color: var(--ink);
  font-family: var(--font-mono); font-size: 1.8rem; letter-spacing: 0.6em; text-align: center;
}
.code-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-input {
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  padding: 0.85rem 1rem; color: var(--ink); font-family: var(--font-body); font-size: 1rem;
  min-height: 44px; width: 100%;
}
.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.verify-resend { margin-top: 1.2rem; }
.as-button { background: none; border: 0; cursor: pointer; font-family: inherit; }
.forgot-link { text-align: right; margin-top: 0.6rem; font-size: 0.85rem; }

/* ============================================================
   Tickets : schéma des niveaux et liste
   ============================================================ */
.levels-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.8rem; margin-bottom: 1.6rem;
}
.levels-card h2 { font-size: 1.1rem; margin-bottom: 1.2rem; }
.levels-schema { display: flex; align-items: stretch; gap: 0.6rem; }
.level {
  flex: 1; border-radius: 12px; padding: 1.1rem 1.2rem;
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.35rem;
}
.level p { color: var(--muted); font-size: 0.84rem; flex: 1; }
.level-num {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.level-delay { font-size: 0.75rem; color: var(--faint); }
.level-1 { border-color: rgba(79, 140, 255, 0.4); background: rgba(79, 140, 255, 0.05); }
.level-1 .level-num { color: var(--accent); }
.level-2 { border-color: rgba(255, 176, 79, 0.4); background: rgba(255, 176, 79, 0.05); }
.level-2 .level-num { color: var(--orange); }
.level-3 { border-color: rgba(255, 84, 112, 0.45); background: rgba(255, 84, 112, 0.05); }
.level-3 .level-num { color: var(--red); }
.level-arrow { align-self: center; color: var(--faint); font-size: 1.2rem; }

.ticket-list { display: flex; flex-direction: column; gap: 1.1rem; }
.ticket {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.4rem 1.6rem;
}
.ticket-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.ticket-head h2 { font-size: 1.05rem; flex: 1; }
.level-badge-1 { background: rgba(79, 140, 255, 0.12); color: var(--accent); border: 1px solid rgba(79, 140, 255, 0.3); }
.level-badge-2 { background: rgba(255, 176, 79, 0.12); color: var(--orange); border: 1px solid rgba(255, 176, 79, 0.3); }
.level-badge-3 { background: rgba(255, 84, 112, 0.12); color: var(--red); border: 1px solid rgba(255, 84, 112, 0.3); }
.level-badge-1, .level-badge-2, .level-badge-3 {
  display: inline-flex; font-size: 0.72rem; font-weight: 700; padding: 0.24rem 0.66rem; border-radius: 999px; white-space: nowrap;
}
.ticket-meta { font-size: 0.8rem; color: var(--faint); margin: 0.4rem 0 0.7rem; }
.ticket-desc { color: var(--muted); font-size: 0.92rem; white-space: pre-line; }
.ticket-reponse {
  margin-top: 0.9rem; padding: 0.9rem 1.1rem; border-radius: 10px;
  background: rgba(46, 230, 168, 0.06); border: 1px solid rgba(46, 230, 168, 0.25);
}
.ticket-reponse-label {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--green);
}
.ticket-reponse p { color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }
.ticket-admin-form {
  display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; align-items: center;
}
.ticket-select, .ticket-textarea, .ticket-reponse-input {
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  padding: 0.6rem 0.9rem; color: var(--ink); font-family: var(--font-body); font-size: 0.92rem;
}
.ticket-reponse-input { flex: 1; min-width: 220px; }
.ticket-textarea { resize: vertical; }
.ticket-select:focus, .ticket-textarea:focus, .ticket-reponse-input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

@media (max-width: 760px) {
  .levels-schema { flex-direction: column; }
  .level-arrow { transform: rotate(90deg); }
}

/* ============================================================
   FAQ et pages légales
   ============================================================ */
.faq-main, .legal-main { max-width: 780px; }
.faq-group { margin-bottom: 2rem; }
.faq-group h2 {
  font-size: 1.05rem; color: var(--accent); margin-bottom: 0.8rem;
  padding-bottom: 0.4rem; border-bottom: 1px solid var(--line-soft);
}
.faq-item {
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 0.6rem;
  background: var(--panel); overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 0.9rem 1.2rem; font-weight: 600; font-size: 0.95rem;
  list-style: none; position: relative; padding-right: 2.4rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 1.25rem; font-weight: 400; transition: transform 0.25s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { padding: 0 1.2rem 1rem; color: var(--muted); font-size: 0.91rem; }
.faq-item code {
  font-family: var(--font-mono); font-size: 0.84em; background: var(--bg);
  border: 1px solid var(--line); border-radius: 5px; padding: 0.08rem 0.35rem;
}

.legal-block { margin-bottom: 1.8rem; }
.legal-block h2 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.legal-block p, .legal-block li { color: var(--muted); font-size: 0.93rem; }
.legal-block ul { padding-left: 1.3rem; margin: 0.5rem 0; }
.legal-block li { margin-bottom: 0.4rem; }

/* ============================================================
   Travaux pratiques — cadres redessinés
   ============================================================ */
.tp-rows { gap: 1.4rem; }
.tp-row {
  position: relative;
  grid-template-columns: 150px 1fr auto;
  padding: 1.9rem 2.1rem 1.9rem 2.3rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--panel) 0%, var(--bg-soft) 100%);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
/* Barre d'accent qui s'illumine au survol */
.tp-row::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), #8b5cf6);
  opacity: 0.35;
  transition: opacity 0.3s ease, width 0.3s ease;
}
/* Numéro en filigrane */
.tp-row::after {
  content: attr(data-code);
  position: absolute; right: 1.2rem; bottom: -1.6rem;
  font-family: var(--font-display); font-size: 6.5rem; font-weight: 700;
  color: var(--ink); opacity: 0.035; letter-spacing: -0.05em;
  pointer-events: none; user-select: none;
}
.tp-row:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 140, 255, 0.5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(79, 140, 255, 0.12);
}
.tp-row:hover::before { opacity: 1; width: 4px; }

.tp-row-code { gap: 0.8rem; }
.tp-row .tp-code {
  font-size: 1.5rem; padding: 0;
  background: linear-gradient(120deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: -0.03em;
}
.tp-row-body h2 { font-size: 1.28rem; margin-bottom: 0.5rem; letter-spacing: -0.015em; }
.tp-row-body p { font-size: 0.93rem; line-height: 1.7; margin-bottom: 0.9rem; max-width: 62ch; }
.tp-row .chip {
  background: var(--surface-tint);
  border-color: var(--line-soft);
  transition: border-color 0.2s, color 0.2s;
}
.tp-row:hover .chip { border-color: rgba(79, 140, 255, 0.35); }
.tp-row-actions { gap: 0.7rem; z-index: 1; }
.tp-row-actions .btn { justify-content: center; min-width: 176px; }
.tp-row-actions .btn-ghost { background: var(--surface-tint); }

html[data-theme="light"] .tp-row:hover {
  box-shadow: 0 20px 48px rgba(19, 26, 40, 0.14), 0 0 0 1px rgba(59, 111, 224, 0.12);
}

@media (max-width: 940px) {
  .tp-row { padding: 1.5rem 1.4rem 1.5rem 1.6rem; }
  .tp-row::after { font-size: 4.5rem; }
  .tp-row-actions .btn { min-width: 0; flex: 1; }
}

/* ============================================================
   Lien GitHub — halo respirant + rotation au survol
   ============================================================ */
.github-btn { position: relative; overflow: visible; }
.github-btn::before {
  content: '';
  position: absolute; inset: -1px; border-radius: 10px;
  border: 1px solid rgba(79, 140, 255, 0.55);
  opacity: 0;
  animation: gh-breathe 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes gh-breathe {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.16); }
}
.github-btn svg { transition: transform 0.55s cubic-bezier(0.3, 1.4, 0.4, 1); }
.github-btn:hover svg { transform: rotate(360deg) scale(1.12); }
.github-btn:hover::before { animation-play-state: paused; opacity: 0; }

.footer-github { position: relative; }
.footer-github::after {
  content: '';
  position: absolute; left: 22px; bottom: -3px; right: 100%;
  height: 1.5px; background: linear-gradient(90deg, var(--accent), #8b5cf6);
  transition: right 0.35s ease;
}
.footer-github:hover::after { right: 0; }
.footer-github svg { transition: transform 0.5s ease; }
.footer-github:hover svg { transform: rotate(-12deg) scale(1.15); }

/* ============================================================
   Bandeau de récupération (overlay orange) + espace récupération
   ============================================================ */
.recovery-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  padding: 0.55rem 1rem;
  background: linear-gradient(90deg, #b45309, #d97706, #b45309);
  color: #fff7ed; font-size: 0.86rem; font-weight: 600;
  box-shadow: 0 6px 24px rgba(217, 119, 6, 0.35);
  animation: banner-in 0.5s ease;
}
@keyframes banner-in { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.recovery-banner svg { flex-shrink: 0; }
.recovery-banner-link {
  color: #fff; text-decoration: underline; text-underline-offset: 3px;
  font-weight: 700; white-space: nowrap;
}
.recovery-banner-link:hover { text-decoration-thickness: 2px; }
.site-header.with-banner { top: 37px; }
body:has(.recovery-banner) { padding-top: 37px; }
.nav-recovery { color: #f59e0b !important; }
.nav-recovery::after { background: #f59e0b !important; }
.recovery-accent { color: #f59e0b; }

@media (max-width: 640px) {
  .recovery-banner { font-size: 0.76rem; flex-wrap: wrap; text-align: center; }
}

/* ---------- Résolution perte de données (ticket admin) ---------- */
.ticket-recovery-box {
  display: flex; align-items: center; gap: 1.2rem; justify-content: space-between;
  margin-top: 0.9rem; padding: 0.9rem 1.1rem; border-radius: 10px;
  background: rgba(245, 158, 11, 0.07); border: 1px solid rgba(245, 158, 11, 0.35);
}
.ticket-recovery-box strong { font-size: 0.9rem; color: #f59e0b; }
.ticket-recovery-box p { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }
.ticket-recovery-box form { flex-shrink: 0; }

/* ---------- TP retirés (admin) + bouton danger ---------- */
.btn-danger {
  border: 1px solid rgba(255, 84, 112, 0.4); color: var(--red); background: transparent;
}
.btn-danger:hover { background: rgba(255, 84, 112, 0.1); border-color: var(--red); }
.hidden-tps {
  margin-top: 2.2rem; padding: 1.6rem 1.8rem;
  border: 1px dashed var(--line); border-radius: 14px; opacity: 0.85;
}
.hidden-tps h2 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.hidden-tp-list { list-style: none; margin-top: 1rem; }
.hidden-tp-list li {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px dashed var(--line-soft);
}
.hidden-tp-list li:last-child { border-bottom: none; }
.hidden-tp-list .tp-code { font-size: 0.95rem; }
.hidden-tp-title { flex: 1; color: var(--muted); font-size: 0.92rem; }

/* ============================================================
   Corrections : bouton verrouillé, défi, consultation
   ============================================================ */
.btn-lock {
  border: 1px solid rgba(139, 92, 246, 0.45); color: #a78bfa; background: transparent;
  gap: 0.45rem;
}
.btn-lock:hover { background: rgba(139, 92, 246, 0.12); border-color: #8b5cf6; transform: translateY(-1px); }

.defi-card { width: min(500px, 100%); }
.defi-ico { color: #a78bfa; background: rgba(139, 92, 246, 0.12); }
.defi-type { margin-bottom: 0.8rem; }
.defi-question {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.2rem 1.4rem; margin: 1.2rem 0;
  font-size: 1.05rem; font-weight: 600; line-height: 1.6;
}
.defi-input { text-align: center; font-size: 1.05rem; }
.defi-hint { margin-top: 1.1rem; text-align: left; }
.defi-hint summary {
  cursor: pointer; color: var(--faint); font-size: 0.85rem; list-style: none;
  text-align: center;
}
.defi-hint summary::-webkit-details-marker { display: none; }
.defi-hint summary:hover { color: var(--accent); }
.defi-hint p {
  margin-top: 0.5rem; padding: 0.7rem 1rem; border-radius: 9px;
  background: var(--accent-soft); color: var(--muted); font-size: 0.86rem; text-align: center;
}

.correction-frame { width: 100%; height: 460px; border: 0; background: #fff; display: block; }
.correction-code {
  margin: 0; padding: 1.2rem 1.4rem; overflow-x: auto;
  background: #0a101d; color: #d6e2f5;
  font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.7;
  max-height: 480px; overflow-y: auto;
}
html[data-theme="light"] .correction-code { background: #f6f8fc; color: #24324a; }
.correction-img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.corr-select-form select { width: 100%; }
.corr-upload {
  margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line-soft);
  display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap;
}
.corr-upload .settings-note { flex-basis: 100%; }

/* ============================================================
   Bot de récupération de mot de passe
   ============================================================ */
.bot-card {
  width: min(480px, 100%);
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 1.6rem 1.8rem 1.4rem;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
}
.bot-head {
  display: flex; align-items: center; gap: 0.8rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 1.2rem;
}
.bot-avatar {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #4f8cff, #8b5cf6); color: #fff;
}
.bot-head strong { display: block; font-size: 0.95rem; }
.bot-status { font-size: 0.72rem; color: var(--green); display: inline-flex; align-items: center; gap: 0.4rem; }
.bot-chat { display: flex; flex-direction: column; gap: 0.7rem; }
.bot-msg {
  align-self: flex-start; max-width: 92%;
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: 12px; border-bottom-left-radius: 4px;
  padding: 0.7rem 1rem; font-size: 0.9rem; color: var(--ink); line-height: 1.6;
  animation: bot-in 0.4s ease;
}
@keyframes bot-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bot-msg-error { border-color: rgba(255, 84, 112, 0.45); background: rgba(255, 84, 112, 0.07); color: #ff8ba0; }
.bot-form { display: flex; gap: 0.6rem; margin-top: 0.4rem; }
.bot-form .auth-input { flex: 1; }
.bot-form-captcha { flex-wrap: wrap; }
.bot-form-captcha input[name="sum"] { max-width: 110px; }
.bot-captcha { display: flex; gap: 0.8rem; margin-top: 0.3rem; }
.captcha-box {
  flex: 1; text-align: center; padding: 0.8rem;
  background: var(--bg); border: 1px dashed var(--line); border-radius: 10px;
}
.captcha-label {
  display: block; font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.4rem;
}
.captcha-sum { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700; }
.captcha-word {
  display: inline-flex; gap: 0.35rem; user-select: none;
  font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700;
  color: var(--accent);
  background: repeating-linear-gradient(-15deg, transparent 0 6px, rgba(128, 145, 180, 0.18) 6px 7px);
  padding: 0.1rem 0.5rem; border-radius: 6px;
}
.captcha-word span { display: inline-block; }
.bot-temp-pass {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgba(46, 230, 168, 0.07); border: 1px solid rgba(46, 230, 168, 0.35);
  border-radius: 12px; padding: 0.9rem 1.2rem;
}
.bot-temp-pass .mono { font-size: 1.25rem; font-weight: 700; color: var(--green); letter-spacing: 0.08em; }

/* ============================================================
   Défi : fiche de cours associée + jauge de proximité
   ============================================================ */
.defi-layout {
  display: grid; grid-template-columns: minmax(340px, 480px) 1fr;
  gap: 1.6rem; align-items: start;
}
.defi-layout .defi-card { width: 100%; }
.defi-fiche {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--panel); position: sticky; top: 84px;
}
.defi-fiche-head h2 { font-size: 0.98rem; }
.defi-fiche-frame { width: 100%; height: min(72vh, 640px); border: 0; display: block; background: #0d1424; }

.defi-gauge { display: flex; align-items: center; gap: 0.9rem; }
.defi-gauge-track {
  flex: 1; height: 10px; border-radius: 5px;
  background: var(--line-soft); overflow: hidden;
}
.defi-gauge-fill {
  height: 100%; width: 0; border-radius: 5px;
  background: linear-gradient(90deg, #ff5470, #e2405d);
  transition: width 0.35s ease, background 0.35s ease;
}
.defi-gauge-label { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.defi-gauge-label strong { font-family: var(--font-mono); color: var(--ink); }

@media (max-width: 1000px) {
  .defi-layout { grid-template-columns: 1fr; }
  .defi-fiche { position: static; }
  .defi-fiche-frame { height: 420px; }
}

/* ============================================================
   Présence (en ligne / hors ligne) + accès corrections
   ============================================================ */
.presence {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.78rem; font-weight: 600; color: var(--faint);
  vertical-align: middle;
}
.presence-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--faint); display: inline-block;
}
.presence-on { color: var(--green); }
.presence-on .presence-dot {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(46, 230, 168, 0.5);
  animation: pulse 2s ease-in-out infinite;
}
h1 .presence { margin-left: 0.8rem; font-size: 0.85rem; }

.chip-unlock {
  cursor: pointer; background: rgba(46, 230, 168, 0.1);
  border: 1px solid rgba(46, 230, 168, 0.35); color: var(--green);
  font-family: var(--font-body); font-weight: 600;
}
.chip-unlock:hover { background: rgba(255, 84, 112, 0.12); border-color: var(--red); color: var(--red); }

/* ============================================================
   Bouton Fiche Auteur + tutoriel GitHub
   ============================================================ */
.btn-author {
  background: #171b23; color: #fff; border: 1px solid #30363d; gap: 0.55rem;
}
.btn-author:hover {
  transform: translateY(-2px); border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(79, 140, 255, 0.25);
}
.btn-author svg { transition: transform 0.5s ease; }
.btn-author:hover svg { transform: rotate(360deg); }
html[data-theme="light"] .btn-author { background: #24292f; border-color: #24292f; }

.gh-sub { font-size: 0.92rem; color: var(--ink); margin: 1rem 0 0.4rem; font-weight: 600; }
.gh-code {
  background: #0a101d; border: 1px solid var(--line); border-radius: 10px;
  padding: 0.9rem 1.1rem; overflow-x: auto; margin: 0.6rem 0 1rem;
  font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.7; color: #d6e2f5;
}
html[data-theme="light"] .gh-code { background: #f6f8fc; color: #24324a; }
.legal-block code {
  font-family: var(--font-mono); font-size: 0.85em; background: var(--bg);
  border: 1px solid var(--line); border-radius: 5px; padding: 0.08rem 0.35rem;
}
.legal-block h3 { font-size: 0.95rem; }

/* ============================================================
   Responsive global — tablette et mobile
   ============================================================ */
@media (max-width: 1080px) {
  .defi-fiche-frame { height: 380px; }
}

@media (max-width: 820px) {
  /* Têtes de pages : empilées */
  .page-head { flex-direction: column; align-items: stretch; gap: 1rem; }
  .page-head .dash-controls, .page-head .subnav { align-self: flex-start; flex-wrap: wrap; }

  /* Supervision */
  .ticker-value { font-size: 1.3rem; }
  .ticker-cell { padding: 0.9rem 1rem; }
  .chart-host { height: 280px; }

  /* Travaux pratiques : boutons sur deux colonnes */
  .tp-row-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .tp-row-actions .btn { min-width: 0; }

  /* Tickets : formulaire admin empilé */
  .ticket-admin-form { flex-direction: column; align-items: stretch; }
  .ticket-recovery-box { flex-direction: column; align-items: flex-start; }

  /* Cours : lignes qui respirent */
  .cours-row { flex-wrap: wrap; row-gap: 0.3rem; }
  .cours-titre { flex-basis: 100%; order: 3; }

  /* Corrections */
  .correction-frame { height: 340px; }
  .corr-upload { flex-direction: column; align-items: stretch; }

  /* Vue lecteur admin */
  .ws-head { flex-wrap: wrap; gap: 0.6rem; }
}

@media (max-width: 520px) {
  .wrap, .page-main { width: 94vw; }

  /* Hero */
  .hero { padding-top: 2.6rem; }
  .hero-credit { font-size: 0.8rem; }
  .panel-ticker { font-size: 0.66rem; gap: 0.7rem; }
  .marquee-track { font-size: 0.7rem; }

  /* Cartes d'authentification et bot */
  .auth-main { padding: 1.2rem 3vw 2.5rem; }
  .verify-card, .bot-card { padding: 1.6rem 1.2rem; }
  .code-input { font-size: 1.4rem; letter-spacing: 0.4em; }
  .bot-captcha { flex-direction: column; }
  .bot-form { flex-direction: column; }
  .bot-form .btn { width: 100%; }
  .bot-temp-pass { flex-direction: column; text-align: center; }

  /* Défis */
  .defi-question { font-size: 0.95rem; padding: 0.9rem 1rem; }
  .defi-gauge { flex-direction: column; align-items: stretch; gap: 0.4rem; }
  .defi-gauge-label { text-align: right; }

  /* Tickets / niveaux */
  .levels-card { padding: 1.2rem 1rem; }
  .ticket { padding: 1.1rem 1.2rem; }
  .ticket-head h2 { font-size: 0.95rem; }

  /* TP : actions sur une colonne */
  .tp-row-actions { grid-template-columns: 1fr; }
  .tp-row::after { display: none; }

  /* Tableaux : la zone défile, les cellules se resserrent */
  .data-table th, .data-table td { padding: 0.6rem 0.8rem; font-size: 0.8rem; }
  .ua-cell { max-width: 140px; }

  /* Paramètres / cartes */
  .settings-card { padding: 1.3rem 1.1rem; }
  .footer-grid { padding: 2rem 0; }

  /* Visionneuse */
  .viewer-frame, .viewer-frame-zone { min-height: 60vh; }
  .viewer-bar { gap: 0.6rem; }
  .viewer-title { font-size: 0.9rem; flex-basis: 100%; order: 3; }

  /* Bulle admin corrections */
  .hidden-tp-list li { flex-wrap: wrap; }
}

/* ============================================================
   Navigation réorganisée : menus déroulants Aide + compte
   ============================================================ */
.nav-drop { position: relative; }
.nav-drop-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font-family: var(--font-body);
  font-weight: 500; font-size: 0.92rem; padding: 0.3rem 0;
  transition: color 0.2s;
}
.nav-drop-btn:hover, .nav-drop-btn.active { color: var(--ink); }
.nav-drop-btn svg { transition: transform 0.25s ease; }
.nav-drop.open .nav-drop-btn svg { transform: rotate(180deg); }

.nav-drop-menu {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(-6px);
  min-width: 200px; list-style: none; padding: 0.5rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 120;
}
.nav-drop.open .nav-drop-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-drop-menu a {
  display: block; padding: 0.55rem 0.9rem; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-drop-menu a:hover, .nav-drop-menu a.active { background: var(--accent-soft); color: var(--ink); }
.nav-drop-menu a::after { display: none; }

.user-menu { position: relative; }
.user-chip-btn { cursor: pointer; background: none; font-family: var(--font-body); transition: border-color 0.2s; }
.user-chip-btn:hover { border-color: var(--accent); }
.user-chip-btn svg { transition: transform 0.25s ease; color: var(--faint); }
.user-menu.open .user-chip-btn svg { transform: rotate(180deg); }
.user-menu-panel {
  position: absolute; top: calc(100% + 12px); right: 0;
  min-width: 220px; padding: 0.5rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 120;
}
.user-menu.open .user-menu-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu-mail {
  display: block; padding: 0.5rem 0.9rem 0.7rem; font-size: 0.72rem; color: var(--faint);
  border-bottom: 1px solid var(--line-soft); margin-bottom: 0.4rem;
  overflow: hidden; text-overflow: ellipsis;
}
.user-menu-panel a, .user-menu-panel form button {
  display: block; width: 100%; text-align: left;
  padding: 0.55rem 0.9rem; border-radius: 8px; border: 0; background: none; cursor: pointer;
  color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  font-family: var(--font-body); transition: background 0.15s, color 0.15s;
}
.user-menu-panel a:hover, .user-menu-panel a.active { background: var(--accent-soft); color: var(--ink); }
.user-menu-panel form button:hover { background: rgba(255, 84, 112, 0.1); color: var(--red); }

/* Version mobile (menu burger) : les groupes sont mis à plat */
@media (max-width: 900px) {
  .nav-drop { position: static; }
  .nav-drop-btn {
    pointer-events: none; width: 100%;
    font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--faint);
    padding: 0.8rem 0 0.2rem; border-top: 1px solid var(--line-soft); margin-top: 0.5rem;
  }
  .nav-drop-btn svg { display: none; }
  .nav-drop-menu {
    position: static; transform: none; opacity: 1; visibility: visible;
    min-width: 0; padding: 0; background: none; border: 0; box-shadow: none;
  }
  .nav-drop-menu a { padding: 0.6rem 0; font-size: 1rem; }
}

/* Tutoriel GitHub : étiquettes OS, notes, table de commandes */
.gh-os {
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 0.18rem 0.6rem;
  margin-left: 0.5rem; vertical-align: middle;
}
.gh-note { font-size: 0.85rem; color: var(--faint); margin: -0.4rem 0 1rem; }
.gh-table-wrap { overflow-x: auto; margin: 0.6rem 0 1rem; }
.gh-cmds {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.gh-cmds th {
  text-align: left; padding: 0.6rem 0.9rem; background: var(--surface-tint);
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line);
}
.gh-cmds td { padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.gh-cmds tr:last-child td { border-bottom: none; }

/* ============================================================
   Avatars : image ou initiale
   ============================================================ */
.avatar-el {
  display: inline-grid; place-items: center; overflow: hidden;
  border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-family: var(--font-display);
}
img.avatar-el { object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 0.85rem; }
.avatar-lg { width: 96px; height: 96px; font-size: 2.4rem; border: 1px solid var(--line); }

.avatar-settings { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.avatar-current { flex-shrink: 0; }
.avatar-actions { display: flex; flex-direction: column; gap: 0.7rem; align-items: flex-start; }
.avatar-actions .settings-note { margin-bottom: 0.2rem; }

/* Recadrage (superposition) */
.cropper-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center; padding: 1.2rem;
  background: rgba(4, 6, 14, 0.7); backdrop-filter: blur(4px);
}
.cropper-box {
  width: min(360px, 100%); background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 1.6rem;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5); text-align: center;
}
.cropper-box h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.cropper-stage {
  position: relative; width: 300px; height: 300px; margin: 1.2rem auto 0;
  border-radius: 12px; overflow: hidden; cursor: grab; touch-action: none;
  background: #0a101d;
}
.cropper-stage:active { cursor: grabbing; }
#cropper-canvas { display: block; }
.cropper-mask {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 2000px rgba(4, 6, 14, 0.55);
  -webkit-mask: radial-gradient(circle 150px at 50% 50%, transparent 149px, #000 150px);
          mask: radial-gradient(circle 150px at 50% 50%, transparent 149px, #000 150px);
}
.cropper-mask::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 300px; height: 300px; transform: translate(-50%, -50%);
  border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.cropper-zoom {
  display: flex; align-items: center; gap: 0.8rem; margin: 1.2rem 0 0.4rem;
  font-size: 0.8rem; color: var(--muted);
}
.cropper-zoom input { flex: 1; accent-color: var(--accent); }
.cropper-buttons { display: flex; justify-content: flex-end; gap: 0.7rem; margin-top: 1.2rem; }

/* ============================================================
   Durcissement responsile mobile — anti-débordement horizontal
   ============================================================ */
/* Rien ne doit dépasser la largeur de l'écran */
img, canvas, svg, iframe, video, pre, table { max-width: 100%; }
/* Les mots/URL très longs coupent au lieu de pousser la page */
h1, h2, h3, p, li, .cours-titre, .ticket-desc, .hero h1 { overflow-wrap: anywhere; }
.mono, code { overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 480px) {
  /* Marges latérales resserrées et cohérentes */
  .wrap, .page-main { width: 92vw; }
  body { font-size: 0.97rem; }

  /* Hero : titre qui ne déborde jamais */
  .hero h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); max-width: 100%; }
  .hero-panel { margin-top: 2rem; }
  .panel-bar { flex-wrap: wrap; row-gap: 4px; }
  .panel-title { margin-left: 0.4rem; }
  .panel-live { margin-left: auto; }

  /* En-têtes de section */
  .sec-head h2, .split-2 h2, .page-head h1 { font-size: clamp(1.4rem, 6.5vw, 1.9rem); }

  /* Bandeaux d'infos : une seule colonne, pas de largeur forcée */
  .strip-grid { grid-template-columns: 1fr 1fr; }
  .ticker-row, .dash-panels, .cards-grid, .access-grid,
  .feature-grid, .pillars, .split { grid-template-columns: 1fr; }
  .ticker-cell { border-left: none; border-top: 1px solid var(--line-soft); }
  .ticker-cell:first-child { border-top: none; }

  /* Tableaux : défilement interne, jamais la page entière */
  .table-scroll, .gh-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Recadrage d'avatar : cercle adapté aux petits écrans */
  .cropper-box { padding: 1.2rem; }
  .cropper-stage { width: 84vw; height: 84vw; max-width: 300px; max-height: 300px; }

  /* Bot de récupération : captcha lisible sans déborder */
  .captcha-word { font-size: 1.15rem; letter-spacing: 0.15em; }
  .code-input { letter-spacing: 0.35em; font-size: 1.3rem; }

  /* Barre de navigation : le nom d'utilisateur peut tomber */
  .brand-text { font-size: 0.98rem; }
  .nav-actions { gap: 0.45rem; }

  /* Boutons pleine largeur cohérents */
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
}

/* Très petits écrans (≤360px, ex. repli portrait) */
@media (max-width: 360px) {
  .strip-grid { grid-template-columns: 1fr; }
  .marquee-track { font-size: 0.66rem; gap: 1.4rem; }
  .btn-sm { padding: 0.5rem 0.8rem; }
}

/* ============================================================
   Atelier : poignée de redimensionnement éditeur / aperçu
   ============================================================ */
.vsc-splitter {
  flex: 0 0 6px; background: var(--vsc-border, #1a1a1a);
  cursor: col-resize; position: relative; z-index: 5;
  transition: background 0.15s;
}
.vsc-splitter::before {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 2px; height: 30px; border-radius: 2px; background: rgba(255, 255, 255, 0.25);
}
.vsc-splitter:hover { background: var(--vsc-status, #007acc); }
@media (max-width: 1080px) {
  .vsc-splitter { flex-basis: 6px; width: 100%; cursor: row-resize; }
  .vsc-splitter::before { width: 30px; height: 2px; }
}

/* ============================================================
   Quiz de déblocage (QCM)
   ============================================================ */
.quiz-main { max-width: 760px; }
.quiz-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.8rem; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.quiz-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.4rem; }
.quiz-head h1 { font-size: 1.3rem; line-height: 1.25; }
.quiz-sub { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; }
.quiz-form { display: flex; flex-direction: column; gap: 1.1rem; }
.quiz-q { border: 1px solid var(--line-soft); border-radius: 12px; padding: 1.1rem 1.2rem; }
.quiz-q legend {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  font-weight: 600; font-size: 0.98rem; padding: 0; margin-bottom: 0.8rem;
}
.quiz-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.8rem;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.quiz-text { flex: 1; min-width: 0; }
.quiz-tag { flex-shrink: 0; }
.quiz-options { display: grid; gap: 0.5rem; }
.quiz-opt {
  display: flex; align-items: center; gap: 0.7rem; cursor: pointer;
  padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: 9px;
  transition: border-color 0.15s, background 0.15s;
}
.quiz-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.quiz-opt input { display: none; }
.quiz-opt-mark {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); position: relative; transition: border-color 0.15s;
}
.quiz-opt input:checked ~ .quiz-opt-mark { border-color: var(--accent); }
.quiz-opt input:checked ~ .quiz-opt-mark::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent);
}
.quiz-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.quiz-opt-txt { font-size: 0.92rem; }
.quiz-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.6rem; }

@media (max-width: 480px) {
  .quiz-card { padding: 1.2rem; }
  .quiz-actions { flex-direction: column-reverse; }
  .quiz-actions .btn { width: 100%; }
}

/* ============================================================
   Code libre (playground)
   ============================================================ */
.pg-bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 1rem; background: var(--vsc-chrome, #252526);
  border-bottom: 1px solid var(--vsc-border, #1a1a1a);
}
.pg-lang { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; color: var(--vsc-text-dim, #858585); }
.pg-lang select {
  background: var(--vsc-editor, #1e1e1e); color: var(--vsc-text, #ccc);
  border: 1px solid var(--vsc-border-soft, #2d2d30); border-radius: 7px;
  padding: 0.4rem 0.7rem; font-family: var(--font-body); font-size: 0.88rem; cursor: pointer;
}
.pg-hint { flex: 1; min-width: 160px; font-size: 0.8rem; color: var(--vsc-text-dim, #858585); }
.pg-actions { display: flex; gap: 0.5rem; }

/* ============================================================
   Bannissement (modération)
   ============================================================ */
.ban-card.is-banned { border-color: rgba(255, 84, 112, 0.4); }
.ban-form { display: flex; gap: 0.6rem; margin-top: 0.8rem; flex-wrap: wrap; }
.ban-form .ticket-reponse-input { flex: 1; min-width: 220px; }
.ban-notice { text-align: center; }
.ban-ico { color: var(--red); background: rgba(255, 84, 112, 0.12); }
.ban-reason {
  text-align: left; margin: 1.2rem 0;
  background: rgba(255, 84, 112, 0.07); border: 1px solid rgba(255, 84, 112, 0.35);
  border-radius: 10px; padding: 0.9rem 1.1rem;
}
.ban-reason-label {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--red);
}
.ban-reason p { color: var(--muted); font-size: 0.92rem; margin-top: 0.3rem; }

/* ============================================================
   Nouvelles fonctionnalités : annonces, recherche, progression,
   multi-résolution, checklist, vérif, comparaison, badges
   ============================================================ */

/* Bandeau d'annonces (bleu) */
.annonce-banner {
  position: relative; z-index: 90;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(90deg, #1e40af, #3b6fe0, #1e40af);
  color: #eaf1ff; font-size: 0.85rem; font-weight: 600;
}
.annonce-banner svg { flex-shrink: 0; }
.annonce-off button {
  background: rgba(255,255,255,0.15); border: 0; color: #fff; cursor: pointer;
  width: 20px; height: 20px; border-radius: 50%; line-height: 1; font-size: 14px;
}
.annonce-off { display: inline; }

/* Bouton recherche + overlay */
.search-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  background: transparent; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.search-btn:hover { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }
.search-overlay {
  position: fixed; inset: 0; z-index: 400; background: rgba(4,6,14,0.6);
  backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh;
}
.search-box {
  width: min(560px, 92vw); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.search-input-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.search-input-row input { flex: 1; background: none; border: 0; color: var(--ink); font-family: var(--font-body); font-size: 1rem; outline: none; }
.search-esc { font-size: 0.65rem; border: 1px solid var(--line); border-radius: 5px; padding: 0.1rem 0.4rem; color: var(--faint); }
.search-results { list-style: none; max-height: 55vh; overflow-y: auto; padding: 0.4rem; }
.search-item a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0.9rem; border-radius: 8px; text-decoration: none; }
.search-item.sel a, .search-item a:hover { background: var(--accent-soft); }
.search-t { color: var(--ink); font-size: 0.92rem; }
.search-cat { color: var(--faint); font-size: 0.72rem; white-space: nowrap; }
.search-none { padding: 1rem; text-align: center; color: var(--faint); font-size: 0.9rem; }

/* Barre de progression + badges (page TP) */
.progress-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.4rem; margin-bottom: 1.4rem; }
.progress-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.progress-label { font-size: 0.95rem; color: var(--muted); }
.progress-label strong { color: var(--accent); font-size: 1.15rem; }
.progress-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.progress-badge { font-size: 0.75rem; font-weight: 600; padding: 0.28rem 0.7rem; border-radius: 999px; background: var(--surface-tint); border: 1px solid var(--line); }
.progress-bar { height: 10px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.progress-bar .progress-bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), #2ee6a8); transition: width .6s ease; }

/* Aperçu multi-résolution */
.res-switch { display: inline-flex; margin-left: auto; margin-right: 0.4rem; border: 1px solid var(--vsc-border-soft, #2d2d30); border-radius: 7px; overflow: hidden; }
.res-btn { background: transparent; border: 0; color: var(--vsc-text-dim, #858585); font-family: var(--font-body); font-size: 0.72rem; font-weight: 600; padding: 0.3rem 0.6rem; cursor: pointer; }
.res-btn.active { background: var(--vsc-status, #007acc); color: #fff; }
.preview-stage { flex: 1; min-height: 0; overflow: auto; background: var(--vsc-chrome, #252526); }
.preview-stage.framed { padding: 12px 0; }
.preview-stage.framed .vsc-preview-frame { height: 100%; min-height: 600px; border: 1px solid var(--vsc-border, #1a1a1a); box-shadow: 0 8px 30px rgba(0,0,0,0.4); background: #fff; }
.vsc-preview-frame { flex: 1; border: 0; width: 100%; height: 100%; background: #fff; }

/* Vérification W3C + checks */
.verify-results { margin-top: 0.6rem; font-size: 0.8rem; }
.verify-loading, .aide-none { color: var(--vsc-text-dim, #858585); font-size: 0.8rem; }
.verify-checks, .verify-w3c { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; margin: 0.3rem 0; }
.verify-checks .vok, .verify-w3c-ok { color: #2ee6a8; }
.verify-checks .vko, .verify-w3c .vko { color: #ff7a90; }
.verify-w3c .vwarn { color: #ffb04f; }
.verify-w3c-title { color: var(--vsc-text, #ccc); font-weight: 600; margin-top: 0.5rem; }
.verify-w3c { max-height: 200px; overflow-y: auto; }

/* Check-list du TP */
.tp-checklist { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.tp-checklist label { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.8rem; color: var(--vsc-text, #ccc); cursor: pointer; }
.tp-checklist input { margin-top: 0.15rem; accent-color: var(--vsc-status, #007acc); }
.tp-checklist input:checked + span { text-decoration: line-through; color: var(--vsc-text-dim, #858585); }

/* Comparaison côte à côte */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.compare-col { display: flex; flex-direction: column; background: var(--panel); }
.compare-label { padding: 0.5rem 0.9rem; font-size: 0.75rem; font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.compare-label-ok { color: var(--green); }
.compare-col .correction-frame { height: 420px; }
.compare-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.9rem; background: var(--panel-2, rgba(127,127,127,.05));
  color: var(--muted); text-align: center; padding: 1.5rem;
}
@media (max-width: 820px) { .compare-grid { grid-template-columns: 1fr; } }

/* Progression admin : matrice */
.progression-table th, .progression-table td { text-align: center; white-space: nowrap; }
.progression-table td:first-child, .progression-table th:first-child { text-align: left; }
.prog-cell { font-size: 1rem; }
.prog-ok { color: var(--green); font-weight: 700; }
.prog-no { color: var(--faint); }
.export-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.4rem; }

/* Annonce : composer (dashboard) */
.annonce-compose { display: flex; gap: 0.6rem; margin-top: 0.8rem; flex-wrap: wrap; }
.annonce-compose input { flex: 1; min-width: 220px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 0.6rem 0.9rem; color: var(--ink); font-family: var(--font-body); }

/* ============================================================
   Publication GitHub (modale)
   ============================================================ */
.gh-modal { position: fixed; inset: 0; z-index: 400; background: rgba(4,6,14,0.65); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 1.2rem; }
.gh-modal-box { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1.6rem; box-shadow: 0 40px 100px rgba(0,0,0,0.5); }
.gh-modal-box h3 { font-size: 1.15rem; margin-bottom: 1rem; }
.gh-mode { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.8rem 0; }
.gh-mode label { display: flex; gap: 0.5rem; align-items: center; font-size: 0.92rem; color: var(--muted); cursor: pointer; }
#gh-new-fields, #gh-existing-fields { display: flex; flex-direction: column; gap: 0.6rem; }
#gh-repo-select { width: 100%; }
.gh-check { display: flex; gap: 0.5rem; align-items: center; font-size: 0.88rem; color: var(--muted); }
.gh-modal-actions { display: flex; justify-content: flex-end; gap: 0.7rem; margin-top: 1.2rem; }
.gh-result { margin-top: 1rem; font-size: 0.9rem; }
.gh-ok { color: var(--green); }
.gh-ok a { color: var(--accent); }
.gh-err { color: var(--red); }
.gh-loading { color: var(--muted); }

.gh-modal-box { position: relative; max-height: 88vh; overflow-y: auto; }
.gh-close {
  position: absolute; top: 0.7rem; right: 0.9rem; background: none; border: none;
  color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.gh-close:hover { color: var(--text); }
.gh-field { margin: 0.9rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.gh-field-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.gh-optional { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: 0.7; }
#gh-branch-select { width: 100%; }
.gh-files-list {
  display: flex; flex-direction: column; gap: 0.25rem; max-height: 180px; overflow-y: auto;
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 0.5rem 0.7rem;
}
.gh-file { display: flex; gap: 0.5rem; align-items: center; font-size: 0.84rem; cursor: pointer; }
.gh-file .mono { color: var(--muted); }

/* Spinner du bouton de publication */
#gh-publish, #ghp-enable { display: inline-flex; align-items: center; gap: 0.5rem; }
.gh-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  animation: gh-spin 0.7s linear infinite; display: inline-block;
}
@keyframes gh-spin { to { transform: rotate(360deg); } }

.gh-readme-area { width: 100%; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
.gh-warn {
  margin: 0.9rem 0; padding: 0.8rem 1rem; border-radius: 10px;
  background: rgba(229,72,77,0.08); border: 1px solid rgba(229,72,77,0.35);
  color: var(--text); font-size: 0.86rem; line-height: 1.45;
  display: flex; flex-direction: column; gap: 0.7rem; align-items: flex-start;
}

/* Menu « ⋯ » d'un TP */
.tp-menu { position: relative; display: inline-block; }
.tp-menu-btn { padding-left: 0.5rem; padding-right: 0.5rem; }
.tp-menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 240px; padding: 0.4rem; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(0,0,0,0.35);
  display: none; flex-direction: column; gap: 0.15rem;
}
.tp-menu.open .tp-menu-panel { display: flex; }
.tp-menu-item {
  display: flex; align-items: center; gap: 0.55rem; width: 100%;
  padding: 0.55rem 0.7rem; border: none; background: none; cursor: pointer;
  color: var(--text); font: inherit; font-size: 0.88rem; text-align: left; border-radius: 7px;
}
.tp-menu-item:hover { background: var(--bg-soft, rgba(127,127,127,0.1)); }
.tp-menu-item svg { flex: 0 0 auto; opacity: 0.85; }
.tp-menu-danger { color: var(--red); }
.tp-menu-danger:hover { background: rgba(229,72,77,0.12); }
@media (max-width: 820px) { .tp-menu-panel { right: auto; left: 0; } }
/* Rangée dont le menu est ouvert : on lève le clip pour voir le panneau. */
.tp-row.menu-open { overflow: visible; z-index: 50; }

/* ============================================================
   Ma synthèse (fiche de révision)
   ============================================================ */
.rev-toc {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.4rem;
  position: sticky; top: 66px; z-index: 20; padding: 0.6rem 0;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.rev-toc a {
  font-size: 0.82rem; padding: 0.35rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--line-soft); color: var(--muted); text-decoration: none; white-space: nowrap;
}
.rev-toc a:hover { border-color: var(--accent); color: var(--ink); }
.rev-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem 1.6rem; margin-bottom: 1.2rem;
  background: linear-gradient(180deg, var(--panel), var(--bg-soft)); scroll-margin-top: 120px;
}
.rev-card h2 { font-size: 1.15rem; color: var(--accent); margin-bottom: 0.9rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--line); }
.rev-card p { color: var(--muted); margin: 0.6rem 0; line-height: 1.65; }
.rev-card ul { padding-left: 1.2rem; margin: 0.6rem 0; }
.rev-card li { color: var(--muted); margin-bottom: 0.4rem; line-height: 1.55; }
.rev-card strong { color: var(--ink); }
.rev-card code {
  font-family: ui-monospace, Consolas, monospace; font-size: 0.86em;
  background: var(--bg-code, #0a101d); border: 1px solid var(--line-soft); border-radius: 5px;
  padding: 0.08rem 0.35rem; color: #8fd6ff; white-space: nowrap;
}
.rev-card pre {
  background: var(--bg-code, #0a101d); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 0.9rem 1.1rem; overflow-x: auto; margin: 0.7rem 0 1rem;
}
.rev-card pre code { background: none; border: none; padding: 0; white-space: pre; color: #c9d1d9; }
.rev-key {
  border-left: 3px solid var(--accent); background: rgba(79,140,255,0.08);
  padding: 0.6rem 0.9rem; border-radius: 0 8px 8px 0;
}
.rev-table { width: 100%; border-collapse: collapse; margin: 0.7rem 0 1rem; font-size: 0.9rem; }
.rev-table th, .rev-table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line-soft); }
.rev-table th { color: var(--ink); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.rev-table td { color: var(--muted); }
.rev-tps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.9rem; }
.rev-tp { border: 1px solid var(--line-soft); border-radius: 10px; padding: 0.9rem 1rem; }
.rev-tp-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.rev-check { border-color: rgba(46,204,113,0.4); }
@media (max-width: 640px) { .rev-toc { position: static; } }

/* ============================================================
   Préparation examen (QCM)
   ============================================================ */
.exam-form { display: flex; flex-direction: column; gap: 1rem; }
.exam-q {
  border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.4rem;
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
}
.exam-q-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.exam-q-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 0.8rem; font-weight: 700; flex: 0 0 auto;
}
.exam-lvl { text-transform: capitalize; }
.exam-lvl-facile { background: rgba(46,204,113,0.16); color: #2ecc71; }
.exam-lvl-moyen { background: rgba(240,173,78,0.16); color: #e0a53b; }
.exam-lvl-difficile { background: rgba(229,72,77,0.16); color: #e5484d; }
.exam-q-text { font-size: 1.02rem; font-weight: 600; margin-bottom: 0.9rem; }
.exam-options { display: flex; flex-direction: column; gap: 0.5rem; }
.exam-opt {
  display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.6rem 0.8rem;
  border: 1px solid var(--line-soft); border-radius: 9px; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.exam-opt:hover { border-color: var(--accent); }
.exam-opt input { margin-top: 0.2rem; }
.exam-opt.is-correct { border-color: #2ecc71; background: rgba(46,204,113,0.1); }
.exam-opt.is-wrong { border-color: #e5484d; background: rgba(229,72,77,0.1); }
.exam-exp {
  margin-top: 0.8rem; padding: 0.6rem 0.9rem; border-left: 3px solid var(--accent);
  background: var(--bg-soft, rgba(127,127,127,0.05)); border-radius: 0 8px 8px 0;
  font-size: 0.86rem; color: var(--muted);
}
.exam-q.q-good { border-color: rgba(46,204,113,0.5); }
.exam-q.q-bad { border-color: rgba(229,72,77,0.4); }
.exam-actions { display: flex; gap: 0.8rem; margin: 0.4rem 0 1rem; }
.exam-score {
  position: sticky; bottom: 1rem; margin-top: 1rem; padding: 1.1rem 1.4rem; border-radius: 14px;
  text-align: center; border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,0.25);
}
.exam-score.score-ok { background: rgba(46,204,113,0.12); border-color: rgba(46,204,113,0.5); }
.exam-score.score-mid { background: rgba(240,173,78,0.12); border-color: rgba(240,173,78,0.5); }
.exam-score.score-low { background: rgba(229,72,77,0.12); border-color: rgba(229,72,77,0.5); }
.exam-score-big { font-size: 1.8rem; font-weight: 800; }
.exam-score-sub { font-size: 0.92rem; color: var(--muted); }

/* ============================================================
   Web Online (gestion GitHub Pages)
   ============================================================ */
.wo-list { display: flex; flex-direction: column; gap: 0.7rem; }
.wo-item {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem;
  padding: 0.9rem 1.1rem; border: 1px solid var(--line-soft); border-radius: 10px;
  background: var(--bg-soft, rgba(127,127,127,0.04));
}
.wo-item-info { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; min-width: 0; }
.wo-repo { font-size: 0.9rem; }
.wo-status { font-size: 0.82rem; opacity: 0.85; }
.wo-status.wo-on { color: var(--green); opacity: 1; }
.wo-status.wo-off { color: var(--muted); }
.wo-item-msg { grid-column: 1 / -1; font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.wo-item-msg.wo-err { color: var(--red); }

/* Interrupteur */
.wo-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.wo-switch input { opacity: 0; width: 0; height: 0; }
.wo-slider {
  position: absolute; inset: 0; cursor: pointer; border-radius: 999px;
  background: var(--line); transition: background 0.2s;
}
.wo-slider::before {
  content: ''; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.2s;
}
.wo-switch input:checked + .wo-slider { background: var(--green, #2ecc71); }
.wo-switch input:checked + .wo-slider::before { transform: translateX(20px); }
.wo-switch input:disabled + .wo-slider { opacity: 0.5; cursor: default; }
