/* Basic reset */
* { box-sizing: border-box; }
:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e232d;
  --text: #e8ebf1;
  --muted: #97a0b3;
  --primary: #4da3ff;
  --primary-600: #2f7cda;
  --accent: #21d4a7;
  --danger: #ff5a7a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, #121622, #0c0f14 60%), var(--bg);
  color: var(--text);
}

.app { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; }

.app-header {
  padding: 20px 24px;
  border-bottom: 1px solid #252a35;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(6px);
}

.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; font-weight: 800; color: #0d1016; box-shadow: var(--shadow);
}
.brand-text h1 { margin: 0; font-size: 20px; letter-spacing: .3px; }
.brand-text p { margin: 2px 0 0 0; color: var(--muted); font-size: 13px; }

.content { padding: 24px; max-width: 1100px; margin: 0 auto; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid #2a3140;
  border-radius: var(--radius);
  padding: 18px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

h2 { margin: 0 0 12px 0; font-size: 18px; }

.label { display:block; margin: 6px 0 6px; color: var(--muted); font-size: 13px; }
.input {
  width: 100%; background: #0f131b; color: var(--text); border: 1px solid #2a3140;
  border-radius: 12px; padding: 12px 14px; outline: none; transition: border .2s, box-shadow .2s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(77,163,255,.12); }
.file-input { padding: 10px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px){ .grid-2 { grid-template-columns: 1fr; } }
.mt { margin-top: 10px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }

.tabs { display:flex; gap: 8px; margin: 10px 0 14px; }
.tab {
  appearance: none; border: 1px solid #2a3140; background: #101620; color: var(--text);
  padding: 10px 14px; border-radius: 999px; cursor: pointer; font-weight: 600;
  transition: transform .06s ease, background .2s, border .2s;
}
.tab:hover { transform: translateY(-1px); }
.tab.active { background: linear-gradient(135deg, #1a2230, #0f151f); border-color: var(--primary-600); }

.tab-panel { display:none; }
.tab-panel.active { display:block; }

.options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 10px 14px;
}
@media (max-width: 900px){
  .options-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
@media (max-width: 600px){
  .options-grid { grid-template-columns: 1fr; }
}

.chk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #111722; border: 1px solid #273040; border-radius: 12px; }
.chk input { width: 18px; height: 18px; }

.actions-row { display:flex; align-items:center; gap: 16px; flex-wrap: wrap; }
.btn {
  appearance:none; border: none; border-radius: 14px; padding: 12px 16px; font-weight: 700;
  cursor: pointer; transition: transform .06s ease, box-shadow .2s, background .2s;
}
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #0e1016; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }

.output { display:flex; align-items:center; gap: 8px; flex-wrap: wrap; }
.out-label { color: var(--muted); font-size: 13px; }
.new-name {
  min-width: 200px; padding: 10px 12px; border: 1px dashed #334057; border-radius: 12px; background: #0a0f16;
}

.footer { position: sticky; bottom: 0; }
.progress-wrap {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 10px; background: #0d1118; border-top: 1px solid #222a38;
  display:flex; align-items: center; justify-content: center;
}
.progress-bar {
  position: absolute; left: 0; top: 0; height: 10px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .2s ease-out;
}
.progress-text {
  position: relative; z-index: 2; font-size: 12px; color: var(--muted); padding: 8px; background: rgba(0,0,0,.25); border-radius: 999px; border: 1px solid #242c3a;
}


/* === Option grouping & alignment === */
.options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}
@media (max-width: 1000px){ .options-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); } }
@media (max-width: 640px){ .options-grid { grid-template-columns: 1fr; } }

.opt-group {
  background: linear-gradient(180deg, #101623, #0c121c);
  border: 1px solid #2b3346;
  border-radius: 14px;
  padding: 12px;
}
.opt-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .3px;
  color: #9fb3d9;
  text-transform: uppercase;
  margin: 2px 0 10px;
  opacity: .9;
}
.opt-group .chk { margin-bottom: 8px; }
.opt-group .chk:last-child { margin-bottom: 0; }


/* Exclusive group subtle cue */
/* removed in v21: do not blank ::after (conflicted with knob) */
/* === Toast notifications === */
#toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  background: #0f131b;
  border: 1px solid #2a3140;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.toast-in { opacity: 1; transform: translateY(0); }
.toast.toast-out { opacity: 0; transform: translateY(8px); }

/* === Modal confirm === */
.modal-backdrop{
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: grid; place-items: center; z-index: 10000;
  opacity: 0; transform: scale(1.01);
  transition: opacity .15s ease, transform .15s ease;
}
.modal-backdrop.in{ opacity: 1; transform: scale(1); }
.modal-backdrop.out{ opacity: 0; transform: scale(1.01); }
.modal{
  background: #0f131b; border: 1px solid #2a3140; border-radius: 16px; padding: 18px;
  width: min(520px, 92vw); box-shadow: var(--shadow);
}
.modal-title{ font-weight: 700; margin-bottom: 8px; }
.modal-body{ color: var(--text); opacity: .95; margin-bottom: 12px; }
.modal-actions{ display:flex; justify-content: flex-end; gap: 10px; }
.btn.secondary{ background: #101620; color: var(--text); border: 1px solid #2a3140; }
.btn.primary{ background: linear-gradient(135deg, var(--primary), var(--accent)); color: #0e1016; }

/* === Success popup (auto hide) === */
.success-popup{
  position: fixed; left: 50%; top: 18%;
  transform: translate(-50%, -50%) scale(.98);
  background: #0f131b; border: 1px solid #2a3140; color: var(--text);
  padding: 12px 16px; border-radius: 12px; z-index: 10001;
  box-shadow: var(--shadow);
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
}
.success-popup.in{ opacity: 1; transform: translate(-50%, -50%) scale(1); }
.success-popup.out{ opacity: 0; transform: translate(-50%, -50%) scale(.98); }

/* === Toast notifications (kept if needed elsewhere) === */
#toast-host{
  position: fixed; right: 16px; bottom: 16px; display:flex; flex-direction:column; gap:10px; z-index: 9999;
}
.toast{ background:#0f131b; border:1px solid #2a3140; padding:12px 14px; border-radius:12px; box-shadow:var(--shadow); color:var(--text); opacity:0; transform:translateY(8px); transition:opacity .2s, transform .2s; }
.toast.toast-in{ opacity:1; transform:translateY(0); }
.toast.toast-out{ opacity:0; transform:translateY(8px); }


/* === Professional Checkboxes (enhanced) === */
/* Works with existing markup:
   <label class="chk"><input type="checkbox" value="..."><span>Texte</span></label>
   No HTML changes needed. Accessible, keyboard-focusable, reduced motion friendly. */

/* Reset native box visually but keep it accessible */
.chk input{
  position:absolute;
  opacity:0;
  width:18px; height:18px;
}

/* Container polish */
.chk{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  background:#111722;
  border:1px solid #273040;
  border-radius:12px;
  transition:transform .08s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
  will-change: transform;
}
.chk:hover{ transform: translateY(-1px); background:#121a2a; }
.chk:active{ transform: translateY(0); }

/* Custom box before label text */
.chk input + span::before{
  content:"";
  display:inline-block;
  width:20px; height:20px;
  border-radius:8px;
  border:1px solid #2b3346;
  background:#0f131b;
  box-shadow: inset 0 -10px 18px rgba(0,0,0,.18);
  vertical-align:middle;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .12s ease;
}

/* Checkmark */
.chk input + span::after{
  content:"";
  position:relative;
  display:inline-block;
  width:12px; height:6px;
  margin-left:-17px; /* overlays inside the box */
  border-left:3px solid transparent;
  border-bottom:3px solid transparent;
  transform: rotate(-45deg) translateY(-1px) scale(.6);
  opacity:0;
  transition: opacity .12s ease, transform .12s ease;
}

/* Checked state — gradient fill + visible checkmark */
.chk input:checked + span::before{
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
}
.chk input:checked + span::after{
  border-color: #0e1016; /* dark check over gradient */
  opacity:1;
  transform: rotate(-45deg) translateY(-1px) scale(1);
}

/* Indeterminate support (if set via JS: el.indeterminate = true) */
.chk input:indeterminate + span::before{
  background: linear-gradient(135deg, #7aa9ff, #b5ffd2);
  border-color: transparent;
}
.chk input:indeterminate + span::after{
  width:12px; height:0; border:0; opacity:1;
  transform:none; margin-left:-15px;
  box-shadow: inset 0 0 0 999px #0e1016;
}

/* Focus ring (keyboard) */
.chk input:focus-visible + span::before{
  outline:3px solid rgba(77,163,255,.35);
  outline-offset:3px;
}

/* Disabled */
.chk input:disabled + span{ color: var(--muted); }
.chk input:disabled + span::before{
  opacity:.6;
  filter:grayscale(.3);
}

/* Compact label text spacing so box and text align nicely */
.chk span{ display:inline-flex; align-items:center; gap:8px; }

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce){
  .chk, .chk *{ transition: none !important; }
}
/* === End Professional Checkboxes === */


/* === Toggle Switches — v21 (final translation fix)
   - Correct travel uses both paddings: (W - D - pad*2)
   - Force 'left' identical in both states; movement purely via translateX
*/
:root{
  --switch-w: 52px;
  --switch-h: 30px;
  --switch-pad: 3px;
  --knob-d: 24px;
  --switch-travel: calc(var(--switch-w) - var(--knob-d) - (var(--switch-pad) * 2)); /* 52-24-3*2 = 22px */
}

.chk input + span::after{
  left: var(--switch-pad) !important;
  transform: translateY(-50%) translateX(var(--knob-tx, 0px)) scale(var(--knob-scale, 1));
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, background .22s ease;
}

.chk input:checked + span{ --knob-tx: var(--switch-travel); }
.chk input:checked + span::after{ left: var(--switch-pad) !important; }


/* === Toggle Switches — v22 (authoritative override) ===
   Purpose: ensure clean left→right translation, no legacy checkbox artifacts.
   Markup: <label class="chk"><input type="checkbox"><span>Texte</span></label>
*/

:root{
  --switch-w: 52px;
  --switch-h: 30px;
  --switch-pad: 3px;
  --knob-d: 24px;
  --switch-travel: calc(var(--switch-w) - var(--knob-d) - (var(--switch-pad) * 2)); /* 22px */
  --switch-on-start: #6ea8ff;
  --switch-on-end:   #7fe0bd;
  --switch-off-bg:   #0f1622;
  --switch-border:   #2b3346;
  --switch-knob:     #eaf1ff;
  --switch-focus:    rgba(77,163,255,.35);
}

/* Space for the switch ahead of the label */
label.chk span{
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding-left: calc(var(--switch-w) + 12px) !important;
  line-height: 1.3 !important;
}

/* Reset/override any previous checkbox pseudo styles on ::before/::after */
label.chk input + span::before,
label.chk input + span::after{
  all: initial;
  content: "" !important;
  position: absolute !important;
  top: 50% !important;
  left: var(--switch-pad) !important;
  display: block !important;
  box-sizing: border-box !important;
}

/* Track */
label.chk input + span::before{
  transform: translateY(-50%) !important;
  width: var(--switch-w) !important;
  height: var(--switch-h) !important;
  border-radius: 999px !important;
  background: var(--switch-off-bg) !important;
  border: 1px solid var(--switch-border) !important;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.05),
    inset 0 -8px 14px rgba(0,0,0,.35) !important;
  transition: background .22s ease, border-color .22s ease, box-shadow .22s ease !important;
}

/* Knob uses only translateX for motion */
label.chk{ --knob-tx: 0px; --knob-scale: 1; }
label.chk input + span::after{
  transform: translateY(-50%) translateX(var(--knob-tx)) scale(var(--knob-scale)) !important;
  width: var(--knob-d) !important;
  height: var(--knob-d) !important;
  border-radius: 999px !important;
  background:
    radial-gradient(28px 28px at 30% 30%, rgba(255,255,255,.98) 0%, var(--switch-knob) 60%, #dfe7fa 100%) !important;
  border: 1px solid rgba(0,0,0,.12) !important;
  box-shadow:
    0 1px 2px rgba(0,0,0,.25),
    0 6px 12px rgba(0,0,0,.25) !important;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, background .22s ease !important;
  will-change: transform !important;
}

/* ON state */
label.chk input:checked + span{ --knob-tx: var(--switch-travel); }
label.chk input:checked + span::before{
  background: linear-gradient(90deg, var(--switch-on-start), var(--switch-on-end)) !important;
  border-color: transparent !important;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.15),
    0 6px 18px rgba(0,0,0,.28) !important;
}
label.chk input:checked + span::after{
  /* keep same left; motion only via translateX */
  left: var(--switch-pad) !important;
}

/* Hover/active/focus */
label.chk:hover input + span::after{
  box-shadow:
    0 2px 3px rgba(0,0,0,.25),
    0 8px 16px rgba(0,0,0,.28) !important;
}
label.chk:active{ --knob-scale: .98; }
label.chk input:focus-visible + span::before{
  outline: 3px solid var(--switch-focus) !important;
  outline-offset: 2px !important;
}

/* Disabled */
label.chk input:disabled + span{ color: #7f8aa3 !important; }
label.chk input:disabled + span::before{ opacity:.6 !important; filter: grayscale(.25) !important; }
label.chk input:disabled + span::after{ opacity:.85 !important; box-shadow:none !important; }
/* === End v22 === */


/* === Modal & Toast — v23 (Pro Light) === */
:root{
  --card-bg: #ffffff;
  --card-border: #e6e8eb;
  --card-text: #0e1117;
  --card-muted: #2b2f36;
  --card-shadow: 0 10px 40px rgba(18,26,39,.25);
  --brand-grad-start: #2563eb;
  --brand-grad-end: #22c55e;
}

/* Backdrop with subtle blur */
.modal-backdrop{
  background: rgba(9,13,20,.40);
  backdrop-filter: blur(6px) saturate(120%);
}

/* Modal card */
.modal{
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px 22px;
  width: min(520px, 92vw);
  box-shadow: var(--card-shadow);
}
.modal-title{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .2px;
  margin-bottom: 6px;
  color: var(--card-text);
}
.modal-body{
  color: var(--card-muted);
  margin: 12px 0 16px;
  line-height: 1.6;
}
.modal-actions{ gap: 12px; }

/* Buttons inside modal */
.modal .btn.primary{
  background: linear-gradient(135deg, var(--brand-grad-start), var(--brand-grad-end));
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 6px 18px rgba(34,197,94,.25);
}
.modal .btn.primary:hover{ filter: brightness(1.03); }
.modal .btn.primary:active{ transform: translateY(1px); }

.modal .btn.secondary{
  background: #f3f5f7;
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
}
.modal .btn.secondary:hover{ background:#eef1f4; }
.modal .btn.secondary:active{ transform: translateY(1px); }

/* Success popup as a tidy top toast */
.success-popup{
  position: fixed; left: 50%; top: 72px;
  transform: translateX(-50%) scale(.98);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--card-text);
  padding: 12px 16px 12px 46px;
  border-radius: 12px;
  z-index: 10001;
  box-shadow: var(--card-shadow);
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
}
.success-popup.in{ opacity: 1; transform: translateX(-50%) scale(1); }
.success-popup.out{ opacity: 0; transform: translateX(-50%) scale(.98); }

/* Icon badge on success popup */
.success-popup::before{
  content:"";
  position:absolute; left:14px; top:50%; transform: translateY(-50%);
  width:22px; height:22px; border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #86efac);
  box-shadow: 0 4px 12px rgba(16,185,129,.35);
}
.success-popup::after{
  content:"";
  position:absolute; left:14px; top:50%; transform: translate(3px,-50%);
  width:22px; height:22px;
  background-repeat:no-repeat; background-position:center; background-size:14px 14px;
  /* white check SVG */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 13l4 4L19 7' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* === End v23 === */


/* === Combobox (ECU brand/model) — v24 === */
.sr-only{ position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.combo{ position: relative; width: 100%; }
.combo-list{
  position:absolute; inset: auto 0 0 0; transform: translateY(100%);
  background: var(--panel);
  border: 1px solid #2a3140;
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow);
  max-height: 240px; overflow:auto;
  list-style: none; margin: 0; padding: 6px;
  z-index: 1000;
}
.combo-list[hidden]{ display:none; }
.combo-item{
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  color: var(--text); font-size: 14px;
}
.combo-item[aria-selected="true"], .combo-item:hover{
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0e1016;
}
.combo-input{ border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.combo:has(.combo-list:not([hidden])) .combo-input{
  border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;
}
@media (max-width: 560px){
  .combo-list{ max-height: 50vh; }
}
/* === End v24 === */


/* v46 segmented choice bar */
.seg{ display:flex; flex-wrap:wrap; gap:6px; margin-top:.4rem; }
.seg-btn{ 
  padding:.4rem .7rem; border:1px solid #2a3241; border-radius:10px; background:#0f1520; 
  color:#cfd9e6; cursor:pointer; user-select:none; transition:transform .06s ease, background .2s ease, border-color .2s ease;
}
.seg-btn:hover{ background:#132033; transform:translateY(-1px); }
.seg-btn[aria-checked="true"], .seg-btn.active{
  background:#1a2d4a; border-color:#355887; color:#eaf2ff; box-shadow:0 0 0 2px rgba(53,88,135,.25) inset;
}

/* Injecteur UI */
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.metric{font-size:20px;font-weight:600}
.submetric{opacity:.8;font-size:12px;margin-top:4px}
.table{width:100%;border-collapse:collapse;margin-top:8px}
.table th,.table td{border:1px solid #2b3240;padding:8px;text-align:center}
.table-tools{display:flex;gap:8px;margin-bottom:8px;flex-wrap:wrap}
.btn.file{position:relative;overflow:hidden}
.btn.file input{position:absolute;inset:0;opacity:0;cursor:pointer}
@media(max-width:900px){.grid-3{grid-template-columns:1fr}}

/* === Modal close (red X) === */
.modal{ position: relative; }
.modal-close{
  position:absolute; top:10px; right:10px;
  width:28px; height:28px; border-radius:8px;
  background: transparent; border: 1px solid var(--card-border, #e6e8eb);
  color: var(--danger); font-weight: 800; line-height: 1;
  display:grid; place-items:center; cursor:pointer;
}
.modal-close:hover{ filter: brightness(1.05); box-shadow: 0 4px 14px rgba(255,90,122,.25); }
.modal-close:active{ transform: translateY(1px); }


/* === Compact calibration table (editor) === */
.table.compact{ font-size: 13px; }
.table.compact th, .table.compact td{ padding: 6px 8px; line-height: 1.25; }
.table.compact input.input{ padding: 8px 10px; font-size: 14px; border-radius: 8px; }

/* Also ensure any table shown inside a modal is a bit tighter */
.modal .table{ font-size: 13px; }
.modal .table th, .modal .table td{ padding: 6px 8px; }
.modal .table input.input{ padding: 8px 10px; font-size: 14px; border-radius: 8px; }

/* Slightly reduce h3/hint spacing in the editor modal to win vertical space */
.modal .modal-body p{ margin: 8px 0 10px; }



/* === Ultra-compact calibration editor (more vertical density) === */
.modal{ max-height: 94vh; padding: 14px 16px; }
.modal .modal-title{ margin: 2px 0 6px; font-size: 16px; }
.modal .modal-body{ padding-top: 4px; }
.modal .modal-body p{ margin: 6px 0 8px; }
.modal .table{ font-size: 12.5px; }
.modal .table th, .modal .table td{ padding: 5px 8px; line-height: 1.2; }
.modal .table input.input{ padding: 6px 9px; font-size: 13.5px; border-radius: 8px; height: 34px; }
#editorMinMs.input, #editorMinMs{ padding: 6px 9px; font-size: 13.5px; height: 34px; }


/* Force ifaceMode buttons to be clickable */
#ifaceMode, #ifaceMode * { pointer-events: auto !important; }
#ifaceMode button.seg-btn { cursor: pointer; }


/* Segmented buttons rendering for <button> elements */
.seg{display:flex;flex-wrap:wrap;gap:6px;margin-top:.4rem}
.seg button.seg-btn{padding:.45rem .85rem;border:1px solid #2a3241;border-radius:10px;background:#0f1520;color:#cfd9e6;cursor:pointer;user-select:none;transition:transform .06s ease, background .2s ease, border-color .2s ease}
.seg button.seg-btn:hover{background:#132033;transform:translateY(-1px)}
.seg button.seg-btn.active{background:#1a2d4a;border-color:#355887;color:#eaf2ff;box-shadow:0 0 0 2px rgba(53,88,135,.25) inset}
