/**
 * Ahan DarkMode – MOBILE dark-mode fixes (patched v1.4.17)
 * Scope: only when dark mode is active AND viewport is <= 900px
 */
@media (max-width: 900px) {
  /* ---- PHONE BAR + HEADER CONTRAST ---- */
  html.wp-dark-mode-active body a[href^="tel:"],
  html.dark body a[href^="tel:"],
  html.dark-mode body a[href^="tel:"],
  html.is-dark-mode body a[href^="tel:"],
  body.wp-dark-mode-active a[href^="tel:"],
  body.dark a[href^="tel:"],
  body.dark-mode a[href^="tel:"],
  body.is-dark-mode a[href^="tel:"]{
    color: #39dbc4 !important;
    font-weight: 700 !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    text-decoration: none;
  }

  html.wp-dark-mode-active body #top-nav,
  html.wp-dark-mode-active body .top-nav,
  html.wp-dark-mode-active body .header-nav,
  html.wp-dark-mode-active body .tmcpt-bar,
  html.wp-dark-mode-active body .phone-bar,
  html.dark body #top-nav,
  html.dark body .top-nav,
  html.dark-mode body #top-nav,
  html.is-dark-mode body #top-nav{
    background: #141618 !important;
    border-color: #2a2d31 !important;
  }

  /* ---- TABLE HEADER VISIBILITY (force show) ---- */
  html.wp-dark-mode-active body table thead,
  html.dark body table thead,
  html.dark-mode body table thead,
  html.is-dark-mode body table thead,
  body.wp-dark-mode-active table thead,
  body.dark table thead,
  body.dark-mode table thead,
  body.is-dark-mode table thead,
  html.wp-dark-mode-active body .wp-block-table thead,
  html.dark body .wp-block-table thead,
  html.dark-mode body .wp-block-table thead,
  html.is-dark-mode body .wp-block-table thead{
    display: table-header-group !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
  }

  /* ---- TABLE HEADER LOOK (sticky + contrast) ---- */
  html.wp-dark-mode-active body table thead th,
  html.dark body table thead th,
  html.dark-mode body table thead th,
:where\(html\.dark, html\[data-theme="dark"\], body\.dark, body\.dark-mode, \.wp-dark-mode-active, \[data-wp-dark-mode-active\]\) html.is-dark-mode body table thead th{
    position: sticky !important;
    top: 0;
    z-index: 2;
    background: #1a1f24 !important;
    color: #e9eef3 !important;
    border-color: rgba(255,255,255,0.12) !important;
    text-shadow: none !important;
  }

  /* ---- TABLE BODY ZEBRA FOR READABILITY ---- */
  html.wp-dark-mode-active body table tbody tr:nth-child(odd),
  html.dark body table tbody tr:nth-child(odd){ background: #101419 !important; }
  html.wp-dark-mode-active body table tbody tr:nth-child(even),
  html.dark body table tbody tr:nth-child(even){ background: #0c0f13 !important; }
  html.wp-dark-mode-active body table tbody td,
  html.dark body table tbody td{ color: #dce3ea !important; }

  /* ---- DATATABLES (if present) ---- */
  html.wp-dark-mode-active body .dataTables_wrapper .dataTables_length select,
  html.wp-dark-mode-active body .dataTables_wrapper .dataTables_filter input,
  html.wp-dark-mode-active body .dataTables_wrapper .dataTables_paginate a,
  html.wp-dark-mode-active body .dataTables_wrapper .dataTables_info,
  html.dark body .dataTables_wrapper .dataTables_length select,
  html.dark body .dataTables_wrapper .dataTables_filter input{
    background: #0f1216 !important;
    color: #e5e9f0 !important;
    border: 1px solid #2a2f36 !important;
  }
  html.wp-dark-mode-active body .dataTables_wrapper .dataTables_paginate a:hover{ background: #1a1f24 !important; }

  /* ---- BUTTONS INSIDE TABLE TOOLBARS ---- */
  html.wp-dark-mode-active body .table-controls button,
  html.wp-dark-mode-active body .table-controls .btn,
  html.dark body .table-controls button,
  html.dark body .table-controls .btn{
    background: #1a1f24 !important;
    color: #e9eef3 !important;
    border-color: #2a2f36 !important;
  }
}

/* ===== Ahan Sazeh – v1.4.18: Stronger mobile dark-mode fixes ===== */
@media (max-width: 900px){
  /* Phone bar & header contrast (TieLabs/Jannah common classes) */
  html.wp-dark-mode-active body #top-nav,
  html.wp-dark-mode-active body .top-nav,
  html.wp-dark-mode-active body .header-nav,
  html.wp-dark-mode-active body .tmcpt-bar,
  html.wp-dark-mode-active body .phone-bar,
  html.dark body #top-nav,
  html.dark body .top-nav,
  html.dark body .header-nav,
  html.dark body .tmcpt-bar,
  html.dark body .phone-bar,
  html.dark-mode body #top-nav,
  html.dark-mode body .top-nav,
  html.dark-mode body .header-nav,
  html.dark-mode body .tmcpt-bar,
  html.dark-mode body .phone-bar{
    background: #141618 !important;
    color: #e9eef3 !important;
    border-color: #2a2d31 !important;
  }
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body a[href^="tel:"],
  body[class*="dark"] a[href^="tel:"],
  html.wp-dark-mode-active body a[href^="tel:"],
  body.wp-dark-mode-active a[href^="tel:"]{
    color: #39dbc4 !important;
    font-weight: 700 !important;
    text-decoration: none !important;
  }
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar i,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar .icon,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar .fa,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar .fas{
    color: #39dbc4 !important;
  }

  /* Force table headers visible on mobile (for responsive/stacked tables too) */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table thead,
  body[class*="dark"] table thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTables_scrollHead thead{
    display: table-header-group !important;
    visibility: visible !important;
    height: auto !important;
  }
  /* Reset common responsive plugins hiding headers */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table.responsive thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table.stacked thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table.stacktable thead{
    display: table-header-group !important;
  }
  /* Make header cells sticky and legible */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTables_scrollHead thead th{
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    background: #1a1f24 !important;
    color: #e9eef3 !important;
    border-color: rgba(255,255,255,0.14) !important;
    text-shadow: none !important;
  }
  /* If any plugin sets th/thead to display:block, normalize */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table thead, 
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table thead tr,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table thead th{
    display: table-header-group !important;
  }
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table thead tr{ display: table-row !important; }
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table thead th{ display: table-cell !important; }
}

/* ===== v1.4.19 Ultra-strong mobile dark fixes (Ahan Sazeh) ===== */
@media (max-width: 900px){
  /* --- Phone bar/link contrast in any dark variant --- */
  html.wp-dark-mode-active body .phone-bar,
  html.wp-dark-mode-active body #top-nav,
  html.wp-dark-mode-active body .top-nav,
  html.wp-dark-mode-active body .header-nav,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body #top-nav,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .top-nav,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .header-nav,
  body.wp-dark-mode-active .phone-bar,
  body[class*="dark"] .phone-bar{
    background: #141618 !important;
    color: #e9eef3 !important;
    border-color: #2a2d31 !important;
  }
  html.wp-dark-mode-active body .phone-bar a[href^="tel:"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar a[href^="tel:"],
  html.wp-dark-mode-active body #top-nav a[href^="tel:"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body #top-nav a[href^="tel:"],
  html.wp-dark-mode-active body .top-nav a[href^="tel:"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .top-nav a[href^="tel:"],
  html.wp-dark-mode-active body .header-nav a[href^="tel:"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .header-nav a[href^="tel:"],
  body.wp-dark-mode-active .phone-bar a[href^="tel:"],
  body[class*="dark"] .phone-bar a[href^="tel:"]{
    color: #39dbc4 !important;
    font-weight: 800 !important;
    text-decoration: none !important;
  }
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar .fa,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar .icon{ color: #39dbc4 !important; }

  /* --- Force table header show across responsive plugins --- */
  html.wp-dark-mode-active body .entry-content table thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table thead,
  html.wp-dark-mode-active body .entry-content .wp-block-table thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content .wp-block-table thead,
  html.wp-dark-mode-active body .entry-content .tablepress thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content .tablepress thead,
  html.wp-dark-mode-active body .entry-content .dataTable thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content .dataTable thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTables_scrollHead thead{
    display: table-header-group !important;
    visibility: visible !important;
    height: auto !important;
    opacity: 1 !important;
  }

  /* Normalize block/none overrides */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table thead tr,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table thead th{
    display: table-header-group !important;
  }
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table thead tr{ display: table-row !important; }
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table thead th{
    display: table-cell !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 7 !important;
    background: #1a1f24 !important;
    color: #e9eef3 !important;
    border-color: rgba(255,255,255,0.16) !important;
    text-shadow: none !important;
  }

  /* In case of heavy responsive helpers */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table.responsive thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table.sticky-enabled thead,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table.stacktable thead{
    display: table-header-group !important;
  }
}

/* ===== v1.4.20 Mobile Dark: Phone number & row-header column super-visibility ===== */
@media (max-width: 900px){
  /* Phone number inside top bars */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body #top-nav a[href^="tel:"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .top-nav a[href^="tel:"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .header-nav a[href^="tel:"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar a[href^="tel:"],
  body.wp-dark-mode-active #top-nav a[href^="tel:"],
  body.wp-dark-mode-active .top-nav a[href^="tel:"],
  body.wp-dark-mode-active .header-nav a[href^="tel:"],
  body.wp-dark-mode-active .phone-bar a[href^="tel:"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tie-icon-phone,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .fa-phone,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .fas.fa-phone,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .icon-phone{
    color: #39dbc4 !important;
    font-weight: 800 !important;
    text-decoration: none !important;
  }

  /* Ensure the container bar has dark bg & readable fg */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body #top-nav,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .top-nav,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .header-nav,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar{
    background: #141618 !important;
    color: #e9eef3 !important;
    border-color: #2a2d31 !important;
  }

  /* Row-header cells (first column or th in tbody) */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tr > th[scope="row"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tr > td[scope="row"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tr > td:first-child,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress .column-1,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table .has-fixed-layout tr > td:first-child{
    background: #101317 !important;
    color: #e9eef3 !important;
    font-weight: 700 !important;
    border-color: rgba(255,255,255,0.12) !important;
  }

  /* Responsive labels (plugins that show row title via :before or separate spans) */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table td[data-title]::before,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTables_wrapper .dtr-title,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .stacktable .st-key,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .st-key{
    color: #c9d4de !important;
    font-weight: 700 !important;
    background: transparent !important;
    text-shadow: none !important;
  }
}

/* ===== v1.4.21: Scope tightening to avoid menu color side-effects ===== */
@media (max-width: 900px){
  /* Only affect the dedicated phone bar/link, not the global menus */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar{
    background: #141618 !important;
    color: #e9eef3 !important;
    border-color: #2a2d31 !important;
  }
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar a[href^="tel:"],
  body.wp-dark-mode-active .phone-bar a[href^="tel:"]{
    color: #39dbc4 !important;
    font-weight: 800 !important;
    text-decoration: none !important;
  }
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar .fa,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .phone-bar .icon{
    color: #39dbc4 !important;
  }

  /* Keep row-header column highlight (no change) */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tr > th[scope="row"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tr > td[scope="row"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tr > td:first-child,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress .column-1,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table .has-fixed-layout tr > td:first-child{
    background: #101317 !important;
    color: #e9eef3 !important;
    font-weight: 700 !important;
    border-color: rgba(255,255,255,0.12) !important;
  }
}

/* ===== v1.4.22: Light Table Theme in Mobile Dark (white bg, black text) ===== */
@media (max-width: 900px){
  /* Tables in content and common plugins */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content .wp-block-table table,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTables_wrapper table,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable{
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #e5e7eb !important;
  }
  /* Cells */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table td,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table td,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress td,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable td{
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #e5e7eb !important;
    text-shadow: none !important;
  }
  /* Sticky header row (still light) */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable thead th{
    position: sticky !important;
    top: 0 !important;
    z-index: 9 !important;
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
  }
  /* Zebra (optional subtle) */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table tbody tr:nth-child(even) td,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table tbody tr:nth-child(even) td,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress tbody tr:nth-child(even) td,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable tbody tr:nth-child(even) td{
    background: #fafafa !important;
  }
  /* Row-header/first column — override previous dark highlight to light */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable tbody th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tr > th[scope="row"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tr > td[scope="row"],
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table tr > td:first-child,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress .column-1,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table .has-fixed-layout tr > td:first-child{
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #e5e7eb !important;
  }
  /* Links inside tables (accessible teal-ish) */
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table a,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table a,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .tablepress a,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTable a{
    color: #0f766e !important;
  }
}

/* ===== v1.4.23: thead th always light (mobile+dark) + .tmcpt-phone purple in dark ===== */
/* Dark-mode only (any viewport): .tmcpt-phone link turns purple */
:where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body a.tmcpt-phone,
body.wp-dark-mode-active a.tmcpt-phone{
  color:#8b5cf6 !important; /* purple-500 */
  text-decoration:none !important;
}

/* Mobile + Dark: enforce pure white header cells */
@media (max-width: 900px){
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .entry-content table thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .dataTables_scrollHead table thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table.tablepress thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body .wp-block-table thead th,
  :where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) body table thead th{
    background:#ffffff !important;
    background-image:none !important;
    color:#111111 !important;
    border-color:#e5e7eb !important;
    text-shadow:none !important;
  }
}

/* Dark-mode phone link color override (requested): */
:where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) .tmcpt-phone,
:where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) a.tmcpt-phone,
:where(html.dark, html[data-theme="dark"], body.dark, body.dark-mode, .wp-dark-mode-active, [data-wp-dark-mode-active]) a[href^="tel:"].tmcpt-phone{
  color:#8b5cf6 !important; /* purple */
  text-decoration:none !important;
}


/* Safety guard: when dark mode is NOT active, make sure first column is NOT forced dark */
html:not(.wp-dark-mode-active) body .tablepress .column-1,
html:not(.wp-dark-mode-active) body .wp-block-table .has-fixed-layout tr > td:first-child,
html:not(.wp-dark-mode-active) body table tr > td:first-child,
html:not(.wp-dark-mode-active) body table tr > td[scope="row"],
html:not(.wp-dark-mode-active) body table tr > th[scope="row"]{
  background: initial !important;
  color: inherit !important;
  border-color: inherit !important;
}

/* v1.4.25: Mobile dark - .tmcpt-phone purple */
@media (max-width: 900px){
  :where(html[class*="dark"], html.wp-dark-mode-active, body.dark, body.dark-mode, [data-theme="dark"], [data-wp-dark-mode-active]) a.tmcpt-phone{
    color:#8b5cf6 !important;
    -webkit-text-fill-color:#8b5cf6 !important;
    text-decoration:none !important;
    font-weight:800 !important;
  }
}