/* UXC5.60.71.58 — correction of application-wide mobile shell and Agenda.
   Scope: screen/mobile only. Desktop, printing, functional contracts and economy untouched. */
.l2-mobile-nav-button{display:none!important}
@media screen and (max-width: 767px) {
  .l2-mobile-nav-button{display:inline-flex!important;align-items:center;justify-content:center}
  html { -webkit-text-size-adjust: 100%; }
  body.ux541-system #l2-app.ux-app,
  body.ux541-system #l2-app.ux-app.ux-collapsed {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow:visible !important;
  }
  body.ux541-system #l2-app > .main {
    min-width:0 !important; width:100% !important; max-width:100% !important;
    margin:0 !important; display:block !important;
  }
  body.ux541-system #l2-app > .ux-sidebar {display:none !important;}
  body.ux541-system.l2-mobile-nav-open #l2-app > .ux-sidebar {
    display:flex !important; position:fixed !important; z-index:1201 !important;
    left:0 !important;top:0 !important;bottom:0 !important;
    width:min(85vw,328px) !important;height:100dvh !important;
    overflow-y:auto !important; overscroll-behavior:contain !important;
    padding:18px 14px max(18px,env(safe-area-inset-bottom)) !important;
    background:#13263d !important; box-shadow:15px 0 50px rgba(12,30,50,.34) !important;
  }
  body.ux541-system.l2-mobile-nav-open #l2-app > .ux-sidebar .ux-brand-copy,
  body.ux541-system.l2-mobile-nav-open #l2-app > .ux-sidebar .ux-nav-label {display:block !important;}
  body.ux541-system.l2-mobile-nav-open #l2-app > .ux-sidebar .ux-primary-nav {display:grid !important;grid-template-columns:1fr !important;gap:3px !important;}
  body.ux541-system.l2-mobile-nav-open #l2-app > .ux-sidebar .nav-link {display:grid !important;grid-template-columns:24px minmax(0,1fr) !important;min-height:44px !important;}
  body.ux541-system.l2-mobile-nav-open #l2-app > .ux-sidebar .ux-sidebar-footer{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;}
  body.ux541-system .ux-topbar {
    display:grid !important;grid-template-columns:auto minmax(0,1fr) !important;
    align-items:center !important; gap:10px !important; position:relative !important;
    top:auto !important; width:100% !important; max-width:100% !important;
    height:auto !important; min-height:58px !important;
    padding:9px 12px !important; box-sizing:border-box !important;
    overflow:visible !important;
  }
  body.ux541-system .ux-topbar .l2-mobile-nav-button {grid-column:1; min-width:52px;min-height:44px;padding:8px 10px;flex-shrink:0;z-index:1;font-size:13px;}
  body.ux541-system .ux-topbar .ux-topbar-search {
    grid-column:2 !important;grid-row:1 !important;order:0 !important;
    display:block !important; min-width:0 !important; max-width:none !important;
    width:100% !important; flex:none !important;
  }
  body.ux541-system .ux-topbar .ux-search-form {width:100% !important;min-width:0 !important;max-width:100% !important;display:flex !important;gap:8px !important;box-sizing:border-box !important;}
  body.ux541-system .ux-topbar #ux-global-search {width:100% !important; min-width:0 !important; flex:1 !important; font-size:16px !important; padding:0 !important;}
  body.ux541-system .ux-topbar .ux-search-form kbd {display:none !important;}
  body.ux541-system .ux-topbar .top-actions {display:none !important;}
  body.ux541-system .ux-content {
    box-sizing:border-box!important; width:100%!important; max-width:100%!important;
    min-width:0!important; margin:0!important; padding:14px 12px 36px!important;
  }
  body.ux541-system .ux-content > .ux-local-nav,
  body.ux541-system .ux-content > nav.ux-local-nav {
    display:flex!important; max-width:100%!important; width:100%!important;
    overflow-x:auto!important; overflow-y:hidden!important; flex-wrap:nowrap!important;
    margin:0 0 16px!important; padding:0 0 5px!important;
    position:relative!important; z-index:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  body.ux541-system .ux-content > .ux-local-nav a {min-height:44px!important; flex:0 0 auto!important;white-space:nowrap!important;}
  body.ux541-system .screen-shell {box-sizing:border-box!important;min-width:0!important; width:100%!important;max-width:100%!important;margin:0!important;}
  body.ux541-system .screen-shell .lovable-home-grid,
  body.ux541-system .screen-shell .lovable-kpi-grid {min-width:0!important;width:100%!important;max-width:100%!important;}
  body.ux541-system .screen-shell .page-head {min-width:0!important;max-width:100%!important;}
  body.ux541-system .screen-shell .page-head h2{overflow-wrap:anywhere;max-width:100%!important;}
  body.ux541-system .screen-shell .lovable-kpi {min-width:0!important;max-width:100%!important;}
  .l2-mobile-nav-shade{position:fixed;inset:0;z-index:1200;background:rgba(8,23,44,.46);display:none;}
  body.l2-mobile-nav-open .l2-mobile-nav-shade{display:block;}
  body.l2-mobile-nav-open{overflow:hidden;}
  .l2-mobile-nav-account {display:grid;gap:6px;padding:12px 8px 4px;border-top:1px solid rgba(255,255,255,.16)}
  .l2-mobile-nav-account .l2-mobile-nav-context {font-size:12px;color:#d8e9fa;overflow-wrap:anywhere}
  .l2-mobile-nav-account a{color:#fff!important;text-decoration:none;display:flex;align-items:center;min-height:44px;padding:9px 12px;border-radius:8px;font-weight:650}
  .l2-mobile-nav-account a:focus-visible,.l2-mobile-nav-account a:hover{background:#294765;outline:2px solid #9bccff;outline-offset:2px}
  /* Agenda uses a full-width calendar; no phantom desktop rail or narrow 2-column grid. */
  body.route-agenda .ux592-calendar-window.ux714-apple-calendar,
  body.route-agenda .ux592-calendar-window {
    display:block!important; width:100%!important; max-width:100%!important;
    min-width:0!important; height:auto!important; min-height:0!important;
    overflow:visible!important; border-radius:12px!important;
    box-sizing:border-box!important;
  }
  body.route-agenda .ux592-calendar-sidebar{display:none!important;}
  body.route-agenda .ux592-calendar-main {
    display:flex!important; flex-direction:column!important; align-items:stretch!important;
    width:100%!important;max-width:100%!important; min-width:0!important;
    min-height:0!important; box-sizing:border-box!important;
  }
  body.route-agenda .ux592-calendar-main > :is(.ux592-month-calendar,.ux592-month-grid,.ux592-calendar-appbar,.ux592-period-head,.ux714-mobile-daylist,.ux714-mobile-strip,.ux592-day-agenda,.ux671-week-calendar,.ux592-year-calendar) {
    box-sizing:border-box!important;min-width:0!important;width:100%!important;max-width:100%!important;
  }
  body.route-agenda .ux592-month-calendar {display:flex!important;flex-direction:column!important;align-self:stretch!important;}
  body.route-agenda .ux592-month-grid,
  body.route-agenda .ux592-month-weekdays {display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr))!important;width:100%!important;}
  body.route-agenda .ux592-month-grid > * {min-width:0!important;}
  body.route-agenda .ux714-apple-calendar .ux592-calendar-appbar {box-sizing:border-box!important;width:100%!important;max-width:100%!important;}
  body.route-agenda .ux714-apple-calendar .ux592-view-switch{min-width:0!important;width:100%!important;gap:2px!important;}
  body.route-agenda .ux714-apple-calendar .ux592-view-switch a{min-width:0!important;}
  body.route-agenda .ux592-period-head h2 {font-size:20px!important;overflow-wrap:anywhere;}
  body.route-agenda .ux714-mobile-daylist{box-sizing:border-box!important;width:100%!important;min-width:0!important;}
  body.route-agenda .ux714-mobile-daylist-head{flex-wrap:wrap!important;}
  body.route-agenda .ux592-agenda-form :is(input,select,textarea){font-size:16px!important;min-width:0!important;max-width:100%!important;}
  body.route-agenda .ux592-agenda-drawer{box-sizing:border-box!important;max-width:100vw!important;}
  body.route-agenda .ux592-year-calendar{grid-template-columns:1fr!important;}
  body.route-agenda .ux671-week-calendar{overflow-x:auto!important;}
  body.route-agenda .l2-agenda-mobile-actions,
  body.route-agenda .l2-agenda-legend,
  body.route-agenda .l2-agenda-sync-health {box-sizing:border-box; width:100%;max-width:100%;min-width:0;}
  body.route-agenda .l2-agenda-mobile-actions {display:flex;flex-wrap:wrap;gap:8px;padding:12px;border-bottom:1px solid #edf0f4;background:#fff;}
  body.route-agenda .l2-agenda-mobile-actions a {display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:9px 12px;border:1px solid #d9e4ef;border-radius:9px;color:#205578;text-decoration:none;font-size:13px;font-weight:700;}
  body.route-agenda .l2-agenda-mobile-actions a:focus-visible{outline:2px solid #0a84ff;outline-offset:2px;}
  body.route-agenda .l2-agenda-legend{padding:12px;margin-top:6px;}
  body.route-agenda .l2-agenda-legend .l2-agenda-legend-items {display:flex;gap:9px;flex-wrap:wrap;}
  body.route-agenda .l2-agenda-sync-health{padding:10px 12px;font-size:12px;}
}
@media screen and (min-width:768px) {
  .l2-agenda-mobile-actions{display:none!important;}
}
.l2-agenda-legend{background:#fff;border-top:1px solid #e6edf3;color:#475569;}
.l2-agenda-legend>strong{display:block;font-size:12px;margin-bottom:7px;}
.l2-agenda-legend-items{display:flex;flex-wrap:wrap;gap:10px;font-size:11px;}
.l2-agenda-legend-items span{display:inline-flex;align-items:center;gap:6px;}
.l2-agenda-legend-items .ux637-type-chip::before{content:none!important;}
.l2-agenda-legend-items .ux637-type-chip i{display:inline-block;width:7px;height:7px;background:currentColor;border-radius:50%;flex:0 0 auto;}
.l2-agenda-sync-health{background:#f7fbff;border-bottom:1px solid #dce9f4;color:#425971;display:flex;gap:10px;align-items:center;flex-wrap:wrap;line-height:1.45;}
.l2-agenda-sync-health a{color:#135d8c;text-decoration:underline;font-weight:700;}
@media print {.l2-mobile-nav-button,.l2-mobile-nav-shade,.l2-mobile-nav-account,.l2-agenda-mobile-actions{display:none!important}}
