.n4ml-switcher{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.n4ml-btn{padding:6px 10px;border:1px solid #ccc;background:#fff;border-radius:6px;cursor:pointer;display:inline-flex;gap:6px;align-items:center}
.n4ml-btn.is-current{border-color:#111;background:#111;color:#fff}
.n4ml-flag{font-size:18px;line-height:1}
.n4ml-switcher--inline .n4ml-btn{padding:0;border:none;background:transparent;text-decoration:underline}

.n4ml-btn:focus-visible,
.n4ml-suggestion:focus-visible{
  outline: 2px solid rgba(0, 140, 255, .75);
  outline-offset: 2px;
}

#n4ml-editor-bar{
  position:fixed;
  top:0;left:0;right:0;
  z-index:999999;
  background:#23282d;color:#fff;
  padding:8px 10px
}

/* N4ML editor bar isolation (avoid theme/Elementor styles) */
#n4ml-editor-bar,
#n4ml-editor-bar *{
  color:#ffffff !important;
  font-family: Arial, Helvetica, sans-serif !important;
}

#n4ml-editor-bar label,
#n4ml-editor-bar span,
#n4ml-editor-bar strong{
  color:#ffffff !important;
}

#n4ml-editor-bar button{
  all: unset;
  background:#000000 !important;
  color:#ffffff !important;
  border:1px solid rgba(255,255,255,.25) !important;
  padding:6px 10px !important;
  border-radius:6px !important;
  cursor:pointer !important;
}

#n4ml-editor-bar button:hover{background:#222222 !important;}

#n4ml-editor-bar select{
  all: unset;
  background:#ffffff !important;
  color:#000000 !important;
  border:1px solid rgba(255,255,255,.35) !important;
  padding:6px 10px !important;
  border-radius:6px !important;
  cursor:pointer !important;
}

#n4ml-editor-bar .inner{display:flex;justify-content:space-between;align-items:center;gap:12px;}
#n4ml-editor-bar .left{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
#n4ml-target-lang{min-width:140px;}

#n4ml-editor-panel{
  position:fixed;
  top:calc(var(--n4ml-bar-bottom,60px) + 12px);
  right:12px;
  width:360px;
  max-width:calc(100vw - 24px);
  max-height:calc(100vh - (var(--n4ml-bar-bottom,60px) + 24px));
  overflow:auto;
  z-index:1000000;
  background:#fff;
  border:1px solid #ccd0d4;
  border-radius:10px;
  box-shadow:0 6px 20px rgba(0,0,0,.2);
  padding:10px
}
#n4ml-editor-panel textarea{width:100%;min-height:90px;margin:6px 0 10px}
#n4ml-editor-panel .actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;margin-top:10px;padding-top:10px;border-top:1px solid #eee}

/* Evidenzia elementi cliccabili */
body.n4ml-translate-mode .n4ml-selectable{
  outline: 2px dashed rgba(0, 140, 255, .35);
  outline-offset: 4px;
  cursor: pointer !important;
}
body.n4ml-translate-mode .n4ml-selectable:hover{
  outline-color: rgba(0, 140, 255, .75);
  background: rgba(0, 140, 255, .05);
}

/* Offset toolbar sotto la WP admin bar */
body.admin-bar #n4ml-editor-bar{top:32px;}
@media screen and (max-width: 782px){body.admin-bar #n4ml-editor-bar{top:46px;}}

/* In modalità traduzione: sposta contenuto e header fissi sotto la toolbar N4ML */
body.n4ml-translate-mode{padding-top:var(--n4ml-bar-bottom,60px)!important;}
body.n4ml-translate-mode header,
body.n4ml-translate-mode .site-header,
body.n4ml-translate-mode .elementor-location-header,
body.n4ml-translate-mode .elementor-sticky--active,
body.n4ml-translate-mode .elementor-sticky--effects{
  top:var(--n4ml-bar-bottom,60px)!important;
}

/* Suggerimenti traduzioni */
.n4ml-suggestions{margin-top:10px;padding:10px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;}
.n4ml-suggestions-title{font-weight:600;margin-bottom:8px;}
.n4ml-suggestions-list{display:flex;flex-wrap:wrap;gap:8px;}
.n4ml-suggestion{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(0,0,0,.18);background:#f7f7f7;border-radius:999px;padding:6px 10px;cursor:pointer;font-size:13px;}
.n4ml-suggestion:hover{background:#eee;}
.n4ml-suggestion .k{opacity:.75;}

/* Prevent long suggestion chips from overflowing the container */
.n4ml-suggestions-list{min-width:0;}
.n4ml-suggestion{max-width:100%; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.n4ml-suggestion .v{min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
/* ================================
   N4ML Editor UI – style isolation
   Prevent theme/Elementor CSS bleed
   ================================ */

#n4ml-editor-bar, #n4ml-editor-panel{
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,Helvetica,sans-serif !important;
  color:#000 !important;
}

#n4ml-editor-panel{
  background:#fff !important;
}

/* Reset common theme/Elementor styles on controls inside the UI */
#n4ml-editor-bar button,
#n4ml-editor-panel button,
#n4ml-editor-panel input,
#n4ml-editor-panel textarea,
#n4ml-editor-panel select{
  all: unset;
  box-sizing: border-box;
  font-family: inherit !important;
}

#n4ml-editor-panel label{
  all: unset;
  display:block;
  font-family: inherit !important;
  color:#000 !important;
  font-weight:600;
  margin:10px 0 6px;
}

/* Inputs */
#n4ml-editor-panel input,
#n4ml-editor-panel textarea,
#n4ml-editor-panel select{
  display:block;
  width:100%;
  background:#fff !important;
  color:#000 !important;
  border:1px solid rgba(0,0,0,.18) !important;
  border-radius:8px;
  padding:10px 12px;
  line-height:1.3;
}

#n4ml-editor-panel textarea{
  min-height:90px;
}

/* Buttons – black background, white text */
#n4ml-editor-bar button,
#n4ml-editor-panel button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:#000 !important;
  color:#fff !important;
  border:none !important;
  border-radius:8px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:600;
  line-height:1;
}

#n4ml-editor-bar button:hover,
#n4ml-editor-panel button:hover{
  background:#222 !important;
}

#n4ml-editor-bar button:focus-visible,
#n4ml-editor-panel button:focus-visible{
  outline:2px solid rgba(102,252,241,.9) !important;
  outline-offset:2px;
}

/* Suggestions – keep inside container */
#n4ml-suggestions{background:#fff !important;}
#n4ml-suggestions-list{min-width:0;}
#n4ml-suggestions-list .n4ml-suggestion{
  max-width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
