/* Presentation only. Desktop dashboards, saved layouts and control permissions stay shared. */
/* Fixed squares must not stretch with a row or shrink under narrow-screen pressure. */
.avatar{box-sizing:border-box;flex-shrink:0;aspect-ratio:1;border-radius:50%;padding:0}
@media(max-width:700px){
  .topbar .avatar{flex:0 0 32px!important;width:32px!important;min-width:32px!important;max-width:32px!important;height:32px!important;min-height:32px!important;max-height:32px!important;align-items:center;justify-content:center;line-height:1}
  #app .emi-fleet-alarm{display:inline-flex;flex:0 0 44px;align-items:center;justify-content:center;box-sizing:border-box;width:44px;min-width:44px;max-width:44px;height:44px;min-height:44px;max-height:44px;padding:0;border-radius:50%;aspect-ratio:1;line-height:1}
}
.emi-app-access svg{width:20px;height:20px}.emi-app-access{padding:7px!important;min-width:36px}#emi-mobile-nav{display:none}
.emi-mobile-dialog{width:min(640px,96vw);max-width:640px;max-height:90dvh;padding:0;border:1px solid var(--line,#294158);border-radius:12px;background:var(--panel,#0b1b2d);color:var(--text,#edf5ff)}.emi-mobile-dialog::backdrop{background:#020b16bb}.emi-mobile-dialog>header{position:sticky;top:0;z-index:2;background:var(--panel,#0b1b2d);padding:16px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line,#294158)}.emi-mobile-dialog h2{font-size:19px;margin:0;font-weight:550}.emi-mobile-dialog h3{font-size:17px;margin:0 0 10px}.emi-mobile-settings{padding:20px}.emi-mobile-settings p{font-size:14px;line-height:1.6;color:var(--muted,#9fb6cb)}.emi-mobile-settings section{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid var(--line,#294158)}.emi-mobile-settings a{color:var(--cyan,#13bce3)}.emi-mobile-settings fieldset{padding:12px;margin:16px 0;border:1px solid var(--line,#294158);border-radius:8px}.emi-mobile-settings legend{padding:0 6px;font-size:14px}.emi-mobile-check{display:flex;gap:12px;align-items:center;min-height:44px;font-size:15px}.emi-mobile-check input{min-width:20px;width:20px;height:20px;accent-color:#12bce3}.emi-mobile-times{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:12px 0}.emi-mobile-buttons{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0 8px}.emi-mobile-settings .field{display:flex;flex-direction:column;gap:7px}.emi-mobile-settings :is(select,input[type=time]){font-size:16px;min-height:44px;width:100%;background:var(--bg,#0c2135);color:inherit;border:1px solid var(--line,#294158);border-radius:6px;padding:8px}.emi-mobile-device{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 0}.emi-mobile-device small{display:block;color:var(--muted,#9fb6cb);font-size:12px}.emi-mobile-settings #emi-mobile-status{color:#51d2a0}.emi-mobile-settings #emi-mobile-status.error{color:#ff8496}
@media(max-width:700px){
  html{scroll-padding-top:90px;scroll-padding-bottom:90px}body{-webkit-text-size-adjust:100%;text-size-adjust:100%;overscroll-behavior-y:none}
  .shell{min-width:0!important;width:100%!important;padding-top:0!important}.workspace{min-width:0!important;margin-left:0!important}.content{padding:18px 12px calc(84px + env(safe-area-inset-bottom))!important;min-width:0!important;max-width:100vw;overflow-x:clip}
  .topbar{height:auto!important;min-height:60px!important;gap:8px!important;flex-wrap:wrap;padding:calc(6px + env(safe-area-inset-top)) 10px 6px!important;position:sticky!important;top:0!important;z-index:65!important;max-width:100vw;box-sizing:border-box}.topbar-left{gap:8px!important;min-width:0;flex:1}.topbar-brand img{width:116px!important;max-width:116px!important}.topbar-brand small,.breadcrumb,.topbar .date-tag,.topbar .simulation-pill,.topbar .user-identity,.topbar .user-account-chevron{display:none!important}.topbar-actions{gap:4px!important;flex:none!important}.topbar .connection-chip{font-size:10px!important;gap:4px;padding:4px!important;white-space:nowrap}.topbar .connection-chip.offline{font-size:10px!important;max-width:90px;white-space:normal}.topbar .emi-app-access{display:none}.topbar .avatar{display:flex!important;font-size:12px!important;width:32px!important;height:32px!important}.user-account summary{min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center}.topbar-plant{flex:1 1 100%;min-width:0!important;width:100%!important}.topbar-plant input{width:100%!important}.plant-search-results{width:100%!important;max-height:50dvh}.sidebar-toggle{min-width:44px!important;min-height:44px!important;flex:none}.user-account-panel{position:fixed!important;right:12px!important;left:auto!important;top:calc(64px + env(safe-area-inset-top))!important;width:min(330px,calc(100vw - 24px))!important;max-width:calc(100vw - 24px)}
  .sidebar{top:calc(64px + env(safe-area-inset-top))!important;bottom:calc(65px + env(safe-area-inset-bottom))!important;width:min(320px,88vw)!important;height:auto!important;z-index:64!important;overflow-y:auto!important;padding:18px!important}.sidebar-footer{position:static!important;margin-top:24px}.sidebar .nav a{min-height:48px;font-size:15px!important;display:flex!important}.sidebar .nav a span{display:inline!important}.sidebar .nav-label{display:block!important}.mobile-mask{z-index:63!important}.shell.sidebar-collapsed .sidebar{transform:translateX(-100%)}.shell.menu-open .sidebar{transform:translateX(0)!important}.sidebar-collapsed .sidebar .nav-label,.sidebar-collapsed .sidebar .nav span{display:block!important}
  #emi-mobile-nav{display:flex;align-items:stretch;justify-content:space-around;position:fixed;left:0;right:0;bottom:0;z-index:70;padding:5px max(4px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left));background:var(--panel,#0b1b2d);border-top:1px solid var(--line,#294158);box-shadow:0 -8px 24px #020b1622}#emi-mobile-nav :is(a,button){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:54px;min-height:50px;padding:4px 5px;color:var(--muted,#9fb6cb);text-decoration:none;font:11px/1.2 system-ui;background:transparent;border:0;border-radius:7px}#emi-mobile-nav svg{width:22px;height:22px}#emi-mobile-nav [aria-current=page]{color:var(--cyan,#13bce3);background:#0bbce414}
  :is(button,.btn,input,select,textarea){touch-action:manipulation}.btn,button:not(.chart-legend-item){min-height:44px}input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{font-size:16px!important;max-width:100%;min-height:44px}input[type=checkbox],input[type=radio]{min-width:20px;width:20px;height:20px}h1{font-size:23px!important;line-height:1.3!important}.page-heading,.overview-header,.page-header{gap:12px;flex-wrap:wrap}.page-actions,.toolbar,.filter-bar,.chart-toolbar{flex-wrap:wrap!important;gap:8px!important;max-width:100%}.muted,.hint{line-height:1.5}
  .installation-tabs,.site-tabs,[role=tablist]{max-width:100%;overflow-x:auto!important;flex-wrap:nowrap!important;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scroll-snap-type:x proximity}.installation-tabs>*,.site-tabs>*,[role=tablist]>*{flex-shrink:0;min-height:44px;scroll-snap-align:start}#app .dashboard-canvas{width:100%!important;max-width:100%!important;min-width:0!important;gap:12px!important;display:flex!important;flex-direction:column!important;height:auto!important}#app .dashboard-canvas>.dashboard-widget{position:relative!important;inset:auto!important;transform:none!important;width:100%!important;min-width:0!important;max-width:100%!important;flex:none!important;margin:0!important}.dashboard-widget{border-radius:10px!important}.dashboard-widget:has([data-native-kind=work]),.dashboard-widget:has([data-native-kind=status]){min-height:150px!important}.widget-head{min-height:44px}.widget-head h2,.widget-head h3{font-size:13px!important;white-space:normal!important}.table-wrap,.emi-table-scroll{max-width:100%;overflow:auto!important;-webkit-overflow-scrolling:touch;scrollbar-width:thin}.data-table{font-size:13px!important}.data-table th{font-size:11px!important}.data-table td{padding-top:13px!important;padding-bottom:13px!important}.fleet-operation-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}.fleet-operation-grid strong{font-size:22px!important;line-height:1.3!important;font-weight:450!important}.fleet-operation-grid .operation-tile{min-width:0!important}.fleet-overview .section-label{font-size:12px!important}
  dialog{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;margin:auto!important;box-sizing:border-box}.dialog-grid,.form-grid{grid-template-columns:1fr!important}.dialog-actions{position:sticky;bottom:0;background:var(--panel,#0b1b2d);padding:12px 0;gap:8px;flex-wrap:wrap}.emi-mobile-dialog{width:calc(100vw - 16px)!important}.emi-mobile-dialog>header{padding:12px}.emi-mobile-settings{padding:16px}.emi-mobile-buttons{flex-direction:column}.emi-mobile-buttons .btn{width:100%}.emi-mobile-dialog h2{font-size:17px}.toast-region{bottom:calc(75px + env(safe-area-inset-bottom))!important;max-width:calc(100vw - 24px)!important}
  .technical-chart,.chart-card,.market-chart,.financial-workspace{min-width:0!important;max-width:100%!important}.technical-chart-toolbar,.market-toolbar{flex-wrap:wrap!important}.chart-fullscreen,.technical-fullscreen{max-width:100dvw!important;padding:8px!important}.financial-flow-grid{grid-template-columns:1fr!important}.emi-native-tile{min-width:0!important}.emi-schedule-summary{min-width:0!important}
}
@media(prefers-reduced-motion:reduce){#emi-mobile-nav *, .emi-mobile-dialog *{scroll-behavior:auto!important;transition:none!important}}
@media(max-width:700px){
  #app .table-wrap .data-table{min-width:760px!important}
  #app .table-wrap .alarm-table{min-width:980px!important}
}
@media(min-width:360px) and (max-width:700px){
  #app .dashboard-canvas{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:auto!important;align-items:stretch!important}
  #app .dashboard-canvas>.dashboard-widget{grid-column:1/-1!important;grid-row:auto!important}
  #app .dashboard-canvas>.dashboard-widget[data-inline-title=true][data-presentation=status],
  #app .dashboard-canvas>.dashboard-widget[data-inline-title=true][data-presentation=meter],
  #app .dashboard-canvas>.dashboard-widget:has([data-native-kind=performance]){grid-column:auto!important;min-height:150px!important;height:150px!important;max-height:150px!important}
  .emi-summary-grid{gap:10px!important}.emi-operation-tile{min-width:0!important}.emi-operation-value .emi-summary-number{font-size:19px!important;line-height:1.3!important;font-weight:450!important}
}

/* Retained pages remain hidden at every responsive breakpoint. */
#app [data-overview-deck] > [data-dashboard-id][hidden],
#app .dashboard-canvas[hidden]{display:none!important}
.scada-phone-toolbar{display:none}
.emi-scada-history.scada-fullscreen-fallback{position:fixed!important;inset:0!important;z-index:2147483000!important;width:100vw!important;height:100dvh!important;max-width:none!important;background:var(--panel,#19263b)}
@media(max-width:700px){
  /* The summary scrolls with the installations list and map. */
  #app .emi-fleet-summary-sticky{position:static!important;top:auto!important;max-height:none!important;overflow:visible!important;overscroll-behavior:auto!important;box-shadow:none!important;z-index:auto!important}
  #app .dashboard-widget:has(.emi-scada-history){height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}
  #app .dashboard-widget:has(.emi-scada-history) .widget-body{height:auto!important;min-height:0!important;overflow:visible!important}
  #app .emi-scada-history,.emi-scada-history.scada-phone{height:auto!important;min-height:0!important;max-height:none!important;min-width:0!important;width:100%!important;box-sizing:border-box;padding:8px!important;overflow:visible!important;gap:8px!important}
  .scada-phone .scada-phone-toolbar{display:flex;flex-direction:column;gap:8px}
  .scada-phone-range{display:flex;align-items:center;gap:5px;min-width:0}
  .scada-phone-range output{flex:1;min-width:0;font-size:12px;line-height:1.3;text-align:center;overflow-wrap:anywhere}
  .scada-phone .scada-phone-range button{padding:6px 9px;flex:none;font-size:12px}
  .scada-phone .scada-phone-options{max-width:96px;white-space:normal}
  .scada-phone-actions{display:flex;gap:6px;align-items:center}
  .scada-phone .scada-phone-actions button{min-height:44px;min-width:44px;padding:6px 10px;font-size:12px}
  .scada-phone-actions [data-action=fullscreen]{margin-left:auto}
  .scada-phone:not(.scada-phone-options-open) > :is(.scada-range-toolbar,.scada-range-slot,.scada-display-toolbar){display:none!important}
  .scada-phone.scada-phone-options-open > :is(.scada-range-toolbar,.scada-range-slot,.scada-display-toolbar){border:1px solid var(--line,#294158);border-radius:6px;padding:8px;box-sizing:border-box;max-width:100%;min-width:0;flex-wrap:wrap}
  .scada-phone .scada-range-toolbar .segmented{display:flex;width:100%;overflow-x:auto}
  .scada-phone .scada-range-toolbar .segmented button{flex:1;padding:6px;font-size:11px}
  .scada-phone :is(.scada-range-toolbar,.scada-display-toolbar)>label{display:flex;align-items:center;gap:6px;min-width:0;max-width:100%}
  .scada-phone .scada-range-toolbar>label{flex:1 1 130px}
  .scada-phone .scada-range-toolbar input{width:100%;min-width:0}
  .scada-phone .scada-chart-actions{flex-wrap:wrap;margin-left:0;gap:6px}
  .scada-phone .scada-chart-actions button{flex:1}
  .scada-phone :is(select,input){min-width:0}
  .scada-phone .scada-plot{height:340px!important;min-height:340px!important;max-height:none!important;flex:0 0 340px!important;touch-action:pan-y pinch-zoom}
  .scada-phone .scada-plot:not(.scada-pan-enabled) :is(canvas,div){touch-action:pan-y pinch-zoom!important}
  .scada-phone .scada-plot.scada-pan-enabled{touch-action:none}
  .scada-phone .scada-navigation-row{flex-direction:column;align-items:flex-start;gap:3px;font-size:10px}
  .scada-phone .scada-visible-range{white-space:normal;text-align:left}
  .scada-phone .scada-load-row,.scada-phone .scada-chart-status{font-size:10px;line-height:1.4}
  .scada-phone .scada-compact-legend{max-height:92px;gap:4px;overflow-y:auto}
  .scada-phone .scada-compact-legend button{min-height:36px!important;font-size:11px;padding:4px 7px}
  .scada-phone .scada-series-panel{max-height:340px;flex:none}
  .scada-phone .scada-series-panel summary{min-height:44px;padding:12px 0;box-sizing:border-box}
  .scada-phone .scada-series-row{min-width:0;grid-template-columns:22px 32px minmax(0,1fr)!important}
  .scada-phone .scada-series-row input[type=text]{min-width:0;width:100%}
  .scada-phone .scada-cursor-overlay{max-width:100%}
  #app .emi-scada-history:is(:fullscreen,.scada-fullscreen-fallback){height:100dvh!important;overflow-y:auto!important;padding:calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom))!important;overscroll-behavior:contain}
  .emi-scada-history:is(:fullscreen,.scada-fullscreen-fallback) .scada-plot{height:max(300px,50dvh)!important;min-height:max(300px,50dvh)!important;flex-basis:max(300px,50dvh)!important}
  .emi-finance-workspace .fw-visualization:is(:fullscreen,.fw-fullscreen-fallback){display:block!important;height:100dvh!important;overflow-y:auto!important;padding:calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom))!important}
  .emi-finance-workspace .fw-flows{grid-template-columns:1fr!important}
  .emi-finance-workspace .fw-visualization:is(:fullscreen,.fw-fullscreen-fallback) .fw-playback{height:auto!important;min-height:0!important;overflow:visible!important;margin-top:12px}
  .emi-finance-workspace .fw-visualization:is(:fullscreen,.fw-fullscreen-fallback) .fw-flow-diagram{height:260px!important;flex:none!important}
}
