/* 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-alerts-toggle { display: none !important; }
.sg-mobile-statistics-toggle { display: none !important; }
.sg-mobile-nav-toggle,
.sg-mobile-alerts-toggle,
.sg-mobile-statistics-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; }
.mobile-app-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(25, 42, 33, 0.28);
    color: #294735;
    font: 600 15px/1.2 "Segoe UI", Arial, sans-serif;
    pointer-events: all;
}
body:has(.sg-app-shell.sg-mobile):has(#page-content[data-dash-is-loading="true"]) #mobile-app-loading-overlay,
body:has(.sg-app-shell.sg-mobile):has([id^="generic-modal-"][data-dash-is-loading="true"]) #mobile-app-loading-overlay {
    display: flex;
}
@media (max-width: 767px), (pointer: coarse) and (max-height: 600px) {
    body:has(#page-content[data-dash-is-loading="true"]) #mobile-app-loading-overlay,
    body:has([id^="generic-modal-"][data-dash-is-loading="true"]) #mobile-app-loading-overlay {
        display: flex;
    }
    body:has(#page-content[data-dash-is-loading="true"]) .loading-spinner { visibility: hidden; }
}
.mobile-app-loading-overlay > span:last-child {
    padding: 13px 17px;
    border: 1px solid #d7e1da;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(25, 42, 33, 0.18);
}
.mobile-app-loading-spinner {
    width: 27px;
    height: 27px;
    border: 3px solid #cfe0d5;
    border-top-color: #23834a;
    border-radius: 50%;
    animation: mobile-app-loading-spin 0.75s linear infinite;
}
@keyframes mobile-app-loading-spin { to { transform: rotate(360deg); } }
body:has(.sg-app-shell.sg-mobile) #generic-modal-statistics .sg-statistics-config-disclosure {
    display: block;
    max-height: 58dvh;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid #d7e1da;
    border-radius: 10px;
    background: #f8fafc;
}
body:has(.sg-app-shell.sg-mobile) #statistics-view {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}
body:has(.sg-app-shell.sg-mobile) #statistics-view .sg-statistics-config-disclosure[open] {
    flex: 0 0 auto;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
}
body:has(.sg-app-shell.sg-mobile) #statistics-view:has(.sg-statistics-config-disclosure[open]) {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}
body:has(.sg-app-shell.sg-mobile) #statistics-view .sg-statistics-config-disclosure[open] + .sg-statistics-graph-card {
    display: none;
}
body:has(.sg-app-shell.sg-mobile) #statistics-view .sg-statistics-graph-card {
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    max-height: 100%;
    overflow: hidden !important;
}
/* The graph result and dcc.Graph have inline minimum heights for desktop.
   Let them shrink into the mobile modal's bounded graph area. */
body:has(.sg-app-shell.sg-mobile) #generic-modal-statistics .sg-statistics-graph-result {
    flex: 1 1 0 !important;
    height: 100%;
    min-height: 0 !important;
    overflow: hidden;
}
body:has(.sg-app-shell.sg-mobile) #generic-modal-statistics #statistics-graph {
    flex: 1 1 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100%;
}
body:has(.sg-app-shell.sg-mobile) #generic-modal-statistics .sg-statistics-is-expanded .sg-statistics-graph-card {
    flex: 1 1 0;
    height: 0 !important;
    min-height: 0;
}
body:has(.sg-app-shell.sg-mobile) #generic-modal-statistics .sg-statistics-config-summary {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 8px 12px;
    background: #edf5ef;
    color: #294735;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
body:has(.sg-app-shell.sg-mobile) #generic-modal-statistics .sg-statistics-config-summary::-webkit-details-marker { display: none; }
body:has(.sg-app-shell.sg-mobile) #generic-modal-statistics .sg-statistics-config-summary::after { content: "+"; font-size: 1.2rem; }
body:has(.sg-app-shell.sg-mobile) #generic-modal-statistics .sg-statistics-config-disclosure[open] .sg-statistics-config-summary::after { content: "−"; }
body:has(.sg-app-shell.sg-mobile) #generic-modal-statistics .sg-statistics-controls {
    padding: 0.65rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
body:has(.sg-app-shell.sg-mobile) #generic-modal-statistics .sg-statistics-controls-heading { 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;
}

/* Report exports stay available on desktop and are hidden on mobile in both orientations. */
.sg-mobile .agro-activities-page #activity-reports-export-btn,
.sg-mobile .agro-activities-page #agro-reports-export-btn {
    display: none !important;
}
.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-alerts-toggle,
.sg-mobile .sg-mobile-statistics-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-alerts-toggle .sg-icon { width: 22px; height: 22px; }
.sg-mobile .sg-mobile-statistics-toggle .bi { font-size: 1.2rem; }
.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-current-page { display: none !important; }
.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%; }
/* Customer filter: a single compact row (label + dropdown) instead of a tall stacked card. */
.sg-mobile .ps-mobile-layout .ps-customer-toolbar {
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px;
    margin: 0 0 6px !important;
    padding: 0 2px !important;
}
.sg-mobile .ps-mobile-layout .ps-customer-toolbar > [class*="col"] {
    width: auto;
    max-width: none;
    padding: 0;
}
.sg-mobile .ps-mobile-layout .ps-customer-toolbar > :last-child {
    flex: 1 1 0;
    min-width: 0;
}
.sg-mobile .ps-mobile-layout .ps-customer-toolbar label {
    margin: 0 !important;
    font-size: 0.8rem;
    white-space: nowrap;
}
.sg-mobile .ps-mobile-layout .ps-customer-toolbar #plot-status-customer-filter {
    min-width: 0 !important;
}
.sg-mobile .ps-mobile-layout .ps-customer-toolbar .Select-control {
    min-height: 36px;
    height: 36px;
}
.sg-mobile .ps-mobile-layout .ps-customer-toolbar :is(.Select-value, .Select-placeholder, .Select-input) {
    line-height: 34px;
    height: 34px;
}
.sg-mobile .ps-mobile-layout .ps-customer-toolbar .Select-value-label {
    font-size: 0.9rem;
}
.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: center !important; flex-wrap: nowrap; gap: 8px; }
.sg-mobile .ps-mobile-layout :is(.ps-farm-header, .ps-unit-header) > div > div:first-child {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
}
.sg-mobile .ps-mobile-layout :is(.ps-farm-name, .ps-unit-name) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.sg-mobile .ps-mobile-layout :is(.ps-farm-header, .ps-unit-header) > div > div:last-child {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
}
.sg-mobile .ps-mobile-layout .ps-unit-header > div { flex-wrap: nowrap; gap: 6px; }
.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; }

/* In phone landscape, let every farm card use the full row so its plots have room. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1200px) and (pointer: coarse) {
    .sg-mobile .ps-mobile-layout #plot-status-farm-grid > .row > [class*="col-"] {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

.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;
}

/* Tracker filters: consistent left labels, aligned 42px controls and balanced columns. */
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-unit-type-row {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-unit-type-row > .agro-toolbar-section {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    width: auto;
    min-width: 0;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #d7e1da;
    border-radius: 9px;
    background: #fff;
}
.sg-mobile .irrigation-tracker-mobile .agro-toolbar-section-label {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.2;
    text-align: left;
    justify-self: start;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-unit-type-row .agro-toolbar-section-label {
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-plant-units-section .sg-btns {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    justify-self: end;
    padding: 0 !important;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-type-section .agro-toolbar-pill,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-type-section .form-select {
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0;
    text-align: left;
}
.sg-mobile .irrigation-tracker-mobile .agro-toolbar-section .form-select,
.sg-mobile .irrigation-tracker-mobile .agro-toolbar-section .form-check-label {
    text-align: left;
}

/* Plant-unit modal is rendered in a portal, so scope this small-screen fix by ID. */
 .sg-mobile .agro-activities-body .activity-diary-excel-actions {
    display: none !important;
}

@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: grid !important;
    direction: ltr;
    grid-template-columns: 20px 15px minmax(0, 1fr) 32px 32px 32px;
    grid-template-rows: auto auto 32px;
    align-items: center !important;
    column-gap: 6px;
    row-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: contents !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-header .ir-unit-identity > img {
    width: 22px;
    height: 22px;
    margin: 0 !important;
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-header .ir-unit-identity > div:not(.ir-unit-description-wrap) {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-description-wrap {
    min-width: 0;
    grid-column: 3 / 7;
    grid-row: 1 / 3;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-description {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 6px;
    row-gap: 4px;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-description .ir-unit-name {
    grid-column: 1;
    grid-row: 1;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-description .ir-unit-location {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-description .ir-unit-metadata {
    grid-column: 1 / 3;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.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: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-header .ir-unit-plan-actions {
    display: contents !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-plan-actions > .form-check {
    display: contents !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-plan-actions > .form-check .form-check-input {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    align-self: center;
    flex: 0 0 auto;
    margin: 0 !important;
    float: none;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-plan-actions > .form-check .form-check-label {
    grid-column: 2 / 4;
    grid-row: 3;
    justify-self: start;
    align-self: center;
    min-width: 0;
    margin: 0 !important;
    line-height: 1.2;
    text-align: start;
    white-space: nowrap;
    font-size: 11px;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-plan-actions > .ir-unit-action {
    grid-column: 6;
    grid-row: 3;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-identity > .ir-unit-action:nth-of-type(1) {
    grid-column: 4;
    grid-row: 3;
}
.sg-mobile .irrigation-recommendation-mobile .ir-unit-identity > .ir-unit-action:nth-of-type(2) {
    grid-column: 5;
    grid-row: 3;
}
.sg-mobile:dir(rtl) .irrigation-recommendation-mobile .ir-unit-description-wrap,
.sg-mobile:dir(rtl) .irrigation-recommendation-mobile .ir-unit-plan-actions > .form-check .form-check-label {
    direction: rtl;
}
.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;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px 5px;
    border: 1px solid #d9e4dd;
    border-radius: 0 0 14px 14px;
    background: #f2f7f4 !important;
    box-shadow: 0 2px 8px rgba(28, 58, 40, 0.08);
}
.sg-mobile .agro-insights-navbar .agro-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    width: 100%;
    min-width: 0;
    gap: 8px 10px;
    padding: 4px 0;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-divider { display: none; }
.sg-mobile .agro-insights-navbar .agro-show-section,
.sg-mobile .agro-insights-navbar .agro-options-section,
.sg-mobile .agro-insights-navbar .agro-hover-width-row {
    grid-column: 1 / -1;
}
.sg-mobile .agro-insights-navbar .agro-actions-section {
    grid-column: 1;
    align-self: stretch;
}
.sg-mobile .agro-insights-navbar .agro-irrigation-toggle {
    grid-column: 2;
    align-self: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 8px;
    border: 1px solid #d7e1da;
    border-radius: 10px;
    background: #fff;
    color: #405b4b;
    font-size: 0.82rem;
    white-space: nowrap;
    box-sizing: border-box;
}
.sg-mobile .agro-insights-navbar .agro-hover-width-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
}
.sg-mobile .agro-insights-navbar .agro-hover-width-row > .agro-toolbar-section {
    width: 100%;
    min-width: 0;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-section {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    width: 100%;
    min-width: 0;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-section-label {
    margin: 0;
    padding-inline: 2px;
    color: #456653;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-section > .agro-toolbar-pill,
.sg-mobile .agro-insights-navbar .agro-toolbar-section > .agro-action-btn-group {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-pill {
    height: auto;
    min-height: 44px;
    padding: 7px 10px;
    border: 1px solid #d5e0d9;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(25, 65, 40, 0.04);
}
.sg-mobile .agro-insights-navbar .agro-show-checklist {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: center;
    grid-auto-flow: row;
    grid-auto-rows: minmax(36px, auto);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 3px 8px;
}
.sg-mobile .agro-insights-navbar .agro-show-checklist > .form-check:nth-child(-n+3) { grid-row: 1; }
.sg-mobile .agro-insights-navbar .agro-show-checklist > .form-check:nth-child(n+4) { grid-row: 2; }
.sg-mobile .agro-insights-navbar .agro-toolbar-switch-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 2px 10px;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-checklist .form-check,
.sg-mobile .agro-insights-navbar .agro-show-checklist .form-check {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 32px;
    margin: 0;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-checklist .form-check-label,
.sg-mobile .agro-insights-navbar .agro-show-checklist .form-check-label {
    min-width: 0;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-checklist .form-check-input,
.sg-mobile .agro-insights-navbar .agro-show-checklist .form-check-input {
    flex: 0 0 auto;
    margin: 0 6px 0 0;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-hover-pill {
    padding: 0 4px;
    overflow: visible;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-hover-pill .agro-toolbar-dropdown,
.sg-mobile .agro-insights-navbar .agro-toolbar-hover-pill .Select {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-hover-pill .Select-control {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    box-sizing: border-box;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-hover-pill .Select-value {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 6px;
    right: 30px;
    display: flex;
    align-items: center;
    width: auto;
    height: auto;
    padding: 0;
    line-height: 1.2;
    white-space: normal;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-hover-pill .Select-value-label {
    display: block;
    overflow: visible;
    line-height: 1.2;
    white-space: normal !important;
    text-overflow: clip;
    overflow-wrap: anywhere;
}
.sg-mobile .agro-insights-navbar .agro-hover-width-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(108px, 0.8fr);
}
.sg-mobile .agro-insights-navbar .agro-hover-width-row > .agro-toolbar-section {
    height: 66px;
    min-height: 66px;
    box-sizing: border-box;
}
.sg-mobile .agro-insights-navbar .agro-hover-width-row .agro-toolbar-section > .agro-toolbar-pill {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}
.sg-mobile .agro-insights-navbar #agro-bar-width-multiplier {
    width: 100% !important;
    min-width: 0;
    height: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border-radius: 9px;
    text-align: center;
}
.sg-mobile .agro-insights-navbar .agro-actions-section,
.sg-mobile .agro-insights-navbar .agro-irrigation-toggle {
    height: 66px;
    min-height: 66px;
    box-sizing: border-box;
}
.sg-mobile .agro-insights-navbar .agro-actions-section {
    padding: 7px 10px;
    border: 1px solid #d5e0d9;
    border-radius: 10px;
    background: #fff;
}
.sg-mobile .agro-insights-navbar .agro-actions-section .agro-action-btn-group {
    flex: 1 1 auto;
    align-items: center;
}
.sg-mobile .agro-insights-navbar .agro-action-btn-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.sg-mobile .agro-insights-navbar .agro-action-btn-group .sg-btns {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px !important;
    flex: 0 0 44px;
}
.sg-mobile .agro-insights-navbar #agro-export-btn {
    display: none !important;
}

/* Compact controls: labels above a single 44px interaction row. */
.sg-mobile .agro-insights-navbar .agro-toolbar-switch-group {
    height: auto;
    padding: 8px 10px;
    gap: 6px 10px !important;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-hover-pill,
.sg-mobile .agro-insights-navbar .agro-toolbar-bar-width-pill {
    display: flex;
    align-items: center;
    padding: 0;
    height: 44px !important;
    min-height: 44px !important;
    border: 0;
    box-shadow: none;
    overflow: visible;
}
.sg-mobile .agro-insights-navbar #agro-hover-mode-dropdown,
.sg-mobile .agro-insights-navbar #agro-hover-mode-dropdown > div,
.sg-mobile .agro-insights-navbar #agro-hover-mode-dropdown .Select,
.sg-mobile .agro-insights-navbar #agro-hover-mode-dropdown .Select-control {
    width: 100% !important;
    max-width: 100%;
    min-width: 0 !important;
}
.sg-mobile .agro-insights-navbar #agro-hover-mode-dropdown .Select-control {
    display: table;
    table-layout: fixed;
    height: 44px !important;
}
.sg-mobile .agro-insights-navbar #agro-bar-width-multiplier {
    height: 44px !important;
}
.sg-mobile .agro-insights-navbar .agro-actions-section {
    padding: 0;
    border: 0;
    background: transparent;
}
.sg-mobile .agro-insights-navbar .agro-actions-section .agro-action-btn-group {
    flex: 0 0 44px;
}
.sg-mobile .agro-insights-navbar .agro-irrigation-toggle {
    align-self: end;
    height: 44px;
    min-height: 44px;
    white-space: normal;
    line-height: 1.2;
}

@media (orientation: landscape) {
    .sg-mobile .agro-insights-navbar .agro-toolbar {
        gap: 6px 10px;
        padding: 2px 0;
    }
    .sg-mobile .agro-insights-navbar .agro-show-section,
    .sg-mobile .agro-insights-navbar .agro-options-section {
        grid-column: auto;
    }
    .sg-mobile .agro-insights-navbar .agro-show-checklist {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .sg-mobile .agro-insights-navbar .agro-toolbar-switch-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sg-mobile .agro-insights-navbar .agro-toolbar-section {
        width: 100%;
        min-width: 0;
    }
    .sg-mobile .agro-insights-navbar .agro-hover-width-row {
        grid-column: 1 / -1;
    }
}
.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 {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    height: 36px;
    margin: 0 0 4px;
    padding: 0 4px;
    justify-content: flex-end;
    justify-content: safe flex-end;
    box-sizing: border-box;
    overflow-x: auto;
}
.sg-mobile .agro-graph-wrap > .dash-graph {
    height: calc(100% - 40px) !important;
}
/* Agro Insights mobile polish: the view controls sit on the same row as the graph title. */
.sg-mobile .agro-graph-wrap .agro-view-controls {
    position: absolute;
    top: 4px;
    right: 6px;
    left: auto;
    width: auto;
    max-width: 68%;
    height: 32px;
    margin: 0;
    padding: 0;
    gap: 5px;
    background: rgba(255, 255, 255, 0.9);
}
.sg-mobile .agro-graph-wrap .agro-view-controls .agro-view-toggle {
    min-height: 30px;
    padding: 3px 8px;
}
.sg-mobile .agro-graph-wrap > .dash-graph {
    height: 100% !important;
}
/* Touch devices pinch to zoom: hide the + / - buttons. */
.sg-mobile .agro-view-controls .agro-native-action[aria-label="Zoom in" i],
.sg-mobile .agro-view-controls .agro-native-action[aria-label="Zoom out" i],
.sg-mobile .agro-view-controls .agro-native-action[aria-label="Box Select" i],
.sg-mobile .agro-view-controls .agro-native-action[aria-label="Lasso Select" i] {
    display: none !important;
}
.sg-mobile .agro-graph-wrap .gtitle {
    font-size: 15px !important;
}
/* Empty graph keeps only the configure button, so measurements can be added as on PC. */
.sg-mobile .agro-graph-wrap.agro-empty-view {
    flex: 0 0 130px !important;
    min-height: 130px;
    height: 130px;
}
.sg-mobile .agro-empty-view .agro-view-controls {
    display: flex;
}
.sg-mobile .agro-empty-view .agro-view-controls > .agro-view-toggle:not(.agro-configure-local) {
    display: none;
}
.sg-mobile .agro-empty-view > .dash-graph {
    height: 100% !important;
}

/* Settings panel: same side margins as the graphs, aligned controls. */
.sg-mobile details.agro-insights-input-disclosure {
    width: auto;
    margin: 0 6px 8px;
}
.sg-mobile .agro-insights-controls-summary-info {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #6a8575;
    font-size: 0.78rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sg-mobile .agro-insights-input-disclosure[open] .agro-insights-controls-summary-info {
    display: none;
}
.sg-mobile .agro-insights-navbar .agro-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
}
.sg-mobile .agro-insights-navbar .agro-show-checklist {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr) !important;
}
.sg-mobile .agro-insights-navbar .agro-show-checklist .form-check-label {
    font-size: 0.9rem;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-switch-group .form-check {
    padding-left: 0;
}
.sg-mobile .agro-insights-navbar .agro-toolbar-switch-group .form-check-label {
    font-size: 0.9rem;
}

/* Header: show the whole brand name. */
.sg-mobile .sg-company-name {
    max-width: clamp(96px, 32vw, 130px);
    font-size: clamp(0.9rem, 4.2vw, 1.05rem);
}

/* 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%;
}

/* In landscape, show the active page in the header even when the browser asks
   the server for the desktop version (which omits the sg-mobile shell class). */
@media (orientation: portrait) and (max-width: 600px) and (pointer: coarse) and (hover: none) {
    /* Portrait: the page name replaces the brand name in the header, as in landscape. */
    #shell-view .sg-company-name {
        display: none !important;
    }

    #shell-view .sg-header-navbar .container-fluid > .d-flex.align-items-center {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    #shell-view .sg-header-navbar .container-fluid > .d-flex.align-items-center > .sg-current-page {
        display: flex !important;
        flex: 1 1 auto;
        min-width: 0;
        margin-left: 0.3rem !important;
        gap: 0.3rem !important;
        overflow: hidden;
    }

    #shell-view #current-page-icon {
        display: inline-flex;
        flex: 0 0 26px;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        margin: 0 !important;
    }

    #shell-view #current-page-icon img {
        width: 26px;
        height: 26px;
        object-fit: contain;
    }

    #shell-view #current-page-title {
        min-width: 0;
        overflow: hidden;
        font-size: clamp(0.8rem, 3.6vw, 0.95rem);
        font-weight: 600;
        line-height: 1.15;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 950px) and (pointer: coarse) and (hover: none) {
    #shell-view .sg-header-navbar .container-fluid > .d-flex.align-items-center {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    #shell-view .sg-header-navbar .container-fluid > .d-flex.align-items-center > .sg-current-page {
        display: flex !important;
        flex: 1 1 auto;
        min-width: 0;
        margin-left: 0.4rem !important;
        gap: 0.3rem !important;
        overflow: hidden;
    }

    #shell-view #current-page-icon {
        display: inline-flex;
        flex: 0 0 28px;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        margin: 0 !important;
    }

    #shell-view #current-page-icon img {
        width: 28px;
        height: 28px;
        object-fit: contain;
    }

    #shell-view #current-page-title {
        min-width: 0;
        overflow: hidden;
        font-size: clamp(0.85rem, 2.4vw, 1.05rem);
        line-height: 1.15;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}

/* Satellite uses desktop map grids; stack the same views and controls on phones. */
@media (max-width: 600px) {
    .sg-mobile .satellite-page {
        height: auto !important;
        min-height: 0 !important;
        padding: 0.85rem 0.35rem 0.5rem !important;
        overflow: visible;
    }

    .sg-mobile .satellite-page .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
    }

    .sg-mobile .satellite-page .tab-content,
    .sg-mobile .satellite-page .tab-pane,
    .sg-mobile .satellite-page .tab-pane.active {
        height: auto !important;
        overflow: visible;
    }

    .sg-mobile .satellite-page .tab-pane > .card {
        margin-top: 0.5rem !important;
    }

    .sg-mobile .satellite-page .tab-pane > .card > .card-body {
        height: auto !important;
        padding: 0.5rem !important;
    }

    .sg-mobile .satellite-view-layout,
    .sg-mobile .satellite-et-layout,
    .sg-mobile .satellite-config-layout {
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        padding: 0.25rem 0.15rem 0.5rem !important;
    }

    .sg-mobile .satellite-page .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .sg-mobile .satellite-active-unit-list {
        width: 100%;
    }

    .sg-mobile .satellite-dashboard {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: minmax(260px, 42vh) minmax(260px, 42vh) minmax(190px, auto) minmax(260px, auto) !important;
        grid-template-areas: "stress" "detail" "stats" "graph" !important;
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
    }

    .sg-mobile .satellite-dashboard-et {
        grid-template-rows: minmax(280px, 44vh) minmax(260px, auto) !important;
        grid-template-areas: "map" "graph" !important;
    }

    .sg-mobile .satellite-card {
        width: 100%;
        min-width: 0;
    }

    .sg-mobile .satellite-card .leaflet-container,
    .sg-mobile .satellite-card .dash-graph,
    .sg-mobile .satellite-card .js-plotly-plot,
    .sg-mobile .satellite-card .plot-container,
    .sg-mobile .satellite-card .svg-container {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .sg-mobile .satellite-card .satellite-map-legend {
        right: 6px;
        bottom: 20px;
        width: clamp(104px, 30vw, 128px);
        max-width: calc(100% - 52px);
        max-height: calc(100% - 48px);
        padding: 7px;
    }

    .sg-mobile .satellite-card .satellite-legend-title {
        margin-bottom: 5px;
        font-size: 10px;
        line-height: 1.2;
    }

    .sg-mobile .satellite-card .satellite-legend-body {
        height: clamp(72px, 22vw, 90px);
        gap: 6px;
    }

    .sg-mobile .satellite-card .satellite-legend-image {
        flex-basis: 9px;
        width: 9px;
    }

    .sg-mobile .satellite-card .satellite-legend-labels {
        font-size: 9px;
        line-height: 1.15;
    }

    .sg-mobile .satellite-card .satellite-map-legend.is-discrete {
        width: clamp(122px, 36vw, 150px);
    }

    .sg-mobile .satellite-card .satellite-map-legend.is-discrete .satellite-legend-labels {
        gap: 5px;
    }

    .sg-mobile .satellite-config-layout > .flex-grow-1 {
        flex: 0 0 56vh !important;
        height: 56vh;
        min-height: 300px !important;
    }

    .sg-mobile .satellite-config-layout .d-flex {
        flex-wrap: wrap;
        gap: 0.35rem;
    }
}

/* Keep both maps useful in phone landscape without clipping the statistics or chart. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 950px) and (pointer: coarse) and (hover: none) {
    .sg-mobile .satellite-page {
        height: auto !important;
        min-height: 0 !important;
        padding: 0.35rem 0.5rem !important;
        overflow: visible !important;
    }

    .sg-mobile .satellite-page .tab-content,
    .sg-mobile .satellite-page .tab-pane,
    .sg-mobile .satellite-page .tab-pane.active {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .sg-mobile .satellite-page .tab-pane > .card,
    .sg-mobile .satellite-page .tab-pane > .card > .card-body {
        height: auto !important;
        min-height: 0 !important;
    }

    .sg-mobile .satellite-view-layout,
    .sg-mobile .satellite-et-layout,
    .sg-mobile .satellite-config-layout {
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        overflow: visible !important;
    }

    .sg-mobile .satellite-dashboard {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto !important;
        overflow: visible;
    }

    .sg-mobile .satellite-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: minmax(220px, 55vh) minmax(170px, auto) minmax(220px, 55vh) !important;
        grid-template-areas: "stress detail" "stats stats" "graph graph" !important;
        gap: 8px !important;
    }

    .sg-mobile .satellite-dashboard-et {
        grid-template-rows: minmax(260px, 70vh) !important;
        grid-template-areas: "map graph" !important;
    }

    .sg-mobile .satellite-card .satellite-map-legend {
        right: 6px;
        bottom: 20px;
        width: clamp(104px, 30vw, 128px);
        max-width: calc(100% - 52px);
        max-height: calc(100% - 48px);
        padding: 7px;
    }

    .sg-mobile .satellite-card .satellite-legend-title {
        margin-bottom: 5px;
        font-size: 10px;
        line-height: 1.2;
    }

    .sg-mobile .satellite-card .satellite-legend-body {
        height: clamp(72px, 22vw, 90px);
        gap: 6px;
    }

    .sg-mobile .satellite-card .satellite-legend-image {
        flex-basis: 9px;
        width: 9px;
    }

    .sg-mobile .satellite-card .satellite-legend-labels {
        font-size: 9px;
        line-height: 1.15;
    }

    .sg-mobile .satellite-card .satellite-map-legend.is-discrete {
        width: clamp(122px, 36vw, 150px);
    }

    .sg-mobile .satellite-card .satellite-map-legend.is-discrete .satellite-legend-labels {
        gap: 5px;
    }

    .sg-mobile .satellite-page .nav-tabs .nav-link {
        padding: 0.35rem 0.7rem;
    }
}

/* Agro Activities: allow the whole page to scroll on phones and keep wide
   tables scrollable within their own containers. */
@media (max-width: 600px) {
    .sg-mobile .agro-activities-page {
        height: auto !important;
        min-height: 0 !important;
        padding: 0.35rem 0.25rem 0 !important;
        overflow: visible;
    }

    .sg-mobile .agro-activities-page #agro-activities-tabs .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .sg-mobile .agro-activities-page #agro-activities-tabs .nav-link {
        flex: 0 0 auto;
        padding: 0.45rem 0.65rem;
        white-space: nowrap;
    }

    .sg-mobile .agro-activities-page .tab-content,
    .sg-mobile .agro-activities-page .tab-pane,
    .sg-mobile .agro-activities-page .tab-pane.active {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible;
    }

    .sg-mobile .agro-activities-page .tab-pane > .card,
    .sg-mobile .agro-activities-page .tab-pane > .card > .card-body {
        height: auto !important;
        min-height: 0 !important;
    }

    .sg-mobile .agro-activities-main-view,
    .sg-mobile .agro-activities-page .agro-activities-body {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        flex: 0 0 auto !important;
        width: 100%;
        max-width: 100%;
    }

    .sg-mobile .agro-activities-page .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .sg-mobile .agro-activities-page .dash-table-container,
    .sg-mobile .agro-activities-page .dash-spreadsheet-container {
        width: 100%;
        max-width: 100%;
        max-height: 65dvh !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-x pan-y;
    }

    .sg-mobile .agro-activities-page #activity-diary-table .dash-spreadsheet-container {
        height: 65dvh !important;
        min-height: 320px !important;
    }

    .sg-mobile .agro-activities-page #activity-diary-table .dash-spreadsheet-inner {
        min-width: max-content;
    }

    .sg-mobile .agro-activities-page #agro-activities-tab-export-btn,
    .sg-mobile .agro-activities-page #agro-activities-tab-best-time-activities-export-btn {
        display: none !important;
    }

    .sg-mobile .agro-activities-page .modal-dialog {
        max-width: calc(100vw - 1rem);
        margin: 0.5rem auto;
    }

    .sg-mobile .agro-activities-page .modal-body {
        max-height: 68dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* The activities settings modal is rendered outside the page container,
       so size it directly by its stable modal ID (the layout has a 25vw width). */
    #generic-modal-agro-activities-tab-activities-setting .modal-dialog {
        width: min(94vw, 620px) !important;
        max-width: min(94vw, 620px) !important;
        margin: 0.5rem auto !important;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-content {
        display: flex;
        width: 100%;
        max-height: calc(100dvh - 1rem);
        overflow: hidden;
        border-radius: 1rem;
    }

    #generic-modal-agro-activities-tab-activities-setting .sg-modal-header {
        flex: 0 0 auto;
        align-items: center;
        gap: 0.5rem;
        padding: 0.7rem 0.85rem;
    }

    #generic-modal-agro-activities-tab-activities-setting .sg-icon {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
        object-fit: contain;
    }

    #generic-modal-agro-activities-tab-activities-setting .sg-modal-title {
        min-width: 0;
        font-size: 1rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body {
        min-width: 0;
        padding: 0.75rem;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body > *,
    #generic-modal-agro-activities-tab-activities-setting .modal-body .container-fluid,
    #generic-modal-agro-activities-tab-activities-setting .modal-body .row,
    #generic-modal-agro-activities-tab-activities-setting .modal-body [class*="col-"] {
        min-width: 0;
        max-width: 100%;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body .input-group {
        width: 100%;
        min-width: 0;
        flex-wrap: nowrap;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body .input-group-text {
        flex: 0 0 auto;
        max-width: 38%;
        padding: 0.45rem 0.6rem;
        white-space: nowrap;
        font-size: 0.9rem;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select,
    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-control,
    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-input,
    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-value,
    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-placeholder {
        min-width: 0;
        max-width: 100%;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-control {
        width: 100%;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body .rc-slider {
        width: 100%;
    }

    #generic-modal-agro-activities-tab-activities-setting .sg-modal-footer {
        flex: 0 0 auto;
        gap: 0.5rem;
        padding: 0.65rem 0.75rem;
    }

    #generic-modal-agro-activities-tab-activities-setting .sg-modal-footer .btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 44px;
        margin: 0;
        padding: 0.5rem;
        font-size: 0.95rem;
    }
}

/* The same modal is also used in phone landscape, where viewport width is
   larger than the portrait breakpoint but the inline 25vw width is still wrong. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 950px) and (pointer: coarse) and (hover: none) {
    #generic-modal-agro-activities-tab-activities-setting .modal-dialog {
        width: min(94vw, 760px) !important;
        max-width: min(94vw, 760px) !important;
        margin: 0.4rem auto !important;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-content {
        max-height: calc(100dvh - 0.8rem);
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body {
        min-width: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body .container-fluid,
    #generic-modal-agro-activities-tab-activities-setting .modal-body .row,
    #generic-modal-agro-activities-tab-activities-setting .modal-body [class*="col-"] {
        min-width: 0;
        max-width: 100%;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body .input-group {
        width: 100%;
        min-width: 0;
    }

    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select,
    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-control,
    #generic-modal-agro-activities-tab-activities-setting .modal-body .rc-slider {
        min-width: 0;
        max-width: 100%;
    }
}

/* Sensors: fit filter controls and keep wide data tables horizontally scrollable. */
@media (max-width: 600px) {
    .sg-mobile #sensors-page {
        width: 100%;
        max-width: 100%;
        height: auto !important;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .sg-mobile #sensors-page > .container-fluid {
        display: flex;
        flex-direction: column;
        height: auto !important;
        min-height: 0;
    }

    .sg-mobile #sensors-page > .container-fluid > .row {
        flex: 0 0 auto !important;
        min-width: 0;
    }

    /* The desktop page uses a fixed-height flex chain. On a phone that chain
       has no reliable height, so the table cards must keep their own space. */
    .sg-mobile #sensors-page .sensors-setting-section-div {
        height: auto !important;
        min-height: 0;
        flex: 0 0 auto !important;
    }

    .sg-mobile #sensors-page .sensors-setting-section-div > .card {
        height: auto !important;
        min-height: 0;
        flex: 0 0 auto !important;
    }

    .sg-mobile #sensors-page .sg-page-content-top-navbar,
    .sg-mobile #sensors-page .sg-page-content-top-navbar .container-fluid,
    .sg-mobile #sensors-page .sg-page-content-top-navbar .container-fluid > div {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .sg-mobile #sensors-page .sg-page-content-top-navbar .container-fluid > div {
        flex-wrap: wrap;
        justify-content: flex-start !important;
        gap: 0.5rem;
        padding: 8px 10px;
    }

    .sg-mobile #sensors-page .sg-page-content-top-navbar h2 {
        font-size: 1.1rem !important;
        line-height: 1.25;
    }

    .sg-mobile #sensors-page .input-group {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        margin-left: 0 !important;
    }

    .sg-mobile #sensors-page .input-group-text {
        flex: 0 0 118px;
        justify-content: flex-start;
        padding-inline: 10px;
        white-space: nowrap;
    }

    .sg-mobile #sensors-page .input-group .form-select {
        width: 1% !important;
        min-width: 0;
        flex: 1 1 0;
        text-overflow: ellipsis;
    }

    .sg-mobile #sensors-page .sensors-controller-row {
        height: auto !important;
        min-height: 0;
        flex: 0 0 auto !important;
        margin-bottom: 8px;
    }

    .sg-mobile #sensors-page .sensors-controller-row > [class*="col-"],
    .sg-mobile #sensors-page .sensors-table-row > [class*="col-"] {
        min-width: 0;
    }

    .sg-mobile #sensors-page .sensors-controller-row .card,
    .sg-mobile #sensors-page .sensors-table-row .card {
        height: auto !important;
        min-height: 0;
    }

    .sg-mobile #sensors-page .sensors-controller-row .card-body,
    .sg-mobile #sensors-page .sensors-table-row .card-body {
        height: auto !important;
        flex: 0 0 auto !important;
        min-height: 0;
        overflow: visible;
    }

    .sg-mobile #sensors-page .sensors-controller-row .sensors-setting-controllers-data-table-div-body {
        height: 220px !important;
        min-height: 180px;
        flex: 0 0 220px !important;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sg-mobile #sensors-page .sensors-controller-row .card-header .container-fluid > div {
        flex-wrap: wrap;
        justify-content: flex-start !important;
        gap: 0.35rem;
        padding: 6px 10px;
    }

    .sg-mobile #sensors-page .sensors-controller-row .card-header .input-group {
        width: 100% !important;
    }

    .sg-mobile #sensors-page .sensors-table-row {
        height: auto !important;
        min-height: 0;
        flex: 0 0 auto !important;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-body > div {
        height: auto !important;
        min-height: 0;
        flex: 0 0 auto !important;
    }

    .sg-mobile #sensors-page .sensors-table-row .sensors-setting-section-div,
    .sg-mobile #sensors-page .sensors-table-row .sensors-setting-section-div > .card,
    .sg-mobile #sensors-page .sensors-table-row .card-body,
    .sg-mobile #sensors-page .sensors-table-row .card-body > div {
        display: block !important;
        height: auto !important;
        min-height: 0;
        overflow: visible !important;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"] > div {
        justify-content: flex-start !important;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin: 0 !important;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"]:nth-child(2) > div {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        justify-content: stretch !important;
        align-items: center;
        column-gap: 10px !important;
        row-gap: 8px !important;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-filter-select {
        grid-column: 1 / -1;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        min-width: 0;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-filter-select label {
        display: inline-flex !important;
        align-items: center;
        gap: 5px;
        margin: 0 !important;
        padding: 6px 8px;
        border: 1px solid #d7e3dc;
        border-radius: 8px;
        background: #fff;
        font-size: 0.78rem !important;
        line-height: 1.25;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-filter-count {
        margin: 0 !important;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-select-all {
        margin: 0 !important;
        min-width: 0;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"]:last-child > div {
        display: flex;
        justify-content: flex-start !important;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sg-mobile #sensors-page #sensors-setting-table-hover-output {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        margin: 0 !important;
    }

    .sg-mobile #sensors-page #sensors-export-visible-btn {
        display: none !important;
    }

    /* Keep every sensor header control in one horizontally scrollable row
       on narrow phones; the table title remains in the same toolbar. */
    .sg-mobile #sensors-page .sensors-table-row .card-header .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"] {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"]:nth-child(2) {
        flex: 1 0 auto !important;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"]:nth-child(2) > div {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center;
        gap: 8px !important;
        width: max-content;
        margin: 0 !important;
        white-space: nowrap;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-filter-select {
        flex-wrap: nowrap !important;
        width: max-content;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-filter-select label {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-filter-count,
    .sg-mobile #sensors-page #sensors-setting-sensors-select-all {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"]:last-child > div {
        flex-wrap: nowrap !important;
        width: max-content;
    }

    .sg-mobile #sensors-page #sensors-dis-associate-sensor-to-asset-button,
    .sg-mobile #sensors-page #sensors-associate-sensor-to-asset-button {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        border-radius: 8px !important;
    }

    .sg-mobile #sensors-page .sensors-search-bar {
        padding: 8px 10px;
        gap: 8px;
    }

    .sg-mobile #sensors-page #sensors-quick-search {
        width: 100%;
        flex: 1 1 100%;
        font-size: 0.9rem;
    }

    .sg-mobile #sensors-page #sensors-selection-summary,
    .sg-mobile #sensors-page #sensors-active-context {
        white-space: normal;
        overflow-wrap: anywhere;
        min-width: 0;
    }

    .sg-mobile #sensors-page #sensors-table-viewport {
        display: block !important;
        position: relative;
        width: 100%;
        max-width: 100%;
        height: max(42dvh, 300px) !important;
        min-height: 240px;
        flex: 0 0 auto !important;
        overflow: hidden;
    }

    .sg-mobile #sensors-page #sensors-sensors-data-table,
    .sg-mobile #sensors-page #sensors-sensors-data-table .dash-table-container,
    .sg-mobile #sensors-page #sensors-sensors-data-table .dash-spreadsheet-container,
    .sg-mobile #sensors-page #sensors-sensors-data-table .dash-spreadsheet.dash-freeze-top {
        display: block !important;
        visibility: visible !important;
        height: 100% !important;
        min-height: 240px;
        max-height: 100% !important;
    }

    .sg-mobile #sensors-page #sensors-controllers-data-table .dash-table-container,
    .sg-mobile #sensors-page #sensors-sensors-data-table .dash-table-container,
    .sg-mobile #sensors-page #sensors-controllers-data-table .dash-spreadsheet-container,
    .sg-mobile #sensors-page #sensors-sensors-data-table .dash-spreadsheet-container {
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }
}

/* Sensors landscape: compact the filter toolbar and reserve room for both tables. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1200px) {
    /* Keep the sensors page in the shell's vertical scroll flow on short
       landscape viewports (iOS otherwise clips the second table). */
    .sg-mobile .sg-main-content:has(#sensors-page) {
        height: 0 !important;
        flex: 1 1 0 !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .sg-mobile #page-content:has(#sensors-page) {
        display: block !important;
        height: auto !important;
        flex: 0 0 auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .sg-mobile #sensors-page.sensors-setting-page-container {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        touch-action: pan-y;
    }

    .sg-mobile #sensors-page {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .sg-mobile #sensors-page > .container-fluid,
    .sg-mobile #sensors-page > .container-fluid > .row {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .sg-mobile #sensors-page > .container-fluid > .row > [class*="col-"] {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0;
    }

    .sg-mobile #sensors-page .sensors-setting-section-div,
    .sg-mobile #sensors-page .sensors-setting-section-div > .card {
        display: block !important;
        width: 100%;
        height: auto !important;
        min-height: 0;
        overflow: visible !important;
    }

    .sg-mobile #sensors-page .sensors-setting-section-div > .card > .card-body {
        display: block !important;
        width: 100%;
        height: auto !important;
        min-height: 0;
        overflow: visible !important;
    }

    .sg-mobile #sensors-page .sensors-controller-row {
        height: auto !important;
        min-height: 0;
        margin-bottom: 6px;
    }

    .sg-mobile #sensors-page .sensors-controller-row .sensors-setting-controllers-data-table-div-body {
        display: block !important;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .sg-mobile #sensors-page #sensors-controllers-data-table,
    .sg-mobile #sensors-page #sensors-controllers-data-table .dash-table-container,
    .sg-mobile #sensors-page #sensors-controllers-data-table .dash-spreadsheet-container {
        display: block !important;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: visible !important;
    }

    .sg-mobile #sensors-page .sensors-table-row {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        margin-top: 6px;
        margin-bottom: 12px;
    }

    .sg-mobile #sensors-page .sensors-table-row > [class*="col-"] {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .sg-mobile #sensors-page .sensors-table-row .sensors-setting-section-div,
    .sg-mobile #sensors-page .sensors-table-row .sensors-setting-section-div > .card,
    .sg-mobile #sensors-page .sensors-table-row .card-body {
        min-height: 0 !important;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-body > div {
        display: block !important;
        width: 100%;
        height: auto !important;
        min-height: 0;
        overflow: visible !important;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"] {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"]:nth-child(2) {
        flex: 1 0 auto !important;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"]:first-child > div {
        justify-content: flex-start !important;
        white-space: nowrap;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"]:nth-child(2) > div {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center;
        gap: 8px !important;
        width: max-content;
        margin: 0 !important;
        white-space: nowrap;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-filter-select {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 4px;
        width: max-content;
        min-width: 0;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-filter-select label {
        display: inline-flex !important;
        align-items: center;
        gap: 5px;
        min-width: 0;
        margin: 0 !important;
        padding: 4px 6px;
        border: 1px solid #d7e3dc;
        border-radius: 8px;
        background: #fff;
        font-size: 0.72rem !important;
        line-height: 1.25;
        white-space: nowrap;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-filter-count {
        flex: 0 0 auto;
        margin: 0 !important;
        font-size: 0.78rem !important;
    }

    .sg-mobile #sensors-page #sensors-setting-sensors-select-all {
        flex: 0 0 auto;
        margin: 0 !important;
        min-width: 0;
        white-space: nowrap;
        font-size: 0.72rem;
    }

    .sg-mobile #sensors-page .sensors-table-row .card-header .row > [class*="col-"]:last-child > div {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center;
        flex-wrap: nowrap !important;
        gap: 6px;
        width: max-content;
    }

    .sg-mobile #sensors-page #sensors-export-visible-btn {
        display: none !important;
    }

    .sg-mobile #sensors-page #sensors-dis-associate-sensor-to-asset-button,
    .sg-mobile #sensors-page #sensors-associate-sensor-to-asset-button {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        border-radius: 8px !important;
    }

    .sg-mobile #sensors-page .sensors-search-bar {
        padding: 8px 10px;
        gap: 8px;
    }

    .sg-mobile #sensors-page #sensors-quick-search {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
        font-size: 0.9rem;
    }

    .sg-mobile #sensors-page #sensors-selection-summary,
    .sg-mobile #sensors-page #sensors-active-context {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        min-width: 0;
    }

    .sg-mobile #sensors-page #sensors-table-viewport {
        display: block !important;
        position: relative;
        width: 100%;
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        /* Allow the page to keep scrolling vertically when a swipe begins
           over the horizontally scrollable table. */
        touch-action: pan-x pan-y;
    }

    .sg-mobile #sensors-page #sensors-sensors-data-table,
    .sg-mobile #sensors-page #sensors-sensors-data-table .dash-table-container,
    .sg-mobile #sensors-page #sensors-sensors-data-table .dash-spreadsheet-container,
    .sg-mobile #sensors-page #sensors-sensors-data-table .dash-spreadsheet.dash-freeze-top {
        display: block !important;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: visible !important;
    }

    /* Keep landscape tables inside bounded, independently scrollable areas.
       Expanding every row into the page flow can stall mobile browsers. */
    .sg-mobile #sensors-page .sensors-controllers-disclosure[open] {
        height: auto !important;
        max-height: none !important;
    }

    .sg-mobile #sensors-page .sensors-controllers-disclosure[open] .sensors-setting-controllers-data-table-div-body {
        display: block !important;
        height: clamp(150px, 34vh, 260px) !important;
        max-height: 34vh !important;
        min-height: 120px !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }

    .sg-mobile #sensors-page .sensors-sensors-disclosure[open] {
        height: auto !important;
        max-height: none !important;
    }

    .sg-mobile #sensors-page .sensors-sensors-disclosure[open] .sensors-setting-section-div,
    .sg-mobile #sensors-page .sensors-sensors-disclosure[open] .sensors-setting-section-div > .card,
    .sg-mobile #sensors-page .sensors-sensors-disclosure[open] .card-body {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .sg-mobile #sensors-page .sensors-sensors-disclosure[open] #sensors-table-viewport {
        display: block !important;
        height: clamp(180px, 48vh, 340px) !important;
        max-height: 48vh !important;
        min-height: 160px !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }

    .sg-mobile #sensors-page .sensors-sensors-disclosure[open] #sensors-sensors-data-table,
    .sg-mobile #sensors-page .sensors-sensors-disclosure[open] #sensors-sensors-data-table .dash-table-container,
    .sg-mobile #sensors-page .sensors-sensors-disclosure[open] #sensors-sensors-data-table .dash-spreadsheet-container,
    .sg-mobile #sensors-page .sensors-sensors-disclosure[open] #sensors-sensors-data-table .dash-spreadsheet.dash-freeze-top {
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        overflow: auto !important;
    }
}

/* Measurement picker: scope to this dialog, including Bootstrap portal rendering. */
@media (max-width: 767px), (max-height: 600px) and (pointer: coarse) {
    .modal:has(#vcm-tabs) .modal-dialog {
        width: calc(100% - 20px) !important;
        max-width: 960px !important;
        margin: 10px auto !important;
    }
    .modal:has(#vcm-tabs) .modal-content {
        max-height: calc(100dvh - 20px);
        border-radius: 14px;
        overflow: hidden;
    }
    .modal:has(#vcm-tabs) .modal-header {
        padding: 12px 16px;
        flex-shrink: 0;
    }
    .modal:has(#vcm-tabs) .modal-title { font-size: 18px; line-height: 1.3; }
    .modal:has(#vcm-tabs) .modal-body {
        padding: 12px;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
    }
    .modal:has(#vcm-tabs) .modal-footer { padding: 8px 12px; flex-shrink: 0; }
    #vcm-tabs { display: flex; flex-wrap: nowrap; margin-bottom: 12px; }
    #vcm-tabs .nav-item { flex: 1 1 0; min-width: 0; }
    #vcm-tabs .nav-link { width: 100%; padding: 10px 8px; font-size: 13px; line-height: 1.3; white-space: normal; }
    .modal:has(#vcm-tabs) .tab-content { width: 100%; min-width: 0; }
    #vcm-unit-search { width: 100%; min-width: 0 !important; flex-basis: 100% !important; min-height: 44px; }
    #vcm-only-available-measurements { white-space: normal !important; }
    #vcm-pu-selection-accordion { max-height: none !important; overflow: visible !important; }
    #vcm-pu-selection-accordion .accordion-button { padding: 12px; font-size: 15px; }
    #vcm-pu-selection-accordion .accordion-body { padding: 8px; }
    #vcm-pu-selection-accordion .card-body { padding: 0 !important; }
    #vcm-pu-selection-accordion .card-body > div > .row { display: none; }
    #vcm-pu-selection-accordion .vcm-unit-search-row {
        padding: 10px;
        margin-bottom: 8px;
        border: 1px solid #d7e1da;
        border-radius: 10px;
        background: #f7faf8;
    }
    #vcm-pu-selection-accordion .vcm-unit-search-row .row { margin: 0; row-gap: 8px; }
    #vcm-pu-selection-accordion .row > .col-6 { flex: 0 0 85%; width: 85%; overflow-wrap: anywhere; }
    #vcm-pu-selection-accordion .row > .col-1 { flex: 0 0 15%; width: 15%; }
    #vcm-pu-selection-accordion .row > .col-5 { flex: 0 0 100%; width: 100%; min-width: 0; }
    #vcm-pu-selection-accordion .Select { width: 100%; min-width: 0; font-size: 13px; }
    #vcm-pu-selection-accordion .Select-value { max-width: 100%; }
    #vcm-pu-selection-accordion .Select-value-label { white-space: normal !important; overflow-wrap: anywhere; }
    #vcm-columns-config-accordion { max-width: 100%; overflow-x: auto; }
}

/* Independent native disclosure groups for mobile irrigation recommendations. */
.sg-mobile .ir-header-row > .ir-mobile-section {
    width: 100%;
    padding: 0;
    border: 1px solid #d5e1d9;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.sg-mobile .ir-mobile-section > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    background: #eaf3ed;
    color: #315540;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.sg-mobile .ir-mobile-section > summary::-webkit-details-marker { display: none; }
.sg-mobile .ir-mobile-section > summary::after { content: "＋"; margin-inline-start: auto; }
.sg-mobile .ir-mobile-section[open] > summary::after { content: "−"; }
.sg-mobile .ir-mobile-section-body { padding: 8px; min-width: 0; }
.sg-mobile .ir-mobile-section-body .ir-header-col { width: 100%; flex: 0 0 100%; }

/* Plan tools must size their fields independently of desktop Bootstrap columns. */
.sg-mobile .ir-mobile-section .ir-plan-tools {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 8px;
    align-items: end !important;
    margin: 0;
}
.sg-mobile .ir-mobile-section .ir-plan-tools > [class*="col"] {
    width: 100%;
    min-width: 0;
    padding: 0;
}
.sg-mobile .ir-mobile-section .ir-plan-tools > :has(#irrigation-recommendation-export-btn) { display: none; }
.sg-mobile .ir-mobile-section .ir-plan-tools > :has(#irrigation-recommendation-display-mode-select) { grid-column: 2; grid-row: 1; }
.sg-mobile .ir-mobile-section .ir-plan-tools > :has(#irrigation-recommendation-display-resolution-select) { grid-column: 3; grid-row: 1; }
.sg-mobile .ir-mobile-section .ir-plan-tools > :has(#irrigation-recommendation-follower-checkbox) { grid-column: 1 / 3; grid-row: 2; }
.sg-mobile .ir-mobile-section .ir-plan-tools > :has(#irrigation-recommendation-show-salt-wash-checkbox) { grid-column: 3; grid-row: 2; }
.sg-mobile .ir-mobile-section .ir-select-label {
    display: block;
    min-height: 34px;
    margin: 0 0 5px;
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
}
.sg-mobile .ir-mobile-section .ir-compact-select {
    width: 100% !important;
    min-width: 0;
    height: 44px;
    font-size: 13px;
    padding-left: 8px;
}
.sg-mobile .ir-mobile-section .ir-follower-checkbox { white-space: normal; font-size: 13px; line-height: 1.35; }
.sg-mobile .ir-mobile-section .ir-square-action-btn { width: 44px !important; height: 44px !important; min-height: 44px !important; }
.sg-mobile .ir-mobile-section .ir-control-group { min-width: 0; padding: 10px; }

/* All four recommendation editors are portalled outside the page shell. */
@media (max-width: 767px), (max-height: 600px) and (pointer: coarse) {
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) {
        max-height: 100dvh !important;
        padding: 0 !important;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) {
        width: calc(100vw - 16px) !important;
        max-width: 960px !important;
        margin: 8px auto !important;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-content {
        max-height: calc(100dvh - 16px);
        border-radius: 12px;
        overflow: hidden;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-header {
        padding: 10px 12px;
        gap: 8px;
        flex-shrink: 0;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .sg-modal-title {
        font-size: 18px;
        line-height: 1.3;
        overflow-wrap: normal;
        word-break: normal;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-header .sg-icon {
        width: 30px;
        height: 30px;
        object-fit: contain;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-body {
        padding: 12px;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-footer {
        flex-shrink: 0;
        padding: 8px 12px;
        gap: 8px;
        background: #f5f8f6;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-footer .btn {
        min-height: 44px;
        flex: 1 1 0;
        margin: 0;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-body .container-fluid { padding: 0; }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-body .row {
        flex-wrap: wrap !important;
        row-gap: 10px;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-body .row > [class*="col"] {
        min-width: 0 !important;
        max-width: 100%;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-body .row > [class*="col"]:not(.col-auto):not(.col-12) {
        flex: 1 1 100%;
        width: 100% !important;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-body :is(input:not([type="checkbox"]):not([type="radio"]), select) {
        min-height: 44px;
        max-width: 100%;
        min-width: 0 !important;
        font-size: 16px;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-body :is(label,.form-check-label) {
        white-space: normal !important;
        line-height: 1.35;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .modal-body .btn { min-height: 44px; white-space: normal; }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .nav-tabs { display: flex; flex-wrap: wrap; }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .nav-tabs .nav-item { flex: 1 1 auto; }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .nav-link { padding: 10px; font-size: 13px; }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .dash-table-container { max-width: 100%; min-width: 0; overflow-x: auto; }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .Select { min-width: 0; width: 100%; }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .Select-control { min-height: 44px; }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .Select-value-label { white-space: normal !important; overflow-wrap: anywhere; }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .DateInput,
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .SingleDatePickerInput { max-width: 100%; }
}

@media (max-width: 767px), (max-height: 600px) and (pointer: coarse) {
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .input-group {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 4px 0;
        margin-bottom: 10px;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .input-group-text {
        width: 100%;
        white-space: normal;
        padding: 6px 8px;
        font-size: 13px;
        line-height: 1.3;
        border-radius: 6px !important;
    }
    .modal-dialog:has([id^="generic-modal-body-irrigation-recommendation-"]) .input-group > :is(input,select,.Select) {
        width: 100% !important;
        flex: 1 1 100%;
        margin-left: 0 !important;
        border-radius: 6px !important;
    }
}

@media (max-width: 767px), (max-height: 600px) and (pointer: coarse) {
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 0 !important;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields > .input-group {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 36px;
        gap: 5px 0;
        align-content: start;
        margin: 0 !important;
        min-width: 0;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group-text {
        grid-column: 1 / -1;
        padding: 0;
        min-height: 34px;
        background: transparent;
        border: 0;
        font-size: 12px;
        font-weight: 600;
        align-items: start;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group > :is(input,.w-100) {
        grid-column: 1 / -1;
        width: 100% !important;
        height: 44px;
        min-width: 0;
        margin: 0 !important;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group:has(input[type="time"]) > input {
        grid-column: 1;
        border-radius: 6px 0 0 6px !important;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group > .btn {
        grid-column: 2;
        grid-row: 2;
        width: 36px;
        height: 44px;
        padding: 0;
        margin: 0;
        border: 1px solid #d5ded8;
        border-radius: 0 6px 6px 0;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .modal-body { scroll-padding-top: 12px; }
}

/* Pulse parameters: one complete label/control pair per row. */
@media (max-width: 767px), (max-height: 600px) and (pointer: coarse) {
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields > .input-group {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
        align-items: center;
        gap: 0;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group-text {
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        padding-right: 10px;
        align-items: center;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group > :is(input,.w-100) {
        grid-column: 2 / -1;
        grid-row: 1;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group:has(input[type="time"]) > input {
        grid-column: 2;
        grid-row: 1;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group > .btn {
        grid-column: 3;
        grid-row: 1;
    }
}

/* Uniform interaction height within every pulse parameter row. */
@media (max-width: 767px), (max-height: 600px) and (pointer: coarse) {
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group {
        min-height: 44px;
        align-items: center;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group > :is(input,select,.w-100,.btn),
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .Select-control {
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px;
        box-sizing: border-box;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .Select-placeholder,
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .Select-value {
        line-height: 42px !important;
    }
    .modal-dialog:has(.ir-pulse-parameter-fields) .ir-pulse-parameter-fields .input-group-text {
        min-height: 44px;
        display: flex;
        align-items: center;
        box-sizing: border-box;
    }
}

.sg-mobile .lw-input-disclosure {
    width: 100%;
    border: 1px solid #d5e1d9;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.sg-mobile .lw-input-disclosure > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    background: #eaf3ed;
    color: #315540;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.sg-mobile .lw-input-disclosure > summary::-webkit-details-marker { display: none; }
.sg-mobile .lw-input-disclosure > summary::after { content: "＋"; margin-inline-start: auto; }
.sg-mobile .lw-input-disclosure[open] > summary::after { content: "−"; }
.sg-mobile .lw-input-disclosure #limited-water-toolbar-resize-handle { display: none; }
.sg-mobile .lw-input-disclosure #limited-water-toolbar-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.sg-mobile .irrigation-tracker-input-disclosure {
    width: 100%;
    border: 1px solid #d5e1d9;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.sg-mobile .irrigation-tracker-input-disclosure > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    background: #eaf3ed;
    color: #315540;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.sg-mobile .irrigation-tracker-input-disclosure > summary::-webkit-details-marker { display: none; }
.sg-mobile .irrigation-tracker-input-disclosure > summary::after { content: "＋"; margin-inline-start: auto; }
.sg-mobile .irrigation-tracker-input-disclosure[open] > summary::after { content: "−"; }
.sg-mobile .irrigation-tracker-input-disclosure #irrigation-tracker-toolbar-resize-handle { display: none; }
.sg-mobile .irrigation-tracker-input-disclosure #irrigation-tracker-toolbar-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.sg-mobile .agro-insights-input-disclosure {
    width: 100%;
    border: 1px solid #d5e1d9;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.sg-mobile .agro-insights-input-disclosure > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    background: #eaf3ed;
    color: #315540;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.sg-mobile .agro-insights-input-disclosure > summary::-webkit-details-marker { display: none; }
.sg-mobile .agro-insights-input-disclosure > summary::after { content: "＋"; margin-inline-start: auto; }
.sg-mobile .agro-insights-input-disclosure[open] > summary::after { content: "−"; }
.sg-mobile .agro-insights-input-disclosure .agro-insights-navbar {
    position: static !important;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
}
.sg-mobile .agro-insights-input-disclosure .agro-insights-toolbar-resize-handle { display: none !important; }
.sg-mobile .agro-insights-input-disclosure .agro-insights-toolbar-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Irrigation Tracker controls: a consistent portrait stack and compact landscape grid. */
@media (max-width: 767px) {
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-resizable-toolbar,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-content,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-controls {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar {
        display: block;
        padding: 6px 8px 4px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 7px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-controls > .agro-toolbar-divider {
        display: none !important;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-controls > .agro-toolbar-section {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        width: 100%;
        min-width: 0;
        min-height: 54px;
        margin: 0;
        padding: 5px 9px;
        box-sizing: border-box;
        border: 1px solid #d7e1da;
        border-radius: 10px;
        background: #fff;
    }
    .sg-mobile .irrigation-tracker-mobile .agro-toolbar-section-label {
        justify-self: start;
        margin: 0;
        color: #243c31;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.2;
        text-align: left;
        white-space: nowrap;
    }
    .sg-mobile .irrigation-tracker-mobile .agro-toolbar-section .agro-toolbar-pill,
    .sg-mobile .irrigation-tracker-mobile .agro-toolbar-section > .form-select,
    .sg-mobile .irrigation-tracker-mobile .agro-toolbar-section .form-select {
        width: 100% !important;
        min-width: 0 !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0;
        box-sizing: border-box;
    }
    .sg-mobile .irrigation-tracker-mobile .agro-toolbar-pill {
        display: flex;
        align-items: center;
        padding: 4px 8px;
        box-sizing: border-box;
        border: 1px solid #d7e1da;
        border-radius: 8px;
        background: #fff;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-unit-type-row {
        display: grid;
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        align-items: stretch;
        gap: 7px;
        width: 100%;
        min-width: 0;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-unit-type-row > .agro-toolbar-section {
        display: grid;
        grid-template-columns: 67px minmax(0, 1fr);
        align-items: center;
        gap: 5px;
        min-width: 0;
        min-height: 56px;
        padding: 6px 7px;
        border: 1px solid #d7e1da;
        border-radius: 10px;
        background: #fff;
        box-sizing: border-box;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-unit-type-row .agro-toolbar-section-label {
        font-size: 0.68rem;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-type-section {
        grid-template-columns: 36px minmax(0, 1fr) !important;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-type-section .form-select {
        padding: 0.375rem 1.5rem 0.375rem 0.5rem;
        font-size: 0.76rem;
        text-overflow: ellipsis;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-plant-units-section .sg-btns {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        justify-self: end;
        padding: 0 !important;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-view-section .agro-toolbar-pill,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-options-section .agro-toolbar-pill {
        justify-content: flex-start;
        gap: 12px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-show-section .agro-toolbar-pill > .mb-0 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
        gap: 2px 8px;
        width: 100%;
    }
    /* Give Show its full row: three long labels cannot share the narrow control
       column used by the other labeled settings. */
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-show-section {
        grid-template-columns: minmax(0, 1fr) !important;
        align-content: start;
        gap: 4px;
        padding: 6px 9px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-show-section .agro-toolbar-section-label {
        align-self: start;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-show-section .agro-toolbar-pill {
        width: 100%;
        height: auto !important;
        min-height: 68px !important;
        padding: 2px 6px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-show-section .form-check-inline {
        width: 100%;
        min-width: 0;
        margin: 0 !important;
        overflow: hidden;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-show-section .form-check-label {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sg-mobile .irrigation-tracker-mobile .agro-toolbar-pill .form-check-inline {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        min-height: 32px;
        margin: 0 !important;
        padding: 0;
        white-space: nowrap;
    }
    .sg-mobile .irrigation-tracker-mobile .agro-toolbar-pill .form-check-input {
        position: static;
        float: none;
        flex: 0 0 16px;
        width: 16px;
        height: 16px;
        margin: 0 !important;
    }
    .sg-mobile .irrigation-tracker-mobile .agro-toolbar-pill .form-check-label {
        min-width: 0;
        margin: 0;
        font-size: 0.78rem;
        line-height: 1.15;
        white-space: nowrap;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-view-section .form-check-inline,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-options-section .form-check-inline {
        min-height: 32px;
        margin-right: 0 !important;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-options-section .agro-toolbar-pill > .mb-0 {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px 12px;
        width: 100%;
    }
    .sg-mobile .irrigation-tracker-mobile #irrigation-tracker-display-selection {
        width: 100% !important;
    }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 950px) {
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-resizable-toolbar,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-navbar,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-navbar .container-fluid,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-content,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-controls {
        width: 100%;
        max-width: none;
        min-width: 0;
        box-sizing: border-box;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar {
        display: block;
        padding: 4px 8px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-navbar {
        padding: 4px 8px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 6px 8px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-controls > .agro-toolbar-section {
        display: grid;
        grid-template-columns: 62px minmax(0, 1fr);
        min-height: 50px;
        padding: 3px 7px;
        gap: 6px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-view-section {
        grid-column: 1;
        grid-row: 1;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-toolbar-controls > .irrigation-tracker-chart-view-section {
        grid-template-columns: 130px minmax(0, 1fr) !important;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-chart-view-section {
        grid-column: 2;
        grid-row: 1;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-unit-type-row {
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        gap: 8px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-unit-type-row > .agro-toolbar-section {
        min-height: 50px;
        padding: 3px 8px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-show-section {
        grid-column: 1;
        grid-row: 3;
        grid-template-columns: 54px minmax(0, 1fr) !important;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-options-section {
        grid-column: 2;
        grid-row: 3;
        grid-template-columns: 58px minmax(0, 1fr) !important;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-show-section .agro-toolbar-pill {
        height: auto !important;
        min-height: 72px !important;
        padding: 3px 7px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-show-section .agro-toolbar-pill > .mb-0 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
        width: 100%;
        gap: 0 6px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-show-section .form-check-label,
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-options-section .form-check-label {
        font-size: 0.74rem;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-options-section .agro-toolbar-pill {
        min-height: 72px !important;
        padding: 4px 7px;
    }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-options-section .agro-toolbar-pill > .mb-0 {
        align-content: center;
        gap: 2px 8px;
    }
}

/* Mobile header: the user dropdown becomes a small person button; the menu starts with the user name. */
.sg-user-menu-name {
    display: none;
}
.sg-mobile .sg-user-menu-name {
    display: block;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid #e3ebe6;
    color: #244b36;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}
.sg-mobile #user-menu .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    max-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0 !important;
    border: 1px solid #d6e1da;
    border-radius: 10px;
    background: #fff !important;
    font-size: 0 !important;
    line-height: 0;
    overflow: hidden;
}
.sg-mobile #user-menu .dropdown-toggle::after {
    display: none !important;
}
.sg-mobile #user-menu .dropdown-toggle::before {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23176b50'%3E%3Ccircle cx='12' cy='8' r='4.2'/%3E%3Cpath d='M3.5 21c0-4.7 3.8-7.5 8.5-7.5s8.5 2.8 8.5 7.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Header: the user button sits right next to the other header buttons (same 0.25rem gap). */
.sg-mobile .sg-global-actions-row {
    margin-left: -0.05rem;
}

/* Plot Status: the status date is shown once above the farm cards (hidden elsewhere). */
.ps-status-date {
    display: none;
}
.sg-mobile .ps-mobile-layout .ps-status-date {
    display: block;
    margin: 0 2px 6px;
    color: #6a8575;
    font-size: 0.8rem;
}
.sg-mobile .ps-mobile-layout .ps-farm-date {
    display: none;
}

/* Irrigation Recommendation: the per-unit chart grows with the number of units. */
.sg-mobile .irrigation-recommendation-mobile .ir-chart-card.ir-units-chart-card {
    height: auto !important;
    min-height: 190px;
}
.sg-mobile .irrigation-recommendation-mobile .ir-units-chart-card > .card-body {
    overflow: visible;
}

/* Irrigation Recommendation: smaller measurement pills in the day cards. */
.sg-mobile .irrigation-recommendation-mobile .ir-day-card .pill-container {
    gap: 3px !important;
    padding: 4px 3px !important;
}
.sg-mobile .irrigation-recommendation-mobile .ir-day-card .pill-container > div {
    font-size: 12px !important;
    line-height: 1.2 !important;
    padding: 2px 7px !important;
}

/* Irrigation Recommendation mobile: tighter Plan tools (labels next to fields, aligned checkboxes). */
.sg-mobile .ir-mobile-section .ir-plan-tools { gap: 6px 8px; }
.sg-mobile .ir-mobile-section .ir-select-label {
    min-height: 0;
    margin: 0 0 3px;
    font-size: 11px;
    font-weight: 600;
    color: #405b4b;
}
.sg-mobile .ir-mobile-section .ir-plan-tools > :has(#irrigation-recommendation-follower-checkbox),
.sg-mobile .ir-mobile-section .ir-plan-tools > :has(#irrigation-recommendation-show-salt-wash-checkbox) {
    align-self: center;
}
.sg-mobile .ir-mobile-section .ir-follower-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0;
    font-size: 12px;
    line-height: 1.25;
}
.sg-mobile .ir-mobile-section .ir-follower-checkbox .form-check-input { margin: 0 !important; flex: 0 0 auto; }
.sg-mobile .ir-mobile-section .ir-control-group { padding: 8px 10px; }

/* Irrigation Recommendation mobile: Area / Leader / Follower as three boxes in one row. */
.sg-mobile .ir-mobile-section .ir-info-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
.sg-mobile .ir-mobile-section .ir-info-panel > * { grid-column: 1 / -1; }
.sg-mobile .ir-mobile-section .ir-info-panel > .ir-info-item {
    grid-column: auto;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    text-align: center;
}
.sg-mobile .ir-mobile-section .ir-info-item .ir-info-label { font-size: 12px; white-space: nowrap; }
.sg-mobile .ir-mobile-section .ir-info-item .ir-info-value { font-size: 15px; }

/* Irrigation Recommendation mobile: shorter section headers and tighter spacing between them. */
.sg-mobile .irrigation-recommendation-mobile .ir-header-row {
    gap: 4px !important;
    --bs-gutter-y: 0;
}
.sg-mobile .irrigation-recommendation-mobile .ir-header-row > .ir-mobile-section { margin: 0 !important; border-radius: 10px; }
.sg-mobile .ir-mobile-section > summary {
    min-height: 34px;
    padding: 5px 10px;
    gap: 6px;
    font-size: 15px;
    line-height: 1.2;
}
.sg-mobile .ir-mobile-section > summary > i { font-size: 16px; }
.sg-mobile .irrigation-recommendation-mobile .irrigation-recommendation-header { padding: 4px 8px !important; }


/* Limited Water mobile: compact, designed Settings card (portrait: 2 columns, landscape: 4 columns). */
.sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 8px !important;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch !important;
}
.sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-divider,
.sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-section-label { display: none !important; }
.sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-section {
    display: block !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    grid-column: 1 / -1 !important;
}
.sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-pill {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    min-height: 0 !important;
    gap: 6px !important;
    width: 100%;
    box-sizing: border-box;
}
/* Program: selector + four buttons on one row. */
.sg-mobile .limited-water-page .lw-input-disclosure .lw-program-section .agro-toolbar-pill {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) repeat(4, 36px) !important;
    align-items: center !important;
}
.sg-mobile .limited-water-page .lw-input-disclosure .lw-program-section #limited-water-program-selector { height: 36px !important; width: 100% !important; min-width: 0 !important; }
.sg-mobile .limited-water-page .lw-input-disclosure .lw-program-section .sg-btns {
    width: 36px !important; height: 36px !important; min-width: 36px !important; min-height: 36px !important; padding: 0 !important;
}
/* Settings: small cells, label above the value. */
.sg-mobile .limited-water-page .lw-input-disclosure .lw-settings-section .agro-toolbar-pill {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding: 0 !important;
}
.sg-mobile .limited-water-page .lw-input-disclosure .lw-settings-section .input-group {
    grid-template-rows: auto 26px !important;
    gap: 0 4px !important;
    padding: 4px 8px 3px !important;
    border-radius: 8px !important;
}
.sg-mobile .limited-water-page .lw-input-disclosure .lw-settings-section .input-group > .input-group-text:first-child {
    font-size: 10px !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    text-align: start;
}
.sg-mobile .limited-water-page .lw-input-disclosure .lw-settings-section .input-group > .input-group-text:last-child:not(:first-child) {
    height: 26px !important;
    min-width: 26px !important;
    padding: 0 0 0 5px !important;
    font-size: 11px !important;
}
.sg-mobile .limited-water-page .lw-input-disclosure .lw-settings-section #limited-water-total-water-input,
.sg-mobile .limited-water-page .lw-input-disclosure .lw-settings-section #limited-water-day-max-input,
.sg-mobile .limited-water-page .lw-input-disclosure .lw-settings-section #limited-water-planning-period-input,
.sg-mobile .limited-water-page .lw-input-disclosure .lw-settings-section .sg-datepicker-wrap .DateInput_input {
    height: 26px !important;
    min-height: 26px !important;
    padding: 0 2px !important;
    font-size: 15px !important;
    line-height: 26px !important;
}
/* Options: checkbox and adjust range on one row. */
.sg-mobile .limited-water-page .lw-input-disclosure .lw-options-section .agro-toolbar-pill {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between;
    gap: 4px 12px !important;
}
.sg-mobile .limited-water-page .lw-input-disclosure .lw-options-section .form-check-label { font-size: 13px !important; }
.sg-mobile .limited-water-page .lw-input-disclosure .lw-options-section #limited-water-add-subtract-range { width: 58px !important; min-width: 58px !important; height: 30px !important; }
.sg-mobile .limited-water-page .lw-input-disclosure .lw-options-section .input-group-text { min-height: 30px !important; font-size: 12px !important; padding: 0 4px !important; }
/* Actions row: Save + Area share a row. */
.sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-section.lw-actions-section { grid-column: 1 !important; }
.sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-section.lw-area-section { grid-column: 2 !important; margin: 0 !important; }
.sg-mobile .limited-water-page .lw-input-disclosure #limited-water-save-program-btn { width: 100% !important; height: 38px !important; justify-content: center; font-size: 14px !important; }
.sg-mobile .limited-water-page .lw-input-disclosure .lw-area-badge {
    display: flex !important; align-items: center; justify-content: center;
    width: 100%; height: 38px; box-sizing: border-box; padding: 0 8px !important; font-size: 13px !important; text-align: center;
}
/* Extras under the toolbar (Leader only, Adjust all plant units by day). */
.sg-mobile .limited-water-page .lw-input-disclosure #limited-water-mobile-settings-extras {
    display: grid; gap: 6px; padding: 0 8px 8px;
}
.sg-mobile .limited-water-page .lw-input-disclosure #limited-water-mobile-settings-extras > * {
    margin: 0 !important; padding: 6px 10px !important; min-height: 0 !important; border-radius: 8px;
}
.sg-mobile .limited-water-page .lw-input-disclosure #limited-water-mobile-settings-extras :is(label, .form-check-label, summary) { font-size: 14px !important; }
.sg-mobile .limited-water-page .lw-input-disclosure #limited-water-mobile-settings-extras summary { padding: 2px 0 !important; }
/* Landscape: Program + Options on top, Settings in one row of four, Save + Area below. */
@media (orientation: landscape) and (max-height: 600px) {
    .sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px 10px !important; padding: 6px 8px !important; }
    .sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-section.lw-program-section { grid-column: 1 / 3 !important; grid-row: 1; }
    .sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-section.lw-options-section { grid-column: 3 / 5 !important; grid-row: 1; }
    .sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-section.lw-settings-section { grid-column: 1 / -1 !important; grid-row: 2; }
    .sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-section.lw-actions-section { grid-column: 1 / 3 !important; grid-row: 3; }
    .sg-mobile .limited-water-page .lw-input-disclosure .agro-toolbar-section.lw-area-section { grid-column: 3 / 5 !important; grid-row: 3; }
    .sg-mobile .limited-water-page .lw-input-disclosure .lw-settings-section .agro-toolbar-pill { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
    .sg-mobile .limited-water-page .lw-input-disclosure #limited-water-mobile-settings-extras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Limited Water mobile: date picker (edit state) opens as a centered overlay instead of being clipped by the card. */
.sg-mobile .limited-water-page .lw-input-disclosure,
.sg-mobile .limited-water-page .limited-water-top-navbar,
.sg-mobile .limited-water-page .lw-input-disclosure #limited-water-toolbar-content { overflow: visible !important; }
.sg-mobile .limited-water-page .lw-input-disclosure > summary { border-radius: 12px 12px 0 0; }
.sg-mobile .limited-water-page .lw-settings-section .SingleDatePicker_picker {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    z-index: 3000 !important;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    overflow: auto;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.sg-mobile .limited-water-page .lw-settings-section :is(.DateInput_fang, .DayPickerKeyboardShortcuts_buttonReset, .DayPickerKeyboardShortcuts_show) { display: none !important; }
.sg-mobile .limited-water-page .lw-settings-section .sg-datepicker-wrap :is(.DateInput_input, .DateInput_input__focused) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}
@media (orientation: landscape) and (max-height: 600px) {
    .sg-mobile .limited-water-page .lw-settings-section .SingleDatePicker_picker { transform: translate(-50%, -50%) scale(0.85) !important; }
}

/* Limited Water confirmation / rename modals on phones: use the screen width instead of 25-30vw. */
@media (max-width: 767px), (max-height: 600px) and (pointer: coarse) {
    .modal-dialog:has(#generic-modal-body-limited-water-remove-program),
    .modal-dialog:has(#generic-modal-body-limited-water-purge-programs),
    .modal-dialog:has(#generic-modal-body-limited-water-program-rename) {
        width: calc(100vw - 24px) !important;
        max-width: 440px !important;
        margin: 12px auto !important;
    }
    .modal-dialog:has(#generic-modal-body-limited-water-remove-program) .modal-content,
    .modal-dialog:has(#generic-modal-body-limited-water-purge-programs) .modal-content,
    .modal-dialog:has(#generic-modal-body-limited-water-program-rename) .modal-content { border-radius: 14px; overflow: hidden; }
    .modal-dialog:has(#generic-modal-body-limited-water-remove-program) .modal-header,
    .modal-dialog:has(#generic-modal-body-limited-water-purge-programs) .modal-header,
    .modal-dialog:has(#generic-modal-body-limited-water-program-rename) .modal-header {
        display: flex; align-items: center; gap: 10px;
        padding: 10px 14px !important; flex-wrap: nowrap;
    }
    .modal-dialog:has(#generic-modal-body-limited-water-remove-program) #generic-modal-icon-limited-water-remove-program,
    .modal-dialog:has(#generic-modal-body-limited-water-purge-programs) #generic-modal-icon-limited-water-purge-programs,
    .modal-dialog:has(#generic-modal-body-limited-water-program-rename) #generic-modal-icon-limited-water-program-rename { width: 28px !important; height: 28px !important; flex: 0 0 auto; }
    .modal-dialog:has(#generic-modal-body-limited-water-remove-program) #generic-modal-title-limited-water-remove-program,
    .modal-dialog:has(#generic-modal-body-limited-water-purge-programs) #generic-modal-title-limited-water-purge-programs,
    .modal-dialog:has(#generic-modal-body-limited-water-program-rename) #generic-modal-title-limited-water-program-rename { font-size: 17px !important; line-height: 1.25 !important; margin: 0 !important; }
    .modal-dialog:has(#generic-modal-body-limited-water-remove-program) .modal-body,
    .modal-dialog:has(#generic-modal-body-limited-water-purge-programs) .modal-body,
    .modal-dialog:has(#generic-modal-body-limited-water-program-rename) .modal-body { padding: 12px 14px !important; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
    .modal-dialog:has(#generic-modal-body-limited-water-remove-program) .modal-body ul,
    .modal-dialog:has(#generic-modal-body-limited-water-purge-programs) .modal-body ul,
    .modal-dialog:has(#generic-modal-body-limited-water-program-rename) .modal-body ul { max-height: 45vh; padding-inline-start: 18px; font-size: 14px; }
    .modal-dialog:has(#generic-modal-body-limited-water-remove-program) .modal-footer,
    .modal-dialog:has(#generic-modal-body-limited-water-purge-programs) .modal-footer,
    .modal-dialog:has(#generic-modal-body-limited-water-program-rename) .modal-footer { flex-wrap: nowrap !important; gap: 8px; padding: 8px 14px 12px !important; justify-content: flex-end; }
    .modal-dialog:has(#generic-modal-body-limited-water-remove-program) .modal-footer > .btn,
    .modal-dialog:has(#generic-modal-body-limited-water-purge-programs) .modal-footer > .btn,
    .modal-dialog:has(#generic-modal-body-limited-water-program-rename) .modal-footer > .btn { flex: 1 1 0; margin: 0 !important; min-height: 42px; }
}

/* Irrigation Tracker mobile: compact settings (label above the control, several controls per row). */
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-toolbar-controls {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    align-items: stretch;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .agro-toolbar-divider { display: none !important; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .agro-toolbar-section,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-unit-type-row > .agro-toolbar-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    grid-column: 1 / -1;
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .agro-toolbar-section-label,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-unit-type-row .agro-toolbar-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #60766a;
    white-space: nowrap;
    padding: 0 2px;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .agro-toolbar-pill {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 14px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #d7e1da;
    border-radius: 8px;
    background: #fff;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .agro-toolbar-pill .form-check-inline { margin: 0; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .agro-toolbar-pill .form-check-label { font-size: 13px; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .form-select { height: 38px !important; min-height: 38px !important; font-size: 14px; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-unit-type-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    grid-column: 1 / -1;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-plant-units-section .sg-btns {
    width: 38px !important; min-width: 38px !important; height: 38px !important; min-height: 38px !important;
    justify-self: start;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-view-section { order: 1; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-unit-type-row { order: 2; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-chart-view-section { order: 3; grid-column: auto; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-options-section { order: 4; grid-column: auto; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-toolbar-controls > .agro-toolbar-section:not([class*="irrigation-tracker-"]) { order: 5; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-show-section { order: 6; }

/* Irrigation Tracker mobile: collapsible summary cards. */
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-summary-disclosure {
    margin: 8px 8px 6px;
    border: 1px solid #d5e1d9;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-summary-disclosure > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    background: #eaf3ed;
    color: #315540;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-summary-disclosure > summary::-webkit-details-marker { display: none; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-summary-disclosure > summary::after { content: "\2212"; margin-inline-start: auto; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-summary-disclosure:not([open]) > summary::after { content: "\FF0B"; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-summary-disclosure #irrigation-tracker-total-irrigation-values { padding: 8px !important; gap: 6px !important; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-summary-disclosure .irrigation-tracker-kpi { padding: 6px 10px !important; gap: 1px !important; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-summary-disclosure .irrigation-tracker-kpi-label { font-size: 0.7rem; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-summary-disclosure .irrigation-tracker-kpi-value { font-size: 0.95rem; }

/* Landscape: wider grid so the settings take far less height. */
@media (orientation: landscape) and (max-height: 600px) {
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-toolbar-controls { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px 10px; padding: 6px 8px; }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-view-section { grid-column: span 3; }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-unit-type-row { grid-column: span 5; }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-chart-view-section { grid-column: span 4; }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-show-section { grid-column: span 6; }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-options-section { grid-column: span 4; }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure .irrigation-tracker-toolbar-controls > .agro-toolbar-section:not([class*="irrigation-tracker-"]) { grid-column: span 6; }
    .sg-mobile .irrigation-tracker-mobile .irrigation-tracker-summary-disclosure #irrigation-tracker-total-irrigation-values { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

/* Irrigation Tracker mobile: align the Settings card with the Summary card and the charts (same 8px side margin). */
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-navbar {
    padding: 8px 8px 0 !important;
    margin: 0 !important;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-navbar > .container-fluid,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-navbar .irrigation-tracker-resizable-toolbar,
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-navbar #irrigation-tracker-toolbar-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-input-disclosure { margin: 0 !important; }
.sg-mobile .irrigation-tracker-mobile .irrigation-tracker-body { padding: 0 8px 14px !important; }

/* Satellite mobile redesign (scoped to the controls rows inside the layouts only). */
@media (max-width: 600px) {
    .sg-mobile .satellite-page { padding: 0.4rem 0.4rem 0.5rem !important; }
    .sg-mobile .satellite-page .nav-tabs { scrollbar-width: none; }
    .sg-mobile .satellite-page .nav-tabs::-webkit-scrollbar { display: none; }
    .sg-mobile .satellite-page .nav-tabs .nav-link { padding: 0.4rem 0.75rem; font-size: 14px; }
    .sg-mobile .satellite-page .tab-pane > .card > .card-body { padding: 0.35rem !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row), .sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) { --bs-gutter-x: 0; --bs-gutter-y: 0; margin: 0 !important; align-items: flex-start !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"]:has(> .row), .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"] > .row { display: contents; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"],
.sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) > [class*="col-"], .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"] > .row > [class*="col-"] { padding: 0 !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) [class*="col-"]:has(> [id$="-plant-unit-dd"]), .sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) > [class*="col-"]:has(> [id$="-plant-unit-dd"]) { flex: 0 0 100% !important; max-width: 100% !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) [class*="col-"]:has(> #satview-active-unit-list), .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"] > .row > [class*="col-"]:has(> #satview-active-unit-list) {
        flex: 0 0 100% !important; max-width: 100% !important;
        display: flex; align-items: center; gap: 8px; margin-top: 6px;
    }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) [class*="col-"]:has(> #satview-active-unit-list) .form-label { margin: 0; white-space: nowrap; }
    .sg-mobile .satellite-view-layout #satview-active-unit-list { flex: 1 1 auto; height: 32px; width: auto; min-width: 0; }
    .sg-mobile .satellite-view-layout .satellite-active-unit-button { height: 28px; font-size: 12px; padding: 2px 8px; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"]:has(> [id$="detail-index-dd"]) { flex: 0 0 50% !important; max-width: 50% !important; padding-right: 4px !important; margin-top: 6px; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"]:has(> div > [id$="date-label"]) { flex: 0 0 50% !important; max-width: 50% !important; padding-left: 4px !important; margin-top: 6px; }
    .sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) > [class*="col-"]:has(> div > [id$="date-label"]) { flex: 0 0 100% !important; max-width: 100% !important; margin-top: 6px; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) .form-label,
.sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) .form-label { margin: 0 0 2px; font-size: 11px; font-weight: 600; color: #4a6557; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) [class*="col-"]:has(> div > [id$="date-label"]) > div,
.sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) [class*="col-"]:has(> div > [id$="date-label"]) > div { padding-top: 0 !important; gap: 2px 6px !important; line-height: 1.25; }
    .sg-mobile .satellite-view-layout [id$="date-label"], .sg-mobile .satellite-et-layout [id$="date-label"] { font-size: 14px; }
    .sg-mobile .satellite-view-layout [id$="date-counter"], .sg-mobile .satellite-et-layout [id$="date-counter"] { font-size: 11px; }
    .sg-mobile .satellite-view-layout [id$="data-status"], .sg-mobile .satellite-et-layout [id$="data-status"] { font-size: 10px !important; padding: 2px 7px !important; }
    .sg-mobile .satellite-view-layout .satellite-date-slider-row ,
.sg-mobile .satellite-et-layout .satellite-date-slider-row  { margin: 6px 0 0 !important; --bs-gutter-x: 0; }
    .sg-mobile .satellite-view-layout .satellite-date-slider-row .btn,
.sg-mobile .satellite-et-layout .satellite-date-slider-row .btn { flex: 0 0 30px; width: 30px; height: 30px; padding: 0; line-height: 1; border-radius: 8px; margin: 0 !important; }
    .sg-mobile .satellite-view-layout .satellite-date-slider-row .flex-grow-1,
.sg-mobile .satellite-et-layout .satellite-date-slider-row .flex-grow-1 { padding: 0 10px 0 8px; min-width: 0; }
    .sg-mobile .satellite-view-layout .satellite-date-slider-row [class*="slider-mark"],
.sg-mobile .satellite-et-layout .satellite-date-slider-row [class*="slider-mark"] { font-size: 10px !important; white-space: nowrap; }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 950px) and (pointer: coarse) and (hover: none) {
    .sg-mobile .satellite-page { padding: 0.25rem 0.5rem !important; }
    .sg-mobile .satellite-page .nav-tabs { scrollbar-width: none; }
    .sg-mobile .satellite-page .nav-tabs::-webkit-scrollbar { display: none; }
    .sg-mobile .satellite-page .nav-tabs .nav-link { padding: 0.3rem 0.8rem; font-size: 13px; }
    .sg-mobile .satellite-page .tab-pane > .card > .card-body { padding: 0.3rem !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row), .sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) { --bs-gutter-x: 0; --bs-gutter-y: 0; margin: 0 !important; flex-wrap: nowrap; align-items: flex-start !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"]:has(> .row), .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"] > .row { display: contents; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"],
.sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) > [class*="col-"], .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"] > .row > [class*="col-"] { padding: 0 4px !important; margin: 0 !important; min-width: 0; max-width: none !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) [class*="col-"]:has(> [id$="-plant-unit-dd"]) { flex: 1 1 32% !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) [class*="col-"]:has(> #satview-active-unit-list), .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"] > .row > [class*="col-"]:has(> #satview-active-unit-list) { flex: 0 1 20% !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"]:has(> [id$="detail-index-dd"]) { flex: 0 0 19% !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) > [class*="col-"]:has(> div > [id$="date-label"]) { flex: 0 0 25% !important; }
    .sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) > [class*="col-"]:has(> [id$="-plant-unit-dd"]) { flex: 1 1 62% !important; }
    .sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) > [class*="col-"]:has(> div > [id$="date-label"]) { flex: 0 0 38% !important; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) .form-label,
.sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) .form-label { margin: 0 0 1px; font-size: 10px; font-weight: 600; color: #4a6557; white-space: nowrap; }
    .sg-mobile .satellite-view-layout #satview-active-unit-list { height: 30px; width: 100%; }
    .sg-mobile .satellite-view-layout .satellite-active-unit-button { height: 26px; font-size: 11px; padding: 2px 7px; }
    .sg-mobile .satellite-view-layout > .row:not(.satellite-date-slider-row) [class*="col-"]:has(> div > [id$="date-label"]) > div,
.sg-mobile .satellite-et-layout > .row:not(.satellite-date-slider-row) [class*="col-"]:has(> div > [id$="date-label"]) > div { padding-top: 0 !important; gap: 0 6px !important; line-height: 1.2; }
    .sg-mobile .satellite-view-layout [id$="date-label"], .sg-mobile .satellite-et-layout [id$="date-label"] { font-size: 13px; }
    .sg-mobile .satellite-view-layout [id$="date-counter"], .sg-mobile .satellite-et-layout [id$="date-counter"] { font-size: 10px; }
    .sg-mobile .satellite-view-layout [id$="data-status"], .sg-mobile .satellite-et-layout [id$="data-status"] { font-size: 9px !important; padding: 2px 6px !important; }
    .sg-mobile .satellite-view-layout .satellite-date-slider-row ,
.sg-mobile .satellite-et-layout .satellite-date-slider-row  { margin: 2px 0 0 !important; --bs-gutter-x: 0; }
    .sg-mobile .satellite-view-layout .satellite-date-slider-row .btn,
.sg-mobile .satellite-et-layout .satellite-date-slider-row .btn { flex: 0 0 26px; width: 26px; height: 26px; padding: 0; line-height: 1; border-radius: 7px; margin: 0 !important; }
    .sg-mobile .satellite-view-layout .satellite-date-slider-row .flex-grow-1,
.sg-mobile .satellite-et-layout .satellite-date-slider-row .flex-grow-1 { padding: 0 12px 0 10px; min-width: 0; }
    .sg-mobile .satellite-view-layout .satellite-date-slider-row [class*="slider-mark"],
.sg-mobile .satellite-et-layout .satellite-date-slider-row [class*="slider-mark"] { font-size: 10px !important; white-space: nowrap; }
}

/* Agro Activities Settings modal on phones: label above each control, readable dropdown menu. */
@media (max-width: 950px) and (pointer: coarse) {
    #generic-modal-agro-activities-tab-activities-setting .modal-body { min-height: min(330px, 62dvh); padding: 0.6rem 0.8rem 0.8rem !important; }
    #generic-modal-agro-activities-tab-activities-setting .modal-body hr { margin: 0.6rem 0 !important; opacity: 0.15; }
    #generic-modal-agro-activities-tab-activities-setting .modal-body .input-group { flex-direction: column !important; align-items: stretch !important; flex-wrap: nowrap !important; }
    #generic-modal-agro-activities-tab-activities-setting .modal-body .input-group > .input-group-text {
        max-width: 100% !important; padding: 0 0 4px !important; border: 0 !important; background: transparent !important;
        border-radius: 0 !important; font-size: 12px !important; font-weight: 700; color: #4a6557;
    }
    #generic-modal-agro-activities-tab-activities-setting .modal-body .input-group > div { flex: 0 0 auto !important; width: 100% !important; }
    #generic-modal-agro-activities-tab-activities-setting .modal-body .input-group > div:has(.rc-slider) { padding: 4px 10px 0 !important; }
    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-control { min-height: 38px; font-size: 14px; }
    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-placeholder, #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-value { line-height: 36px; }
    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-menu-outer { max-height: 230px; z-index: 5; }
    #generic-modal-agro-activities-tab-activities-setting .modal-body .Select-menu { max-height: 228px; }
    #generic-modal-agro-activities-tab-activities-setting .modal-body .VirtualizedSelectOption {
        font-size: 13px !important; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        display: flex; align-items: center; padding: 0 10px;
    }
    #generic-modal-agro-activities-tab-activities-setting .modal-body .rc-slider-mark-text { font-size: 12px; }
}

/* Best time for activities modal on phones: full-width fields with the label above. */
@media (max-width: 950px) and (pointer: coarse) {
    #agro-activities-tab-best-time-activities-modal .modal-dialog { width: min(94vw, 620px) !important; max-width: min(94vw, 620px) !important; margin: 0.5rem auto !important; }
    #agro-activities-tab-best-time-activities-modal .modal-header { padding: 0.7rem 0.9rem; }
    #agro-activities-tab-best-time-activities-modal .modal-title { font-size: 1.05rem; }
    #agro-activities-tab-best-time-activities-modal .modal-body { padding: 0.6rem 0.8rem !important; overflow-x: hidden; }
    #agro-activities-tab-best-time-activities-modal .modal-body .container-fluid { padding: 0 !important; }
    #agro-activities-tab-best-time-activities-modal .modal-body .row { margin: 0 0 0.55rem !important; }
    #agro-activities-tab-best-time-activities-modal .modal-body .row > [class*="col-"] { flex: 0 0 100% !important; max-width: 100% !important; padding: 0 !important; }
    #agro-activities-tab-best-time-activities-modal .modal-body .input-group { flex-direction: column !important; align-items: stretch !important; flex-wrap: nowrap !important; }
    #agro-activities-tab-best-time-activities-modal .modal-body .input-group > .input-group-text {
        padding: 0 0 3px !important; border: 0 !important; background: transparent !important;
        border-radius: 0 !important; font-size: 12px !important; font-weight: 700; color: #4a6557;
    }
    #agro-activities-tab-best-time-activities-modal .modal-body .input-group > .form-control,
    #agro-activities-tab-best-time-activities-modal .modal-body .input-group > .dash-dropdown,
    #agro-activities-tab-best-time-activities-modal .modal-body .input-group > .Select { width: 100% !important; border-radius: 6px !important; min-height: 40px; font-size: 14px; }
    #agro-activities-tab-best-time-activities-modal .modal-body .Select-control { min-height: 38px; font-size: 14px; }
    #agro-activities-tab-best-time-activities-modal .modal-body .Select-menu-outer { max-height: 220px; }
    #agro-activities-tab-best-time-activities-modal .modal-body .VirtualizedSelectOption { font-size: 13px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #agro-activities-tab-best-time-activities-modal .modal-footer { padding: 0.6rem 0.8rem; gap: 0.5rem; flex-wrap: nowrap; }
    #agro-activities-tab-best-time-activities-modal .modal-footer .btn { flex: 1 1 0; min-width: 0; min-height: 44px; margin: 0 !important; }
}

/* Finance on phones: use the full visible width and keep every control inside it. */
@media (max-width: 950px) {
    .sg-mobile .finance-mobile { width: 100% !important; max-width: 100% !important; padding: 0.4rem 0.5rem 1rem !important; overflow-x: clip; }
    .sg-mobile .finance-mobile > .row { margin: 0 !important; --bs-gutter-x: 0; width: 100%; }
    .sg-mobile .finance-mobile > .row > [class*="col-"] { padding: 0 !important; flex: 0 0 100%; max-width: 100%; width: 100%; }
    .sg-mobile .finance-mobile #finance-tabs, .sg-mobile .finance-mobile #finance-tabs > .tab-content, .sg-mobile .finance-mobile #finance-tabs .tab-pane { width: 100%; max-width: 100%; min-width: 0; }
    .sg-mobile .finance-mobile .nav-tabs { flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
    .sg-mobile .finance-mobile .nav-tabs::-webkit-scrollbar { display: none; }
    .sg-mobile .finance-mobile .nav-tabs .nav-link { flex: 0 0 auto; white-space: nowrap; padding: 0.45rem 0.7rem; font-size: 14px; }
    .sg-mobile .finance-mobile .finance-budget-tabs > .tab-content { padding-top: 8px; }
    .sg-mobile .finance-mobile .finance-budget-workspace { gap: 0.5rem; }
    .sg-mobile .finance-mobile .finance-budget-hero { padding: 10px 12px; gap: 10px; }
    .sg-mobile .finance-mobile .finance-budget-hero-icon { flex: 0 0 36px; height: 36px; font-size: 1rem; }
    .sg-mobile .finance-mobile .finance-budget-hero h4 { font-size: 1.15rem; margin-bottom: 2px; }
    .sg-mobile .finance-mobile .finance-budget-hero p, .sg-mobile .finance-mobile .finance-budget-hero .text-muted { font-size: 0.85rem; margin: 0; line-height: 1.3; }
    .sg-mobile .finance-mobile .card > .card-body, .sg-mobile .finance-mobile .finance-budget-card > .card-body { padding: 10px !important; }
    .sg-mobile .finance-mobile .finance-budget-heading h5 { font-size: 1.05rem; }
    .sg-mobile .finance-mobile .finance-budget-controls-row { flex-direction: column !important; align-items: stretch !important; gap: 8px; width: 100%; }
    .sg-mobile .finance-mobile .finance-budget-selection-summary { width: 100%; }
    .sg-mobile .finance-mobile .finance-budget-summary-content { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .sg-mobile .finance-mobile .finance-budget-summary-item { min-width: 0; min-height: 0; padding: 6px 8px; }
    .sg-mobile .finance-mobile .finance-budget-summary-label { font-size: 0.7rem; }
    .sg-mobile .finance-mobile .finance-budget-summary-value { font-size: 0.92rem; overflow-wrap: anywhere; }
    .sg-mobile .finance-mobile .finance-budget-actions { display: flex; flex-direction: column; width: 100%; gap: 6px !important; }
    .sg-mobile .finance-mobile .finance-budget-button-group { display: flex !important; flex-wrap: wrap; gap: 4px; width: 100%; max-width: 100%; padding: 4px; }
    .sg-mobile .finance-mobile .finance-budget-button-group > .btn {
        flex: 1 1 0; min-width: 0; margin: 0 !important; border-radius: 7px !important;
        min-height: 40px; padding: 0.35rem 0.4rem; font-size: 0.8rem;
        white-space: normal !important; line-height: 1.15; text-align: center;
    }
    .sg-mobile .finance-mobile .finance-budget-button-group > .btn .bi { margin-right: 0.3rem !important; font-size: 0.95rem; }
    .sg-mobile .finance-mobile .finance-budget-filter-group > .btn, .sg-mobile .finance-mobile .finance-budget-related-group > .btn { flex: 1 1 100%; }
    .sg-mobile .finance-mobile .finance-budget-table-wrap { width: 100%; max-width: 100%; height: calc(100dvh - 260px) !important; min-height: 320px !important; }
    .sg-mobile .finance-mobile .finance-budget-table-wrap .dash-spreadsheet-container { overflow-x: auto !important; }
    .sg-mobile .finance-mobile .finance-report-filters-card .card-body { padding: 0.6rem 0.7rem !important; }
    .sg-mobile .finance-mobile .finance-report-filters-card .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
    .sg-mobile .finance-mobile .finance-report-content-card > .card-body { max-height: none; }
    .sg-mobile .finance-mobile .finance-report-chart { height: 50vh !important; min-height: 320px !important; }
    .sg-mobile .finance-mobile .js-plotly-plot, .sg-mobile .finance-mobile .plot-container, .sg-mobile .finance-mobile .svg-container, .sg-mobile .finance-mobile .dash-graph { max-width: 100% !important; }
}
@media (max-width: 600px) {
    .sg-mobile .finance-mobile .finance-budget-button-group:not(.finance-budget-filter-group):not(.finance-budget-related-group) > .btn { flex: 1 1 0; }
}
