/* ============================================
   FONT CONFIGURATION
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Familjen+Grotesk:ital,wght@0,400..700;1,400..700&display=swap');

html, body, .bd-main, .bd-content, .bd-article, .bd-sidebar, div.body, p, li, td, th, span, a {
    font-family: 'Familjen Grotesk', sans-serif !important;
}

.bd-content h1, .bd-content h2, .bd-content h3, .bd-content h4, .bd-content h5, .bd-content h6, 
.bd-sidebar h1, .bd-sidebar h2, .bd-sidebar h3, .bd-sidebar h4, .bd-sidebar h5, .bd-sidebar h6, 
h1, h2, h3, h4, h5, h6 {
    font-family: 'Familjen Grotesk', sans-serif !important;
    font-weight: 700 !important;
}

.bd-sidebar-primary, .bd-sidebar-secondary, .toctree-l1, .toctree-l2, .toctree-l3, .navbar, .navbar-nav {
    font-family: 'Familjen Grotesk', sans-serif !important;
}

p code, li code {
    font-family: 'Familjen Grotesk', monospace !important;
}

input, button, select, textarea {
    font-family: 'Familjen Grotesk', sans-serif !important;
}

table, table th, table td {
    font-family: 'Familjen Grotesk', sans-serif !important;
}

/* ============================================
   TABLE HOVER EFFECTS
   ============================================ */

table tbody tr, table.docutils tbody tr, .docutils tbody tr, .bd-content table tbody tr {
    transition: background-color 0.2s ease-in-out;
    cursor: pointer;
}

table tbody tr:hover, table.docutils tbody tr:hover, .docutils tbody tr:hover, 
.bd-content table tbody tr:hover, table.list-table tbody tr:hover {
    background-color: #cfe2ff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

tbody tr:hover {
    background-color: #cfe2ff !important;
}

tbody tr:hover td, tbody tr:hover th {
    color: #212529 !important;
}

table thead tr:hover, thead tr:hover {
    background-color: inherit !important;
    cursor: default !important;
    box-shadow: none !important;
}

/* ============================================
   INLINE ICON & TABLE ALIGNMENT FIX
   ============================================ */

.bd-content table img.inline-icon {
    height: 39px;
    width: auto;
    max-height: none;
}

.bd-content table td {
    line-height: 1.6;
}

/* MODIFICA QUI: 
   Ho cambiato vertical-align da 'middle' a 'top'.
   In questo modo il testo nella prima colonna è centrato orizzontalmente ma in alto.
*/
.bd-content table td:first-child {
    text-align: center;
    vertical-align: top !important; 
    padding-top: 15px; /* Opzionale: aggiunge un po' di respiro dal bordo superiore */
}

/* Dimensioni variabili icone */
.bd-content table img.inline-icon.icon-small { height: 30px; }
.bd-content table img.inline-icon.icon-medium { height: 50px; }
.bd-content table img.inline-icon.icon-large { height: 60px; }
.bd-content table img.inline-icon.icon-xl { height: 80px; }

/* Classe specifica per forzare l'allineamento in alto su TUTTE le celle di una tabella */
.align-top table td, 
.align-top table th,
.bd-content table.align-top td {
    vertical-align: top !important;
}

/* ============================================
   CUSTOM TABLES
   ============================================ */

table.tabacc td,
table.tabacc th {
  text-align: center;
  vertical-align: middle;
  height: 80px;
}

table.tabacc td p,
table.tabacc th p {
  margin-top: 0;
  margin-bottom: 0;
}

table.pneum td {
    padding-top: 20 !important;
    padding-bottom: 20 !important;
    vertical-align: middle !important;
    text-align: center;
}

/* ============================================
CUSTOM TEXT
============================================ */

   .centered {
  text-align: center;
}

.centered-params {
  text-align: center;
  font-family: var(--pst-font-family-base);
  font-size: var(--pst-font-size-base);
  color: var(--pst-color-text-base);
}

/* ============================================
CUSTOM CARD
============================================ */

.pneum-card {
    border-radius: 20px;
    border: 1px solid #d0e0f0;
    border-left: 4px solid #322DDC;
    overflow: hidden;
    transition: transform 0.15s, border-color 0.15s, background-color 0.15s;
}

.pneum-card:hover {
    border: 1px solid #322DDC;
    border-left: 4px solid #322DDC;
    background-color: #cfe2ff;
    transform: translateY(-2px);
    overflow: hidden;
}

.pneum-card-header {
    background-color: #f0f7fb;
    font-weight: 600;
}

.pneum-card:hover .pneum-card-header {
    background-color: #b8d4f5;
}

/* ============================================
   OPTIONAL: DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    table.docutils tbody tr:hover { background-color: #1e3a5f !important; }
    table.docutils tbody tr:nth-child(even):hover { background-color: #1e3a5f !important; }
    table.docutils tbody tr:nth-child(odd):hover { background-color: #1a2f4a !important; }
}

/* ============================================
   GESTIONE LOGO ARS
   Solo per immagini con classe img-logo (piccole, per il logo)
   ============================================ */

.only-light.img-logo, .only-dark.img-logo {
    width: 200px !important;
    height: auto !important;
    display: inline-block !important;
    margin-bottom: 10px;
}

/* Immagini grandi con only-light/only-dark (es. screenshot pagine) */
.only-light:not(.img-logo), .only-dark:not(.img-logo) {
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

html[data-theme="light"] .only-dark { display: none !important; }
html[data-theme="dark"] .only-light { display: none !important; }

.bd-content .only-light.img-logo, .bd-content .only-dark.img-logo {
    width: 250px !important;
}

/* ============================================
   VERSION / LANGUAGE SWITCHER
   ============================================ */

.fixed-bar {
    position: fixed;
    right: 10px;
    bottom: 10px;
    z-index: 9999;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid rgba(100, 100, 100, 0.28);
    border-radius: 8px;
    background: rgba(245, 245, 245, 0.92);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px) saturate(180%);
    font-size: 0.9rem;
}

.fixed-bar .dropdown {
    position: relative;
    user-select: none;
}

.fixed-bar .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(100, 100, 100, 0.28);
    border-radius: 5px;
    background: rgba(200, 200, 200, 0.35);
    color: #222;
    white-space: nowrap;
    cursor: pointer;
}

.fixed-bar .dropdown-toggle:hover {
    border-color: rgba(26, 62, 114, 0.45);
    background: rgba(100, 150, 220, 0.18);
    color: #1a3e72;
}

.fixed-bar .dropdown-toggle::after {
    display: none !important;
    content: none !important;
}

.fixed-bar .dropdown-menu {
    position: absolute;
    left: 0;
    bottom: 100%;
    display: none;
    min-width: 160px;
    max-height: 220px;
    overflow-y: auto;
    flex-direction: column;
    border: 1px solid rgba(150, 150, 150, 0.3);
    border-radius: 6px;
    background: rgba(250, 250, 250, 0.98);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.fixed-bar .dropdown-menu.show {
    display: flex;
}

.fixed-bar .dropdown-menu a {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(200, 200, 200, 0.45);
    color: #1a3e72;
    text-decoration: none;
    white-space: nowrap;
}

.fixed-bar .dropdown-menu a:last-child {
    border-bottom: none;
}

.fixed-bar .dropdown-menu a:hover {
    background: rgba(100, 150, 220, 0.15);
}

@media print {
    .fixed-bar {
        display: none !important;
    }
}

/* Stile base condiviso da tutte le lingue */
[class*="plugin-card-"] {
  cursor: help;
  position: relative;
  /* sphinx-design imposta overflow:hidden sulle card: senza questo il tooltip,
     che sta fuori dal bordo superiore della card, viene tagliato */
  overflow: visible !important;
}
 
[class*="plugin-card-"]:hover::after {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  width: max-content;
  max-width: min(420px, 90vw);
  white-space: normal;
  text-align: center;
  pointer-events: none;
  z-index: 10;
  margin-bottom: 6px;
}
 
/* Italiano */
.plugin-card-it:hover::after {
  content: "Richiedi il Plug-in direttamente inviandoci un'email a service@arsautomation.com";
}
 
/* English */
.plugin-card-en:hover::after {
  content: "Request the Plug-in directly by sending us an email at service@arsautomation.com";
}
 
/* Deutsch */
.plugin-card-de:hover::after {
  content: "Fordern Sie das Plug-in direkt an, indem Sie uns eine E-Mail an service@arsautomation.com senden";
}
 
/* Español */
.plugin-card-es:hover::after {
  content: "Solicite el Plug-in directamente enviándonos un correo a service@arsautomation.com";
}
 
/* Français */
.plugin-card-fr:hover::after {
  content: "Demandez le Plug-in directement en nous envoyant un e-mail à service@arsautomation.com";
}

/* ── REGOLA GENERALE DI BASE ── */
.isw-page {
  --c-primary:    #1a3a52;
  --c-accent:     #2980b9;
  --c-accent-lt:  #d0e4f0;
  --c-bg:         #ffffff;
  --c-bg-alt:     #f7fbfe;
  --c-bg-hover:   #e8f4fc;
  --c-border:     #d0e4f0;
  --c-text:       #334e5e;
  --c-muted:      #7a9ab0;
  --radius:       10px;
  --shadow-sm:    0 1px 4px rgba(41,128,185,.08);
  --shadow-md:    0 3px 10px rgba(41,128,185,.12);
  max-width: 860px;
  margin: 0 auto;
  padding: 0 0 3rem;
  
  /* Ingrandiamo il testo base di tutta la pagina */
  font-size: 16px; 
  line-height: 1.6;
}

/* ── Headings ── */
.isw-page h2 {
  color: var(--c-primary);
  font-weight: 700;
  border-bottom: 2px solid var(--c-accent-lt);
  padding-bottom: .4rem;
  margin-top: 2.5rem;
  font-size: 1.8rem; /* Titoli principali più visibili */
}
.isw-page h3 {
  color: var(--c-primary);
  font-weight: 600;
  margin-top: 1.6rem;
  font-size: 1.4rem;
}

/* ── Ingrandimento di tutte le scritte normali e paragrafi ── */
.isw-page p, 
.isw-meta-content, 
.isw-profile-body, 
.isw-symbol-desc, 
.isw-risk-desc, 
.isw-zone-desc, 
.isw-safety-card p,
.isw-ce-box p,
.isw-table td {
  font-size: 17px !important;
  line-height: 1.6 !important;
  color: var(--c-text);
}

/* ── Ingrandimento dei TITOLI di tutte le card/tabelle ── */
.isw-meta-title,
.isw-profile-role,
.isw-trained-person-title,
.isw-symbol-label,
.isw-risk-title,
.isw-zone-label,
.isw-warranty-col-header,
.isw-safety-card-title,
.isw-table thead th {
  font-size: 19px !important;
  font-weight: 700 !important;
  letter-spacing: normal !important;
  text-transform: none !important; /* Rimuove il tutto maiuscolo forzato che rimpiccioliva il testo */
}

/* Specifico per i micro-titoli in alto (es. Identificazione) se li vuoi comunque maiuscoli ma leggibili */
.isw-meta-title, .isw-trained-person-title, .isw-warranty-col-header {
  text-transform: uppercase !important;
  font-size: 15px !important;
  letter-spacing: .05em !important;
}

/* ── Liste e Note interne ── */
.isw-page li {
  font-size: 16px !important;
  line-height: 1.5 !important;
  margin-bottom: .4rem;
}
.isw-profile-note {
  font-size: 15px !important;
  margin-top: .8rem;
  padding: .6rem .9rem;
}
.isw-meta-content small {
  font-size: 14px !important;
  margin-top: .6rem;
}

/* ── Icone e Badge ── */
.isw-page i.ph, .isw-safety-card-title i {
  font-size: 1.35rem !important; /* Icone proporzionate al testo */
}
.isw-badge {
  font-size: 14px !important;
  padding: .2rem .6rem;
}

/* ── Tabelle ── */
.isw-table thead th {
  font-size: 15px !important;
  text-transform: uppercase !important;
}
.isw-table td:first-child {
  font-size: 16px !important;
  width: 90px;
}

/* ── Strutture di Layout (Incolonnate e spaziate) ── */
.isw-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; margin: 1rem 0 2rem; }
.isw-meta-card { padding: 1.4rem; border: 1.5px solid var(--c-border); border-radius: var(--radius); background: var(--c-bg); box-shadow: var(--shadow-sm); }

.isw-profiles { margin: 1.5rem 0; display: flex; flex-direction: column; gap: 1.2rem; }
.isw-profile-header { display: flex; align-items: center; gap: .8rem; background: var(--c-bg-alt); padding: .8rem 1.2rem; border-bottom: 1px solid var(--c-border); }
.isw-profile-body { padding: 1.2rem; }

.isw-symbol-grid { display: flex; flex-direction: column; gap: 1.2rem; margin: 1.5rem 0; }
.isw-symbol-item { display: flex; align-items: center; gap: 1.2rem; padding: 1.2rem; border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-bg); }
.isw-symbol-item img { width: 55px; height: 55px; object-fit: contain; flex-shrink: 0; }

.isw-safety-cards { display: flex; flex-direction: column; gap: 1.2rem; margin: 1.5rem 0; }
.isw-safety-card { border: 1.5px solid var(--c-border); border-radius: var(--radius); padding: 1.2rem; background: var(--c-bg); }

.isw-zones { display: flex; flex-direction: column; gap: 1.2rem; margin: 1.5rem 0; }
.isw-zone { display: grid; grid-template-columns: 200px 1fr; border: 1.5px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.isw-zone-desc { padding: 1rem 1.2rem; }

/* ── Responsive per schermi piccoli ── */
@media (max-width: 640px) {
  .isw-warranty-grid { grid-template-columns: 1fr; }
  .isw-risk { grid-template-columns: 1fr; }
  .isw-risk-icons { flex-direction: row; border-right: none; border-bottom: 1px solid var(--c-border); }
  .isw-zone { grid-template-columns: 1fr; }
}

/* ── PER LA PAGINA MANUTENZIONE  ── */

/* Contenitore principale */
.isw-page .isw-timeline-container {
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  padding-left: 45px !important; /* Aumentato per dare più spazio alla linea e alle frecce */
  margin: 2rem 0 !important;
}

/* Singolo blocco della timeline */
.isw-page .isw-timeline-item {
  position: relative !important;
  padding-bottom: 2.5rem !important;
}

.isw-page .isw-timeline-item:last-child {
  padding-bottom: 0 !important;
}

/* La card con sfondo e bordo azzurro */
.isw-page .isw-timeline-card {
  padding: 1.4rem !important;
  border: 2px solid var(--c-accent) !important; /* Usa il tuo azzurro */
  border-radius: var(--radius) !important;       /* Angoli da 10px */
  background: var(--c-bg-alt) !important;        /* Sfondo alternativo chiaro */
  box-shadow: var(--shadow-sm) !important;
}

/* Forza il colore azzurro sul titolo della card */
.isw-page .isw-timeline-card .isw-symbol-label {
  color: var(--c-accent) !important;
  margin-bottom: 0.5rem !important;
  display: block !important;
}

/* ── LINEA VERTICALE E FRECCE ── */

/* Genera la linea tratteggiata verticale */
.isw-page .isw-timeline-item::before {
  content: '' !important;
  position: absolute !important;
  left: -24px !important;
  top: 25px !important;
  bottom: -20px !important;
  width: 2px !important;
  border-left: 2px dashed var(--c-accent) !important;
  z-index: 1 !important;
}

.isw-page .isw-timeline-item:last-child::before {
  display: none !important;
}

/* Genera la freccia minimale a punta di V */
.isw-page .isw-timeline-arrow {
  position: absolute !important;
  left: -28px !important;
  bottom: 10px !important;
  width: 8px !important;
  height: 8px !important;
  border-right: 2px solid var(--c-accent) !important;
  border-bottom: 2px solid var(--c-accent) !important;
  transform: rotate(45deg) !important;
  z-index: 2 !important;
  background: var(--c-bg) !important;
}
/* ==========================================================================
   FlexiBowl manual – Dark mode fix (pydata-sphinx-theme: html[data-theme="dark"])
   Pagine: Wizard, Interfaccia Software, Interfaccia Elettrica,
           Cablaggio FlexiBowl, Controller e Cablaggio Bulk Feeder
   Un solo file, valido per tutte le lingue. Nessun testo da modificare.
   ========================================================================== */
 
html[data-theme="dark"] {
  --dm-bg:      #1e2530;   /* pannelli / card           */
  --dm-bg-alt:  #252d3a;   /* righe alternate           */
  --dm-bg-head: #1a3a52;   /* intestazioni tabella      */
  --dm-bg-hov:  #2c3a4d;   /* hover                     */
  --dm-bd:      #3b4a5e;   /* bordi                     */
  --dm-tx:      #e3eaf2;   /* testo principale          */
  --dm-tx-dim:  #a9b9ca;   /* testo secondario          */
  --dm-acc:     #5aaee8;   /* azzurro accento (leggibile su scuro) */
 
  /* variabili usate dalla pagina "Interfaccia Elettrica" */
  --acc:#5aaee8; --acc-dk:#9fd0f5; --acc-bg:#1d3a57;
  --bd:#3b4a5e; --bg-p:#1e2530; --bg-s:#252d3a; --bg-h:#2c3a4d;
  --tx1:#e3eaf2; --tx2:#b9c6d4; --tx3:#8fa0b3;
}
 
/* ---------- 1. Elementi con colori scritti inline (style="...") ----------- */
/* Sfondi chiari -> scuri */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background:#f7fbfe"],
html[data-theme="dark"] [style*="background: #f7fbfe"],
html[data-theme="dark"] [style*="background-color: #f8f9fa"],
html[data-theme="dark"] [style*="background-color:#f8f9fa"] {
  background-color: var(--dm-bg) !important;
  border-color: var(--dm-bd) !important;
}
/* Testi scuri -> chiari (solo dove il colore è inline) */
html[data-theme="dark"] [style*="color:#1a3a52"],
html[data-theme="dark"] [style*="color: #1a3a52"],
html[data-theme="dark"] [style*="color:#334e5e"],
html[data-theme="dark"] [style*="color: #334e5e"],
html[data-theme="dark"] [style*="color: #2c3e50"],
html[data-theme="dark"] [style*="color:#2c3e50"],
html[data-theme="dark"] [style*="color: #34495e"],
html[data-theme="dark"] [style*="color:#34495e"] {
  color: var(--dm-tx) !important;
}
html[data-theme="dark"] [style*="color:#7a9ab0"],
html[data-theme="dark"] [style*="color: #7a9ab0"] {
  color: var(--dm-tx-dim) !important;
}
html[data-theme="dark"] [style*="color:#2980b9"],
html[data-theme="dark"] [style*="color: #2980b9"] {
  color: var(--dm-acc) !important;
}
html[data-theme="dark"] [style*="border"][style*="#d0e4f0"],
html[data-theme="dark"] [style*="border"][style*="#e9f2f9"],
html[data-theme="dark"] [style*="border"][style*="#e9ecef"] {
  border-color: var(--dm-bd) !important;
}
 
/* ---------- 2. Card di navigazione / flow / formule (Interfaccia Software) - */
html[data-theme="dark"] .isw-nav-card,
html[data-theme="dark"] .isw-formula,
html[data-theme="dark"] .isw-example,
html[data-theme="dark"] .isw-example-body,
html[data-theme="dark"] .isw-table-wrap,
html[data-theme="dark"] .isw-err-wrap,
html[data-theme="dark"] .isw-search {
  background: var(--dm-bg) !important;
  border-color: var(--dm-bd) !important;
  color: var(--dm-tx) !important;
}
html[data-theme="dark"] .isw-nav-card:hover { background: var(--dm-bg-hov) !important; border-color: var(--dm-acc) !important; }
html[data-theme="dark"] .isw-nav-card-title,
html[data-theme="dark"] .isw-flow-label,
html[data-theme="dark"] .isw-formula-main,
html[data-theme="dark"] .isw-example-title,
html[data-theme="dark"] .isw-example-col-title { color: var(--dm-tx) !important; }
html[data-theme="dark"] .isw-nav-card-sub,
html[data-theme="dark"] .isw-flow-sub,
html[data-theme="dark"] .isw-formula-example,
html[data-theme="dark"] .isw-search-count { color: var(--dm-tx-dim) !important; }
html[data-theme="dark"] .isw-flow-arrow { color: var(--dm-acc) !important; }
 
/* tabelle */
html[data-theme="dark"] .isw-table thead tr, html[data-theme="dark"] .isw-table thead th,
html[data-theme="dark"] .isw-err-table thead tr, html[data-theme="dark"] .isw-err-table thead th,
html[data-theme="dark"] .isw-return-table thead tr, html[data-theme="dark"] .isw-return-table thead th,
html[data-theme="dark"] .isw-ret table thead tr, html[data-theme="dark"] .isw-ret table thead th,
html[data-theme="dark"] .isw-example-body table th {
  background: var(--dm-bg-head) !important;
  color: var(--dm-tx) !important;
  border-color: var(--dm-bd) !important;
}
html[data-theme="dark"] .isw-table tbody tr,
html[data-theme="dark"] .isw-err-table tbody tr,
html[data-theme="dark"] .isw-return-table tbody tr { background: var(--dm-bg) !important; }
html[data-theme="dark"] .isw-table tbody tr:nth-child(even),
html[data-theme="dark"] .isw-err-table tbody tr:nth-child(even),
html[data-theme="dark"] .isw-return-table tbody tr:nth-child(even) { background: var(--dm-bg-alt) !important; }
html[data-theme="dark"] .isw-table tbody tr:hover,
html[data-theme="dark"] .isw-err-table tbody tr:hover,
html[data-theme="dark"] .isw-return-table tbody tr:hover { background: var(--dm-bg-hov) !important; }
html[data-theme="dark"] .isw-table tbody td,
html[data-theme="dark"] .isw-err-table tbody td,
html[data-theme="dark"] .isw-return-table tbody td,
html[data-theme="dark"] .isw-example-body table td {
  color: var(--dm-tx) !important;
  border-color: var(--dm-bd) !important;
}
html[data-theme="dark"] .isw-table tbody td:first-child,
html[data-theme="dark"] .isw-err-table tbody td:first-child,
html[data-theme="dark"] .isw-return-table tbody td:first-child { color: var(--dm-acc) !important; }
html[data-theme="dark"] .isw-table code,
html[data-theme="dark"] .isw-err-table code,
html[data-theme="dark"] .isw-return-table code {
  background: #0f1620 !important; color: #e8c07d !important; border-color: var(--dm-bd) !important;
}
/* badge di sezione (EXE / WRITE / READ ...) */
html[data-theme="dark"] .isw-badge-exe   { background:#1e3a8a; color:#dbeafe; }
html[data-theme="dark"] .isw-badge-write { background:#78350f; color:#fef3c7; }
html[data-theme="dark"] .isw-badge-read  { background:#065f46; color:#d1fae5; }
html[data-theme="dark"] .isw-badge-io    { background:#4c1d95; color:#ede9fe; }
html[data-theme="dark"] .isw-badge-tcp   { background:#831843; color:#fce7f3; }
html[data-theme="dark"] .isw-badge-err   { background:#7f1d1d; color:#fee2e2; }
html[data-theme="dark"] .isw-badge-field { background:#14532d; color:#dcfce7; }
html[data-theme="dark"] .isw-badge-hop   { background:#881337; color:#ffe4e6; }
html[data-theme="dark"] .isw-example-tcp .ok { color:#4ade80 !important; }
html[data-theme="dark"] .isw-example-tcp .ko { color:#f87171 !important; }
 
/* ---------- 3. Menu a tendina "ars-dropdown" + box passo (Cablaggio, Interf. Elettrica) */
html[data-theme="dark"] .ars-dropdown { border-color: var(--dm-bd) !important; box-shadow: none; }
html[data-theme="dark"] .ars-dropdown summary {
  background: var(--dm-bg-head) !important; color: var(--dm-tx) !important; border-color: var(--dm-bd) !important;
}
html[data-theme="dark"] .ars-dropdown .ars-dropdown-body { background: var(--dm-bg) !important; color: var(--dm-tx) !important; border-color: var(--dm-bd) !important; }
html[data-theme="dark"] .ars-dropdown[open] summary { border-bottom-color: var(--dm-bd) !important; }
html[data-theme="dark"] .ars-step-warn { background:#4a3a10 !important; color:#ffe9a8 !important; border-left-color:#f0ad4e !important; }
html[data-theme="dark"] .ars-step-attn { background:#4a1d1d !important; color:#ffc9c9 !important; border-left-color:#ef4444 !important; }
html[data-theme="dark"] .ars-step-note { background:#17324a !important; color:#d4e8f7 !important; border-left-color:var(--dm-acc) !important; }
html[data-theme="dark"] .ars-pin-table th { background: var(--dm-bg-head) !important; color: var(--dm-tx) !important; border-color: var(--dm-bd) !important; }
html[data-theme="dark"] .ars-pin-table td { background: var(--dm-bg) !important; color: var(--dm-tx) !important; border-color: var(--dm-bd) !important; }
html[data-theme="dark"] .ars-pin-table tr:nth-child(even) td { background: var(--dm-bg-alt) !important; }
 
/* ---------- 4. Interfaccia Elettrica (tab + pannello con immagine) ---------- */
html[data-theme="dark"] .ie-tab,
html[data-theme="dark"] .ie-bubble { background: var(--dm-bg) !important; }
html[data-theme="dark"] .ie-tab.on { background: var(--acc-bg) !important; }
html[data-theme="dark"] .ie-row.on .ie-bubble { background: var(--acc) !important; color:#0b1118 !important; }
html[data-theme="dark"] .ie-img-outer { background: #fff; }   /* le foto del pannello restano su fondo chiaro */
 
/* ---------- 5. Wizard / list-table / card (sphinx-design) ------------------ */
/* celle numerate dei passi ("1", "2", ...) e prima riga azzurra delle list-table */
html[data-theme="dark"] table.table th,
html[data-theme="dark"] .bd-article-container table thead th {
  background: var(--dm-bg-head) !important; color: var(--dm-tx) !important; border-color: var(--dm-bd) !important;
}
html[data-theme="dark"] .bd-article-container table td,
html[data-theme="dark"] .bd-article-container table tbody th {
  color: var(--dm-tx) !important; border-color: var(--dm-bd) !important;
}
html[data-theme="dark"] .bd-article-container table tbody tr { background-color: var(--dm-bg) !important; }
html[data-theme="dark"] .bd-article-container table tbody tr:nth-child(even) { background-color: var(--dm-bg-alt) !important; }
html[data-theme="dark"] .sd-card, html[data-theme="dark"] .sd-card-body {
  background-color: var(--dm-bg) !important; color: var(--dm-tx) !important; border-color: var(--dm-bd) !important;
}
html[data-theme="dark"] .sd-card .sd-card-text, html[data-theme="dark"] .sd-card p { color: var(--dm-tx) !important; }
 
/* ---------- 6. Titoli e codice inline sui sfondi chiari -------------------- */
html[data-theme="dark"] .bd-article-container h1,
html[data-theme="dark"] .bd-article-container h2,
html[data-theme="dark"] .bd-article-container h3,
html[data-theme="dark"] .bd-article-container h4 { color: var(--dm-tx) !important; }
html[data-theme="dark"] .bd-article-container code.literal {
  background-color: #0f1620 !important; color: #e8c07d !important; border-color: var(--dm-bd) !important;
}
 
/* ---------- 7. Altri sfondi azzurri inline (cerchi numerati, righe, ecc.) -- */
html[data-theme="dark"] [style*="background:#e3f1fb"], html[data-theme="dark"] [style*="background: #e3f1fb"],
html[data-theme="dark"] [style*="background:#e8f4fc"], html[data-theme="dark"] [style*="background: #e8f4fc"],
html[data-theme="dark"] [style*="background:#f0f7ff"], html[data-theme="dark"] [style*="background: #f0f7ff"],
html[data-theme="dark"] [style*="background:#f0f4f8"], html[data-theme="dark"] [style*="background: #f0f4f8"],
html[data-theme="dark"] [style*="background:#eaf3fb"], html[data-theme="dark"] [style*="background:#eef6fc"] {
  background-color: var(--dm-bg-head) !important;
}
html[data-theme="dark"] .isw-flow-bubble, html[data-theme="dark"] .isw-nav-card i { background-color: var(--dm-bg-head) !important; }

/* ── Dark mode: variabili della classe .isw-page ── */
html[data-theme="dark"] .isw-page {
  --c-primary:   #e3eaf2;
  --c-accent:    #5aaee8;
  --c-accent-lt: #3b4a5e;
  --c-bg:        #1e2530;
  --c-bg-alt:    #252d3a;
  --c-bg-hover:  #2c3a4d;
  --c-border:    #3b4a5e;
  --c-text:      #e3eaf2;
  --c-muted:     #a9b9ca;
  --shadow-sm:   none;
  --shadow-md:   none;
}

/* ── Bolle numerate e linguette delle tabelle interattive, dark mode ── */
html[data-theme="dark"] :is(.fb-bubble, .ie-bubble, .tr-bubble) {
  background: #1a3a52 !important;
  border: 2px solid #5aaee8 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  width: 28px !important;
  height: 28px !important;
}
html[data-theme="dark"] :is(.fb-row, .ie-row, .tr-row):hover :is(.fb-bubble, .ie-bubble, .tr-bubble) {
  background: #2c6fa3 !important;
}
html[data-theme="dark"] :is(.fb-row, .ie-row, .tr-row).on :is(.fb-bubble, .ie-bubble, .tr-bubble) {
  background: #5aaee8 !important;
  border-color: #9fd0f5 !important;
  color: #0b1118 !important;
}
html[data-theme="dark"] :is(.fb-tab, .ie-tab, .tr-tab) {
  background: #1e2530 !important;
  color: #e3eaf2 !important;
  border-color: #3b4a5e !important;
}
html[data-theme="dark"] :is(.fb-tab, .ie-tab, .tr-tab).on {
  background: #1d3a57 !important;
  color: #9fd0f5 !important;
  border-color: #5aaee8 !important;
}