/* =============================================================
   ANKEL — Documentation Theme (Dark Sidebar, Brand Colors: blue / navy / green)
   ============================================================= */

:root {
  --pf-background: #f5f7fa;
  --pf-content: #ffffff;
  --pf-text: #0f1b2d;
  --pf-primary: #004eb2;
  --pf-highlight: #61b93e;
  --pf-accent-on-dark: #7ccf58;
  --pf-primary-light: #e6edf7;
  --pf-primary-dark: #003c8a;
  --pf-secondary: #64748b;
  --pf-border: #e8edf3;
  --pf-sidebar-bg: #002350;
  --pf-sidebar-text: #ffffff;
  --pf-sidebar-hover: rgba(124, 207, 88, 0.12);
  --pf-sidebar-active: #004eb2;
  --pf-sidebar-active-contrast: #ffffff;
  --pf-header-bg: #002350;
  --pf-header-text: #ffffff;
  --pf-shadow: 0 1px 3px rgba(0,0,0,0.05);
  --pf-shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --pf-radius: 8px;
  --pf-transition: 0.18s ease;
}

/* =============================================================
   GLOBAL STYLES
   ============================================================= */
html, body {
  margin: 0;
  padding: 0;
  background: var(--pf-background);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--pf-text);
  line-height: 1.6;
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

/* =============================================================
   SIDEBAR
   ============================================================= */
.wy-nav-side {
  background: var(--pf-sidebar-bg);
  width: 300px;
  box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  border-right: none;
  transition: transform 0.3s ease;
}

.wy-side-nav-search {
  background: transparent;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.wy-side-nav-search > a {
  color: var(--pf-sidebar-text);
  font-size: 1.3em;
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.wy-side-nav-search input[type="text"] {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--pf-radius);
  color: var(--pf-sidebar-text);
  padding: 10px 12px;
  width: 100%;
  transition: var(--pf-transition);
}

.wy-side-nav-search input[type="text"]:focus {
  background: rgba(255,255,255,0.15);
  border-color: var(--pf-accent-on-dark);
  box-shadow: 0 0 0 3px rgba(124, 207, 88, 0.35);
  outline: none;
}

.wy-side-nav-search input::placeholder {
  color: rgba(255,255,255,0.6);
  opacity: 1;
}

/* Navigation menu */
.wy-menu-vertical {
  padding: 16px 0;
  overflow: visible !important;
}

.wy-menu-vertical p.caption {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.25;
  padding: 18px 16px 10px;
  margin: 0 0 6px;
  display: block !important;
  visibility: visible !important;
  position: relative;
  z-index: 2;
}

.wy-menu-vertical p.caption + ul {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.wy-menu-vertical a {
  color: var(--pf-sidebar-text);
  padding: 10px 16px;
  border-radius: 0;
  transition: var(--pf-transition);
  position: relative;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.wy-menu-vertical a:hover {
  background: var(--pf-sidebar-hover);
  color: var(--pf-accent-on-dark);
  border-left-color: var(--pf-accent-on-dark);
  text-decoration: none;
}

.wy-menu-vertical li.current,
.wy-menu-vertical li.on,
.wy-menu-vertical li.current > ul {
  background: #00306b !important;
}

.wy-menu-vertical li.current > a,
.wy-menu-vertical li.on a,
.wy-menu-vertical li.toctree-l1.current > a {
  background: #003a80 !important;
  color: #ffffff !important;
  border-left-color: var(--pf-accent-on-dark) !important;
  font-weight: 700 !important;
}

.wy-menu-vertical li.current a {
  color: #f3f4f6 !important;
}

.wy-menu-vertical li.current a:hover {
  background: rgba(124, 207, 88, 0.12) !important;
  color: var(--pf-accent-on-dark) !important;
}

.wy-menu-vertical li.current a.current,
.wy-menu-vertical li.current > a.current,
.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l3.current > a {
  background: var(--pf-sidebar-active) !important;
  color: var(--pf-sidebar-active-contrast) !important;
  border-left-color: #ffffff !important;
}

.wy-menu-vertical li {
  display: block !important;
  visibility: visible !important;
}

.wy-menu-vertical li.toctree-l1 {
  margin-bottom: 0 !important;
}

.wy-menu-vertical p.caption + ul > li.toctree-l1:first-child > a {
  margin-top: 0 !important;
}

.wy-menu-vertical li.toctree-l2 > a {
  padding-left: 32px;
  font-size: 13px;
}

.wy-menu-vertical li.toctree-l3 > a {
  padding-left: 48px;
  font-size: 13px;
}

/* =============================================================
   EXPAND/COLLAPSE ICONS – VISIBLE ON DARK BACKGROUND
   ============================================================= */
button.toctree-expand,
.wy-menu-vertical li button.toctree-expand,
.toctree-checkbox ~ .toctree-expand,
label.toctree-checkbox + button.toctree-expand {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: bold !important;
    margin-right: 6px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 10 !important;
    text-shadow: none !important;
}

button.toctree-expand:hover {
    color: var(--pf-accent-on-dark) !important;
}

/* Ensure no theme overrides hide them */
.toctree-checkbox:checked + button.toctree-expand,
.toctree-checkbox:not(:checked) + button.toctree-expand {
    display: inline-block !important;
}

/* =============================================================
   MAIN CONTENT
   ============================================================= */
.wy-nav-content-wrap {
  background: var(--pf-background);
  margin-left: 300px;
  transition: margin-left 0.3s ease;
}

.wy-nav-content {
  background: var(--pf-content);
  max-width: 900px;
  margin: 20px auto 40px;
  padding: 40px;
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
  transition: var(--pf-transition);
}

.wy-nav-content:hover {
  box-shadow: var(--pf-shadow-lg);
}

/* =============================================================
   TYPOGRAPHY
   ============================================================= */
.rst-content h1 {
  color: var(--pf-text);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--pf-border);
  position: relative;
  margin-top: 0;
  clear: both;
  overflow: visible;
}

.rst-content h1::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--pf-highlight);
}

.rst-content h2 {
  color: var(--pf-text);
  font-size: 24px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 16px;
  position: relative;
  clear: both;
  margin-left: 0;
}

.rst-content h2::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--pf-highlight);
  border-radius: 2px;
}

.rst-content h3 {
  color: var(--pf-text);
  font-size: 20px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}

.rst-content p {
  text-align: justify;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--pf-text);
  text-justify: inter-word;
  hyphens: auto;
}

.rst-content a {
  color: var(--pf-primary-dark);
  text-decoration: none;
  transition: var(--pf-transition);
}

.rst-content a:hover {
  color: var(--pf-primary);
  text-decoration: underline;
}

/* =============================================================
   BOTTOM NAVIGATION BUTTONS (Previous / Next)
   Compatible Sphinx / RTD
   ============================================================= */

/* Container principal */
.rst-footer-buttons{
  display: flex !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: flex-start !important; /* on gère l'espacement avec margin auto */
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--pf-border);
  text-align: left !important; /* évite héritage centré */
}

/* Si un wrapper interne existe (RTD fréquent) */
.rst-footer-buttons .rst-breadcrumbs-buttons{
  display: flex !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

/* Style des boutons */
.rst-footer-buttons .btn-neutral{
  background: #ffffff !important;
  color: var(--pf-text) !important;
  border: 1px solid var(--pf-border) !important;
  padding: 10px 22px !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05) !important;
  transition: var(--pf-transition);
}

/* Hover */
.rst-footer-buttons .btn-neutral:hover{
  background: var(--pf-primary) !important;
  color: #ffffff !important;
  border-color: var(--pf-primary) !important;
}

/* Icônes */
.rst-footer-buttons .btn-neutral .icon{
  color: inherit !important;
}

/* =============================================================
   POSITIONING ROBUSTE
   ============================================================= */

/* Previous (gauche) */
.rst-footer-buttons a[rel="prev"]{
  margin-right: auto !important;
}

/* Next (droite) */
.rst-footer-buttons a[rel="next"]{
  margin-left: auto !important;
}

/* Sécurise les enfants directs */
.rst-footer-buttons > *{
  flex: 0 0 auto !important;
}

/* Évite tout centrage hérité du thème */
.wy-nav-content .rst-footer-buttons,
.wy-nav-content .rst-footer-buttons .rst-breadcrumbs-buttons{
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* =============================================================
   FOOTER
   ============================================================= */
footer {
  text-align: center;
  padding: 24px;
  color: var(--pf-secondary);
  font-size: 14px;
  border-top: none !important;
  margin-top: 40px;
  background: var(--pf-content);
  border-radius: var(--pf-radius);
  margin: 40px 20px;
  box-shadow: var(--pf-shadow);
}

footer hr {
  display: none !important;
}

footer p {
  margin: 0 !important;
  padding: 0 !important;
  color: var(--pf-secondary) !important;
}

.rst-footer-buttons {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 24px !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

.rst-footer-buttons .btn-neutral {
  background: #ffffff !important;
  color: var(--pf-text) !important;
  border: 1px solid var(--pf-border) !important;
  padding: 10px 22px !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05) !important;
  transition: var(--pf-transition) !important;
}

.rst-footer-buttons .btn-neutral:hover {
  background: var(--pf-primary) !important;
  color: #ffffff !important;
  border-color: var(--pf-primary) !important;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media screen and (max-width: 768px) {
  .wy-nav-side {
    transform: translateX(-100%);
  }

  .wy-nav-side.shift {
    transform: translateX(0);
  }

  .wy-nav-content-wrap {
    margin-left: 0;
  }

  .wy-nav-content {
    padding: 20px;
    margin: 10px;
  }

  .rst-footer-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .rst-footer-buttons .btn-neutral {
    width: 100%;
    justify-content: center;
  }
}

/* =============================================================
   SCROLLBAR
   ============================================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--pf-background);
}

::-webkit-scrollbar-thumb {
  background: var(--pf-secondary);
  border-radius: 4px;
  transition: var(--pf-transition);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--pf-primary);
}

/* =============================================================
   PRINT
   ============================================================= */
@media print {
  .wy-nav-side,
  .rst-footer-buttons,
  footer {
    display: none;
  }

  .wy-nav-content-wrap {
    margin-left: 0;
  }

  .wy-nav-content {
    box-shadow: none;
    margin: 0;
    padding: 20px;
  }
}

/* =============================================================
   TOP NAVIGATION BAR (STICKY)
   ============================================================= */
.wy-nav-top {
  display: none !important;
  background: #002350 !important;
  color: #ffffff !important;
  padding: 0.4045em 0.809em !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  line-height: 50px !important;
  text-align: center !important;
  font-size: 100% !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
  margin-bottom: 20px !important;
}

.wy-nav-top i {
  color: #ffffff !important;
  margin-right: 10px !important;
}

.wy-nav-top a {
  color: #ffffff !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  font-size: 18px !important;
  letter-spacing: 0.5px !important;
}

.wy-nav-top a:hover {
  opacity: 0.9 !important;
}
/* Show top nav on mobile */

@media screen and (max-width: 768px) {
  .wy-nav-top {
    display: block !important;
  }
}

/* =============================================================
   MAIN CONTENT AREA
   ============================================================= */
.wy-nav-content {
  padding: 40px !important;
  margin-top: 20px !important;
}

.rst-content h1 {
  color: var(--pf-text);
  font-size: 32px;
  font-weight: 700;
  margin-top: 0 !important;
  margin-bottom: 24px;
  padding-top: 20px !important;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--pf-border);
  position: relative;
  clear: both;
}

.rst-content h1::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--pf-highlight);
}

.rst-content h2 {
  color: var(--pf-text);
  font-size: 24px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 16px;
  position: relative;
  clear: both;
}

.rst-content h2::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--pf-highlight);
  border-radius: 2px;
}

.rst-content h3 {
  color: var(--pf-text);
  font-size: 20px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}

.rst-content p {
  text-align: justify;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--pf-text);
  text-justify: inter-word;
  hyphens: auto;
}

.rst-content a {
  color: var(--pf-primary-dark);
  text-decoration: none;
  transition: var(--pf-transition);
}

.rst-content a:hover {
  color: var(--pf-primary);
  text-decoration: underline;
}


/* =============================================================
   ANKEL ADDITIONS — logo, admonitions, tables, code, images
   ============================================================= */

/* Sidebar logo (html_logo) */
.wy-side-nav-search > a img.logo {
  width: 100%;
  max-width: 210px;
  height: auto;
  margin: 0 auto 14px;
  padding: 0;
  display: block;
}

/* Landing-page logo */
.rst-content .ankel-logo img {
  max-width: 340px;
  margin: 0 0 8px;
}

/* Screenshots */
.rst-content img {
  max-width: 100%;
  height: auto;
}
.rst-content .figure img,
.rst-content img.screenshot {
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
}

/* Admonitions in brand teal */
.rst-content .admonition,
.rst-content .note,
.rst-content .tip,
.rst-content .important,
.rst-content .warning,
.rst-content .attention,
.rst-content .caution {
  border-radius: var(--pf-radius);
  border: 1px solid var(--pf-border);
  border-left-width: 4px;
  box-shadow: none;
}
.rst-content .note, .rst-content .tip, .rst-content .important, .rst-content .admonition {
  background: var(--pf-primary-light);
  border-left-color: var(--pf-primary);
}
.rst-content .note .admonition-title,
.rst-content .tip .admonition-title,
.rst-content .important .admonition-title,
.rst-content .admonition-title {
  background: var(--pf-primary);
  color: #ffffff;
}
.rst-content .warning, .rst-content .attention, .rst-content .caution {
  background: #fdf3e7;
  border-left-color: #b9770e;
}
.rst-content .warning .admonition-title,
.rst-content .attention .admonition-title,
.rst-content .caution .admonition-title {
  background: #b9770e;
  color: #ffffff;
}

/* Tables */
.rst-content table.docutils {
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  overflow: hidden;
  width: 100%;
}
.rst-content table.docutils thead th {
  background: var(--pf-primary);
  color: #ffffff;
  border-color: var(--pf-primary);
  font-weight: 600;
}
.rst-content table.docutils td {
  border-color: var(--pf-border);
}
.wy-table-odd td, .wy-table-striped tr:nth-child(2n-1) td,
.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td {
  background: #f6f8fc;
}
.wy-table-responsive table td, .wy-table-responsive table th {
  white-space: normal;
}

/* Inline code & code blocks */
.rst-content code, .rst-content tt, code {
  background: var(--pf-primary-light);
  border: 1px solid #c4d5ee;
  color: var(--pf-primary-dark);
  border-radius: 4px;
}
.rst-content div[class^='highlight'] {
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
}

/* Status chips: ``.. role:: ok`` etc. are not required — plain bold works too */
.rst-content strong { color: var(--pf-text); }

/* Lists a little airier */
.rst-content ul li, .rst-content ol li { margin-bottom: 4px; }

/* Left-align text inside tables and lists (justify looks poor there) */
.rst-content td p, .rst-content li p { text-align: left; }

/* =============================================================
   LANGUAGE TOGGLE (FR | EN pill, top right)
   ============================================================= */
.lang-switch {
  position: fixed;
  top: 14px;
  right: 28px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 10px;
  background: #ffffff;
  border: 1px solid var(--pf-border);
  border-radius: 999px;
  box-shadow: var(--pf-shadow);
  color: var(--pf-primary);
}
.lang-switch svg { margin-right: 4px; }
.lang-switch a {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--pf-secondary);
  text-decoration: none;
  transition: var(--pf-transition);
}
.lang-switch a:hover { color: var(--pf-primary); text-decoration: none; }
.lang-switch a.active { background: var(--pf-primary); color: #ffffff; }
@media screen and (max-width: 768px) {
  .lang-switch { top: 10px; right: 12px; }
}
@media print { .lang-switch { display: none; } }

/* =============================================================
   MOBILE NAVIGATION (open / close the sidebar)
   ============================================================= */
.sb-close, .sb-backdrop { display: none; }

@media screen and (max-width: 768px) {
  .wy-nav-side {
    left: 0 !important;
    width: 86vw;
    max-width: 320px;
    z-index: 1200;
    transform: translateX(-102%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .wy-nav-side.shift {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 16, 40, 0.45);
  }
  /* Do not push the page to the right when the menu opens */
  .wy-nav-content-wrap,
  .wy-nav-content-wrap.shift { left: 0 !important; margin-left: 0 !important; }

  .sb-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1150;
    background: rgba(0, 16, 40, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sb-backdrop.show { opacity: 1; pointer-events: auto; }
  body.sb-open { overflow: hidden; }

  .sb-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
  }
  .sb-close:hover, .sb-close:focus-visible { background: var(--pf-highlight); border-color: var(--pf-highlight); outline: none; }

  /* Larger touch targets */
  .wy-menu-vertical a { padding-top: 13px; padding-bottom: 13px; }
  .wy-nav-top { min-height: 56px; }
  .wy-nav-top i { padding: 10px; font-size: 22px !important; }
}


/* Mobile top bar: show the Ankel logo instead of the text title */
@media screen and (max-width: 768px) {
  .wy-nav-top a {
    display: inline-block;
    width: 120px;
    height: 40px;
    font-size: 0 !important;
    line-height: 0 !important;
    vertical-align: middle;
    background: url('ankel_logo_light.svg') center / contain no-repeat;
  }
}

@media screen and (max-width: 768px) {
  .wy-nav-top { text-align: left !important; }
  .wy-nav-top a { margin-left: 10px; width: 112px; }
}


/* =============================================================
   TOP-BAR SEARCH
   ============================================================= */
.top-search {
  position: fixed;
  top: 14px;
  right: 168px;
  z-index: 1100;
  display: flex;
  align-items: center;
  height: 34px;
  background: #ffffff;
  border: 1px solid var(--pf-border);
  border-radius: 999px;
  box-shadow: var(--pf-shadow);
  color: var(--pf-primary);
  margin: 0;
}
.top-search .ts-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 32px; padding: 0; border: 0; background: transparent;
  color: var(--pf-primary); cursor: pointer; border-radius: 999px;
}
.top-search input[type="search"] {
  width: 190px; height: 30px; padding: 0 14px 0 0; margin: 0;
  border: 0 !important; outline: none; box-shadow: none !important;
  background: transparent; font-size: 13px; color: var(--pf-text);
  transition: width 0.2s ease;
}
.top-search:focus-within { border-color: var(--pf-primary); box-shadow: 0 0 0 3px rgba(0, 78, 178, 0.15); }
.top-search input[type="search"]:focus { width: 250px; }
@media print { .top-search { display: none; } }

@media screen and (max-width: 768px) {
  /* icon only; the field opens over the top bar */
  .top-search { top: 10px; right: 140px; height: 40px; width: 40px; border-radius: 50%; }
  .top-search .ts-toggle { width: 40px; height: 38px; }
  .top-search input[type="search"] { display: none; }
  .top-search.open {
    left: 56px; right: 12px; width: auto; height: 40px; border-radius: 999px; z-index: 1300;
  }
  .top-search.open input[type="search"] { display: block; flex: 1; width: 100%; font-size: 16px; }
  .top-search.open input[type="search"]:focus { width: 100%; }
  body.ts-open .lang-switch { visibility: hidden; }
}

@media screen and (max-width: 768px) {
  body.ts-open .wy-nav-top a { visibility: hidden; }
}

/* =============================================================
   "ON THIS PAGE" TABLE OF CONTENTS (right side)
   ============================================================= */
.page-toc { display: none; }

@media screen and (min-width: 1240px) {
  body.has-toc .wy-nav-content-wrap { padding-right: 280px; }
  body.has-toc .wy-nav-content { max-width: 880px; }
  .page-toc {
    display: block;
    position: fixed;
    top: 72px;
    right: 24px;
    width: 240px;
    max-height: calc(100vh - 96px);
    z-index: 50;
    font-size: 13px;
    border-left: 1px solid var(--pf-border);
    padding-left: 4px;
  }
  .page-toc-title {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 12px 10px;
    font-weight: 700; font-size: 14px; color: var(--pf-text);
  }
  .page-toc ul {
    list-style: none; margin: 0; padding: 0;
    max-height: calc(100vh - 140px); overflow-y: auto;
    scrollbar-width: thin;
  }
  .page-toc li { margin: 0; }
  .page-toc li a {
    display: block;
    padding: 6px 12px 6px 14px;
    margin-left: -5px;
    border-left: 3px solid transparent;
    color: var(--pf-secondary);
    line-height: 1.4;
    text-decoration: none;
  }
  .page-toc li.lvl-2 a { padding-left: 28px; }
  .page-toc li.lvl-3 a { padding-left: 42px; font-size: 12.5px; }
  .page-toc li a:hover { color: var(--pf-primary); text-decoration: none; }
  .page-toc li.active > a {
    color: var(--pf-primary);
    font-weight: 700;
    border-left-color: var(--pf-primary);
  }
}
@media print { .page-toc { display: none !important; } }

/* =============================================================
   BACK-TO-TOP BUTTON (appears when scrolling up)
   ============================================================= */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: calc(50% + 150px);
  transform: translate(-50%, 16px);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: #3d8f27;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 35, 80, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.back-to-top:hover, .back-to-top:focus-visible { background: #2f7a1d; outline: none; }
@media screen and (max-width: 768px) {
  .back-to-top { left: 50%; bottom: 18px; }
}
@media print { .back-to-top { display: none; } }
