/* TeleNavix I/O table compact layout - static CSS, no React code changes.
 * Applied only to the legacy flat I/O/OBD configuration table.
 * Header's global "Last confirmed" stays visible.
 */
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) {
  width: 100% !important;
  min-width: 0 !important; /* replaces earlier 1120px hard minimum */
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}
/* Horizontal scrolling is not required when all fields fit in the viewport. */
:root body .tnx-popup-window.teltonika-settings-modal div:has(> table:has(tbody tr[data-setting-section-id])) {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
/* Fixed proportions, in table column order. */
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) :is(th, td):nth-child(1) { width: 14.5% !important; }
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) :is(th, td):nth-child(2) { width: 6.5% !important; }
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) :is(th, td):nth-child(3) { width: 23% !important; }
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) :is(th, td):nth-child(4) { width: 9% !important; }
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) :is(th, td):nth-child(5) { width: 9% !important; }
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) :is(th, td):nth-child(6) { width: 14% !important; }
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) :is(th, td):nth-child(7) { width: 15% !important; }
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) :is(th, td):nth-child(8) { width: 9% !important; }
/* Suppress per-row timestamps and "Not yet read" sublines; top timestamp remains. */
:root body .tnx-popup-window.teltonika-settings-modal tr[data-setting-section-id] td:first-child span.block[class*="mt-0.5"] {
  display: none !important;
}
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) :is(td, th) {
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding-left: 5px !important;
  padding-right: 5px !important;
  overflow: hidden;
}
/* Full column titles remain visible at narrower modal widths. */
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) thead th {
  white-space: normal !important;
  overflow-wrap: normal !important;
  line-height: 1.15 !important;
  vertical-align: middle !important;
}
/* Long names or units wrap instead of enlarging a column. */
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) :is(td, th):nth-child(-n+2) {
  white-space: normal !important;
  overflow-wrap: break-word;
  line-height: 1.25;
}
:root body .tnx-popup-window.teltonika-settings-modal table:has(tbody tr[data-setting-section-id]) td:first-child {
  padding-left: 10px !important;
}
/* Compact numeric inputs in Low, High, Averaging; still allow digits and spin button. */
:root body .tnx-popup-window.teltonika-settings-modal tr[data-setting-section-id] :is(td:nth-child(4),td:nth-child(5),td:nth-child(8)) fieldset {
  flex: 0 1 66px !important;
  min-width: 0 !important;
  width: 66px !important;
  max-width: calc(100% - 15px) !important;
}
:root body .tnx-popup-window.teltonika-settings-modal tr[data-setting-section-id] :is(td:nth-child(4),td:nth-child(5),td:nth-child(8)) input[type="number"] {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 3px 3px !important;
  font-size: 11px !important;
  text-align: center !important;
}
/* The operand uses compact space; avoid the min-width previously set on its td. */
:root body .tnx-popup-window.teltonika-settings-modal tr[data-setting-section-id] td:nth-child(7) select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 136px !important;
  padding: 4px 2px !important;
  font-size: 11px !important;
  text-overflow: ellipsis;
}
/* Event Only: fit all three buttons, including Crash, without wrapping. */
:root body .tnx-popup-window.teltonika-settings-modal tr[data-setting-section-id] td:nth-child(6) .tnx-config-segmented {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 2px !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
:root body .tnx-popup-window.teltonika-settings-modal tr[data-setting-section-id] td:nth-child(6) .tnx-config-option {
  min-width: 0 !important;
  padding: 4px 1px !important;
  font-size: 10px !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}
/* Priority keeps four horizontal choices from the existing CSS-only fix. */
:root body .tnx-popup-window.teltonika-settings-modal tr[data-setting-section-id] td:nth-child(3) .tnx-config-segmented {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  min-width: 0 !important;
}
:root body .tnx-popup-window.teltonika-settings-modal tr[data-setting-section-id] td:nth-child(3) .tnx-config-option {
  white-space: nowrap !important;
  padding: 4px 2px !important;
}
/* Keep tooltips intact without allowing SVG help icons to grow the cell. */
:root body .tnx-popup-window.teltonika-settings-modal tr[data-setting-section-id] td .flex.items-center.gap-1 {
  min-width: 0 !important;
  gap: 3px !important;
}
:root body .tnx-popup-window.teltonika-settings-modal tr[data-setting-section-id] td svg {
  flex-shrink: 0 !important;
  width: 12px !important;
  height: 12px !important;
}
