/* Only the server-selected phone shell changes; desktop styles are untouched. */
.sg-mobile-plant-filter-native { display: none !important; }
.sg-mobile-filters-toggle { display: none !important; }
.sg-mobile-nav-toggle,
.sg-mobile-nav-close,
.sg-mobile-nav-backdrop { display: none; }
.sg-mobile-filters-panel { display: contents; }
.sg-mobile .sg-global-actions-row,
.sg-mobile .sg-sidebar-header,
.sg-mobile #app-version { display: none; }
.sg-mobile .sg-shell-body {
    position: relative;
    inset: auto;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100vw;
    min-height: 0;
    overflow: hidden;
}
.sg-mobile.sg-app-shell {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 100vw;
    min-height: 0;
    overflow: hidden;
}
.sg-mobile .sg-header-navbar {
    position: relative;
    top: auto;
    z-index: 1000;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    box-sizing: border-box;
}
.sg-mobile #sidebar-container {
    position: fixed !important;
    inset: 0 auto 0 0;
    z-index: 50002;
    width: min(78vw, 300px);
    min-width: 0;
    max-width: 300px;
    height: 100dvh;
    max-height: 100dvh;
    flex: 0 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 180ms ease-out;
    background: #f7f8ef;
    box-shadow: 3px 0 18px rgba(13, 32, 24, 0.2);
    border-right: 1px solid #cbd6cd;
}
.sg-mobile #sidebar-container.mobile-open {
    transform: translateX(0);
}
.sg-mobile .sg-sidebar-header {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    height: 56px;
    padding: 8px 12px;
    border-bottom: 1px solid #d8e0d9;
}
.sg-mobile .sg-sidebar-header #sidebar-toggle,
.sg-mobile .sg-sidebar-header hr {
    display: none !important;
}
.sg-mobile .sg-mobile-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #d9e2dc;
    border-radius: 10px;
    color: #244b36;
    background: #fff;
}
.sg-mobile .sg-mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50001;
    width: 100vw;
    height: 100dvh;
    padding: 0;
    border: 0;
    background: rgba(14, 24, 19, 0.42);
}
.sg-mobile .sg-mobile-nav-backdrop[style*="display: block"] {
    display: block !important;
}
.sg-mobile .sg-sidebar-nav {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
    padding: 8px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    white-space: normal;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
}
.sg-mobile #sidebar-nav > a {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    min-height: 52px;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    white-space: normal;
}
.sg-mobile #sidebar-nav > a span:last-child {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.25;
}
.sg-mobile .sg-sidebar-nav a {
    flex: 0 0 auto;
    gap: 0.4rem;
    font-size: 0.95rem;
}
.sg-mobile .sg-sidebar-nav .sg-sidebar-icon { width: 24px; height: 24px; }
.sg-mobile .sg-mobile-nav-toggle {
    display: inline-flex !important;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #d8e2dc;
    border-radius: 10px;
    color: #244b36;
    background: #fff;
    margin-left: 0;
}
.sg-mobile .sg-mobile-nav-toggle .bi { font-size: 1.25rem; }
.sg-mobile .sg-header-navbar { padding: 0.1rem 0; }
.sg-mobile .sg-header-navbar .container-fluid {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 0.3rem;
    padding: 0.25rem 0.45rem !important;
}
.sg-mobile .sg-header-navbar .container-fluid > .d-flex.align-items-center {
    flex: 1 1 0;
    min-width: 0;
}
.sg-mobile .sg-header-navbar .container-fluid > .d-flex.align-items-center > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}
.sg-mobile .sg-header-navbar .container-fluid > .d-flex.align-items-center > div:first-child > div {
    min-width: 0;
    overflow: hidden;
}
.sg-mobile .sg-header-navbar .container-fluid > .d-flex.align-items-center > div:last-child {
    display: none !important;
}
.sg-mobile .sg-header-navbar .sg-logo { width: 32px; height: 32px; margin-right: 0.25rem !important; object-fit: contain; flex: 0 0 32px; }
.sg-mobile .sg-company-name {
    display: block;
    max-width: clamp(76px, 25vw, 112px);
    overflow: hidden;
    font-size: clamp(0.95rem, 4.6vw, 1.15rem);
    line-height: 1.1;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.sg-mobile .sg-global-actions-row {
    position: relative;
    display: flex;
    order: 2;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    gap: 0.25rem;
    padding: 0;
}
.sg-mobile .sg-mobile-filters-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #d6e1da;
    border-radius: 10px;
    color: #176b50;
    background: #fff;
    font-size: 1.1rem;
}
.sg-mobile .sg-mobile-filters-panel {
    display: none;
    position: absolute;
    z-index: 20000;
    top: calc(100% + 8px);
    right: 0;
    width: min(94vw, 420px);
    padding: 12px;
    border: 1px solid #d6e1da;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(20, 45, 33, 0.22);
    gap: 8px;
}
.sg-mobile .sg-mobile-filters-panel[style*="display: grid"] { display: grid !important; }
.sg-mobile .sg-global-actions-row .sg-mobile-essential-filter {
    grid-template-columns: 92px minmax(0, 1fr);
}
.sg-mobile .sg-global-actions-row .sg-mobile-secondary-filter { display: none; }
.sg-mobile .sg-mobile-filters-panel .sg-global-filter-control {
    background-color: #f8faf9;
}
.sg-mobile .sg-global-actions-row .sg-mobile-essential-filter {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.sg-mobile .sg-global-actions-row .sg-mobile-secondary-filter { display: none; }
.sg-mobile .sg-global-actions-row .sg-global-filter-label {
    white-space: normal;
    font-size: 0.75rem;
    line-height: 1.2;
}
.sg-mobile .sg-global-actions-row .sg-global-filter-control {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    height: auto;
    padding: 4px 8px;
    border-radius: 10px;
}
.sg-mobile .sg-global-actions-row .sg-global-filter-trigger { flex: 0 0 32px; min-height: 34px; }
.sg-mobile .sg-global-actions-row .sg-global-filter-control .sg-plant-filter-dropdown {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown,
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown .Select,
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown .dash-dropdown,
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown .Select-control {
    box-sizing: border-box;
    flex: 1 1 0;
    width: 100% !important;
    min-width: 0 !important;
}
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown .Select-control,
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown .dash-dropdown .Select-control {
    min-width: 0;
    width: 100%;
}
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown .Select-menu-outer {
    left: 0;
    right: 0;
    z-index: 30001;
    width: 100% !important;
    min-width: 100% !important;
    max-width: calc(100vw - 130px);
}
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown .Select-menu {
    max-height: 45vh;
    overflow-y: auto;
}
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown .VirtualizedSelectOption,
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown .VirtualizedSelectFocusedOption {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}
.sg-mobile .sg-global-actions-row .sg-plant-filter-dropdown { display: none !important; }
.sg-mobile .sg-global-actions-row .sg-mobile-plant-filter-native {
    display: block !important;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    border: 0;
    box-shadow: none;
    background-color: transparent;
}
.sg-mobile .sg-global-actions-row .sg-global-filter-value {
    overflow-wrap: anywhere;
    white-space: normal;
    font-size: 0.78rem;
    line-height: 1.2;
}
.sg-mobile .sg-mobile-filters-toggle { display: inline-flex !important; }
.sg-mobile .sg-mobile-filters-panel {
    display: none;
    position: absolute;
    z-index: 20000;
    top: calc(100% + 8px);
    right: 0;
    width: min(94vw, 420px);
    padding: 12px;
    border: 1px solid #d6e1da;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(20, 45, 33, 0.22);
    gap: 8px;
}
.sg-mobile .sg-mobile-filters-panel[style*="display: grid"] { display: grid !important; }
.sg-mobile #user-menu { flex: 0 0 auto; padding-right: 0 !important; }
.sg-mobile #user-menu .dropdown-toggle {
    max-width: clamp(88px, 27vw, 112px);
    min-height: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 0.45rem;
    font-size: 0.82rem;
}
.sg-mobile .sg-company-tagline { display: none; }
.sg-mobile .sg-main-content {
    display: block;
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}
.sg-mobile #page-content {
    display: block;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow: visible;
}
.sg-mobile .ps-mobile-layout { padding: 8px 8px 72px !important; max-height: none !important; }
.sg-mobile .ps-mobile-layout .row {
    width: 100%;
    margin-inline: 0 !important;
    --bs-gutter-x: 0.5rem;
}
.sg-mobile .ps-mobile-layout,
.sg-mobile .ps-mobile-layout .row,
.sg-mobile .ps-mobile-layout .row > *,
.sg-mobile .ps-mobile-layout .col,
.sg-mobile .ps-mobile-layout .ps-farm-card,
.sg-mobile .ps-mobile-layout .ps-farm-chart,
.sg-mobile .ps-mobile-layout .ps-farm-card > .card-body,
.sg-mobile .ps-mobile-layout .dash-graph,
.sg-mobile .ps-mobile-layout .js-plotly-plot,
.sg-mobile .ps-mobile-layout .plot-container,
.sg-mobile .ps-mobile-layout .svg-container {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}
.sg-mobile .ps-mobile-layout { width: 100%; }
.sg-mobile .ps-mobile-layout .ps-farm-chart,
.sg-mobile .ps-mobile-layout .dash-graph,
.sg-mobile .ps-mobile-layout .js-plotly-plot,
.sg-mobile .ps-mobile-layout .plot-container,
.sg-mobile .ps-mobile-layout .svg-container { width: 100% !important; }
.sg-mobile .ps-mobile-layout .ps-customer-toolbar { align-items: stretch !important; }
.sg-mobile .ps-mobile-layout .ps-customer-toolbar > div { width: 100%; }
.sg-mobile .ps-mobile-layout .ps-customer-toolbar .Select-control { min-height: 44px; }
.sg-mobile .ps-mobile-layout .ps-farm-card { border-radius: 12px; overflow: hidden; }
.sg-mobile .ps-mobile-layout .ps-farm-header { padding: 12px; }
.sg-mobile .ps-mobile-layout .ps-farm-header > div { align-items: flex-start !important; gap: 8px; }
.sg-mobile .ps-mobile-layout .ps-farm-header > div > div:first-child { min-width: 100%; }
.sg-mobile .ps-mobile-layout .ps-farm-header [id] { margin-left: 0 !important; min-height: 44px; }
.sg-mobile .ps-mobile-layout .ps-farm-card > .card-body { padding: 4px 8px 10px; }
.sg-mobile .ps-mobile-layout .ps-farm-chart { width: 100%; }
.sg-mobile .ps-mobile-layout .ps-unit-card { margin-bottom: 8px; }
.sg-mobile .ps-mobile-layout .ps-info-table { table-layout: auto !important; }
.sg-mobile .ps-mobile-layout .ps-info-table td { white-space: normal !important; overflow-wrap: anywhere; }
.sg-mobile .ps-mobile-layout .ps-info-table td:nth-child(2) { width: 35% !important; }
.sg-mobile .ps-mobile-layout .ps-info-table td:nth-child(3) { width: auto; }
.sg-mobile .ps-modal { max-width: calc(100vw - 20px); margin: 10px auto; }
.sg-mobile .ps-modal .modal-body { overflow-x: auto; }
.sg-mobile .irrigation-tracker-mobile {
    display: block;
    height: auto;
    min-height: 100%;
    overflow: visible;
    padding-bottom: 20px;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-navbar {
    position: static !important;
    padding: 8px 10px;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-controls {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 7px;
}
.sg-mobile .irrigation-tracker-mobile .agro-toolbar-section {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
}
.sg-mobile .irrigation-tracker-mobile .agro-toolbar-section-label {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.2;
}
.sg-mobile .irrigation-tracker-mobile .agro-toolbar-section .form-select {
    width: 100% !important;
    min-width: 0;
    min-height: 40px;
    font-size: 0.88rem;
}
.sg-mobile .irrigation-tracker-mobile .agro-toolbar-pill {
    max-width: 100%;
    min-width: 0;
    padding: 0.35rem 0.5rem;
}
.sg-mobile .irrigation-tracker-mobile .agro-toolbar-pill .form-check-inline {
    margin: 0.15rem 0.6rem 0.15rem 0;
}
.sg-mobile .irrigation-tracker-mobile #irrigation-tracker-export-csv { display: none !important; }
.sg-mobile .irrigation-tracker-mobile .sg-page-content-no-data {
    margin: 0 8px;
    padding: 14px;
    border: 1px solid var(--sg-border, #dce7df);
    border-radius: 10px;
    background: #fff;
    font-size: 0.95rem;
}

/* Plant-unit modal is rendered in a portal, so scope this small-screen fix by ID. */
@media (max-width: 600px) {
    /* Dash can portal Select menus outside the filter row, so size them globally. */
    .Select-menu-outer {
        z-index: 30001 !important;
        width: min(58vw, 240px) !important;
        min-width: min(58vw, 240px) !important;
        max-width: calc(100vw - 140px) !important;
        overflow-x: hidden;
    }
    .Select-menu { max-height: 45vh; overflow-y: auto; }
    .VirtualizedSelectOption,
    .VirtualizedSelectFocusedOption {
        white-space: normal !important;
        overflow-wrap: anywhere;
        line-height: 1.25;
    }
    #global-time-filter-selected-range-label:empty::before { content: "1W"; }
    #generic-modal-plant-unit-filter .modal-dialog,
    #generic-modal-plant-unit-filter.modal-dialog,
    #generic-modal-time-frame-filter .modal-dialog,
    #generic-modal-time-frame-filter.modal-dialog {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        margin: 12px auto !important;
    }
    #generic-modal-irrigation-tracker-plant-unit-selection .modal-dialog {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        margin: 12px auto !important;
    }
    #generic-modal-irrigation-tracker-plant-unit-selection.modal-dialog {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        margin: 12px auto !important;
    }
    #generic-modal-irrigation-tracker-plant-unit-selection .modal-content {
        max-height: calc(100dvh - 24px);
        overflow: hidden;
    }
    #generic-modal-irrigation-tracker-plant-unit-selection .modal-header {
        align-items: center;
        padding: 12px;
    }
    #generic-modal-irrigation-tracker-plant-unit-selection .modal-body {
        min-width: 0;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 12px;
    }
    #generic-modal-irrigation-tracker-plant-unit-selection #irrigation-tracker-plant-unit-selection-checklist label {
        width: 100%;
        min-width: 0;
        align-items: flex-start !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
        line-height: 1.35;
        padding: 6px 0;
    }
    #generic-modal-irrigation-tracker-plant-unit-selection #irrigation-tracker-plant-unit-selection-checklist label > span {
        min-width: 0;
        max-width: 100%;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
    #generic-modal-irrigation-tracker-plant-unit-selection #irrigation-tracker-plant-unit-selection-checklist input {
        flex: 0 0 auto;
        margin: 3px 8px 0 2px !important;
    }
    #generic-modal-irrigation-tracker-plant-unit-selection .modal-footer {
        gap: 8px;
        padding: 12px;
    }
}
.sg-mobile .irrigation-tracker-mobile #irrigation-tracker-total-irrigation-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 8px;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-body {
    height: auto;
    overflow: visible;
    padding: 0 6px 14px !important;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-graphs-stack { height: auto; overflow: visible; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-graph-wrap,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-compare-card { margin-bottom: 8px; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-graph-wrap .js-plotly-plot,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-compare-card .js-plotly-plot { width: 100%; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-graph-wrap {
    flex: 0 0 auto;
    min-height: 250px;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-graph-wrap .js-plotly-plot,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-graph-wrap .plot-container,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-graph-wrap .svg-container {
    height: 100% !important;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-mobile-row,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-col {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto !important;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-div {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 330px;
    margin: 0;
    align-items: stretch;
    justify-content: flex-start;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-head {
    min-height: 48px;
    height: auto;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
    font-size: 0.9rem !important;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-statistics {
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
    padding: 8px;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-statistics-item {
    width: auto;
    min-width: 0;
    min-height: 56px;
    height: auto;
    margin: 0;
    gap: 2px;
    padding: 6px !important;
    text-align: center;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-statistics-item-title {
    font-size: 0.65rem !important;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-statistics-item-value {
    font-size: 0.95rem !important;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-hist-title {
    min-height: 28px;
    height: auto;
    padding: 4px 8px;
    font-size: 0.7rem !important;
    text-align: center;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-hist {
    height: 220px;
    min-height: 220px;
    flex: 0 0 220px;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-hist .js-plotly-plot,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-hist .plot-container,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-statistics-unit-hist .svg-container {
    height: 100% !important;
    width: 100% !important;
}

/* Irrigation recommendations: keep controls and unit plans usable on phones. */
.sg-mobile .irrigation-recommendation-mobile {
    height: auto !important;
    min-height: 100dvh;
    overflow: visible !important;
    padding-bottom: 16px !important;
}
.sg-mobile .irrigation-recommendation-mobile .irrigation-recommendation-header {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
    padding: 6px 8px !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-header-row {
    height: auto !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-header-row > .ir-header-col {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-header-row > .ir-info-col,
.sg-mobile .irrigation-recommendation-mobile .ir-header-row > .ir-operations-col {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-header-row > .ir-operations-col {
    order: -1;
}
.sg-mobile .irrigation-recommendation-mobile .ir-chart-card {
    height: 190px !important;
    min-height: 190px;
}
.sg-mobile .irrigation-recommendation-mobile .ir-info-card,
.sg-mobile .irrigation-recommendation-mobile .ir-operations-card {
    height: auto !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-operations-card .ir-operations-stack {
    min-height: 0;
    gap: 8px !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-operations-card .ir-days-group {
    margin-top: 0;
    padding-bottom: 8px;
}
.sg-mobile .irrigation-recommendation-mobile #irrigation-recommendation-export-btn {
    display: none !important;
}
.sg-mobile .irrigation-recommendation-mobile .irrigation-recommendation-plant-units-body {
    height: auto !important;
    flex: 0 0 auto;
    overflow: visible !important;
    padding: 4px 6px 12px !important;
}
.sg-mobile .irrigation-recommendation-mobile .irrigation-recommendation-plant-units-body > .row {
    height: auto !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-card {
    height: 390px !important;
    min-height: 390px;
    margin-bottom: 10px;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-header .ir-unit-identity {
    flex-basis: 100%;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-header .ir-unit-plan-actions {
    width: 100%;
    justify-content: flex-end;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-card .modebar {
    display: none !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-card .ir-day-card {
    min-width: min(82vw, 320px);
}
.sg-mobile .irrigation-recommendation-mobile .ir-overview-card {
    height: auto !important;
    min-height: 0;
}
.sg-mobile .irrigation-recommendation-mobile .ir-overview-body {
    flex: 0 0 auto !important;
    min-height: 0;
}
.sg-mobile .irrigation-recommendation-mobile .ir-overview-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: thin;
}
.sg-mobile .irrigation-recommendation-mobile .ir-overview-scroll > .dash-graph {
    flex: 0 0 auto;
}
.sg-mobile .irrigation-recommendation-mobile .ir-overview-card .modebar {
    display: none !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-card {
    height: 380px !important;
    min-height: 380px;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-card .ir-unit-header {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 5px;
    min-height: 0;
    padding: 6px 8px !important;
    line-height: 1.25;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-header .ir-unit-identity {
    display: grid !important;
    grid-template-columns: 22px 10px minmax(0, 1fr) 30px 30px;
    align-items: center;
    gap: 4px;
    flex: 1 1 100%;
    min-width: 0;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-header .ir-unit-identity > img {
    width: 22px;
    height: 22px;
    margin: 0 !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-description-wrap {
    min-width: 0;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-name {
    font-size: 15px !important;
    line-height: 1.2;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-location,
.sg-mobile .irrigation-recommendation-mobile .ir-unit-metadata {
    font-size: 10px !important;
    line-height: 1.2;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-header .ir-unit-action {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-header .ir-unit-plan-actions {
    width: 100%;
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 6px;
    margin: 0;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-card > .card-body {
    min-height: 0;
    overflow: hidden;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-card > .card-body > div {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: thin;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-card > .card-body > div > .row {
    width: max-content;
    min-width: 100%;
    flex-wrap: nowrap !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-card > .card-body > div > .row > * {
    width: 84vw !important;
    max-width: 84vw !important;
    min-width: 84vw !important;
    flex: 0 0 84vw !important;
    height: 100% !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-card .ir-day-card {
    width: 100%;
    min-width: 0;
    height: 100%;
}

/* Agro Insights mobile layout. */
.sg-mobile .agro-insights-navbar {
    position: static !important;
    padding: 4px 8px;
}
.sg-mobile .agro-insights-navbar .agro-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
    gap: 6px;
    padding: 0;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-section {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    gap: 6px;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-section-label {
    font-size: 0.72rem;
    line-height: 1.2;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-pill {
    min-width: 0;
    padding: 5px 7px;
}
.sg-mobile .agro-insights-navbar .agro-show-checklist,
.sg-mobile .agro-insights-navbar .agro-toolbar-switch-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 9px;
}
.sg-mobile .agro-insights-navbar .agro-show-checklist .form-check,
.sg-mobile .agro-insights-navbar .agro-toolbar-checklist .form-check {
    margin: 0;
    min-height: 32px;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-dropdown,
.sg-mobile .agro-insights-navbar .agro-toolbar-dropdown .Select-control {
    width: 100%;
    min-width: 0;
}
.sg-mobile .agro-insights-navbar #agro-bar-width-multiplier {
    width: 100% !important;
    min-height: 36px;
}
.sg-mobile .agro-insights-navbar .agro-action-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.sg-mobile .agro-insights-navbar #agro-export-btn {
    display: none !important;
}
.sg-mobile .agro-body {
    height: auto !important;
    min-height: 0;
    padding: 6px 6px 16px !important;
}
.sg-mobile .agro-graphs-stack {
    height: auto !important;
    min-height: 0;
    overflow: visible !important;
    gap: 10px;
}
.sg-mobile .agro-graph-wrap {
    width: 100%;
    height: 55dvh;
    min-height: 340px;
    max-height: 520px;
    flex: 0 0 auto !important;
}
.sg-mobile .agro-graph-wrap.agro-expanded-view {
    height: 65dvh;
    min-height: 380px;
    max-height: 620px;
    flex-basis: auto !important;
}
.sg-mobile .agro-graph-wrap > .dash-graph,
.sg-mobile .agro-graph-wrap .js-plotly-plot,
.sg-mobile .agro-graph-wrap .plot-container,
.sg-mobile .agro-graph-wrap .svg-container {
    width: 100% !important;
    height: 100% !important;
}
.sg-mobile .agro-graph-wrap .agro-view-controls {
    top: 5px;
    right: 6px;
    max-width: calc(100% - 16px);
}

/* Monitor Viewer mobile layout: swipe through tabs and wide tables. */
.sg-mobile .monitor-viewer-page {
    width: 100%;
    min-width: 0;
    padding: 8px 6px 16px !important;
    overflow-x: hidden;
}
.sg-mobile .monitor-viewer-page .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}
.sg-mobile .monitor-viewer-page .nav-tabs .nav-item {
    flex: 0 0 auto;
}
.sg-mobile .monitor-viewer-page .nav-tabs .nav-link {
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    font-size: 0.82rem;
}
.sg-mobile .monitor-viewer-page .monitor-quick-controls {
    flex-wrap: wrap;
    align-items: stretch !important;
    padding: 8px !important;
    gap: 8px !important;
}
.sg-mobile .monitor-viewer-page .monitor-counts {
    flex: 1 1 100%;
    gap: 6px !important;
}
.sg-mobile .monitor-viewer-page .monitor-count-button {
    min-height: 40px;
    padding: 6px 8px !important;
    font-size: 0.78rem !important;
}
.sg-mobile .monitor-viewer-page .monitor-issues-switch {
    min-height: 40px;
}
.sg-mobile .monitor-viewer-page :is(#controllers-table, #measurements-table, #algorithm-results-table) {
    width: 100%;
    max-width: 100%;
    height: auto !important;
    max-height: 58vh !important;
    min-height: 220px !important;
    overflow: auto !important;
}
.sg-mobile .monitor-viewer-page :is(#controllers-table, #measurements-table, #algorithm-results-table) .dash-spreadsheet-container {
    max-height: 58vh !important;
    overflow: auto !important;
}
.sg-mobile .monitor-viewer-page .dash-table-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.sg-mobile .monitor-viewer-page .dash-table-container .dash-spreadsheet-inner td,
.sg-mobile .monitor-viewer-page .dash-table-container .dash-spreadsheet-inner th {
    font-size: 0.76rem !important;
    padding: 6px 7px !important;
}
.sg-mobile .monitor-viewer-page .card-body {
    min-width: 0;
    padding: 0.65rem;
}
.sg-mobile .monitor-viewer-page .row {
    min-width: 0;
}
.sg-mobile .monitor-viewer-page .js-plotly-plot,
.sg-mobile .monitor-viewer-page .dash-graph {
    max-width: 100%;
}
