.mobile-bottom-nav { display: none; }
.mobile-menu-sheet { width: min(600px, 100%); max-width: 100%; max-height: 85dvh; margin: auto auto 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); border: 1px solid #fff; border-radius: 28px 28px 0 0; background: #f2f8f5; color: #183e45; overflow-y: auto; overscroll-behavior: contain; }
.mobile-menu-sheet::backdrop { background: #143e4560; backdrop-filter: blur(4px); }
body:has(.mobile-menu-sheet[open]) { overflow: hidden; }
.mobile-sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mobile-sheet-heading h2 { margin: 0; }
.mobile-sheet-heading button { min-width: 44px; min-height: 44px; }
.mobile-search { display: grid; gap: 8px; margin: 20px 0; }
.mobile-search input { width: 100%; font-size: 16px; }
.mobile-menu-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.mobile-menu-grid button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 14px 12px; min-height: 70px; border: 1px solid #d7e6e2; border-radius: 18px; background: white; color: #31565d; font: inherit; overflow-wrap: anywhere; }
.mobile-menu-grid button[hidden] { display: none; }
.mobile-menu-grid button[aria-current] { background: #d9f1e9; border-color: #17867d; color: #096c65; }
.mobile-menu-grid .nav-icon { flex-shrink: 0; }
.mobile-account { display: grid; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #cddfda; }
@media (max-width: 1023px) {
  .app-shell { display: grid; grid-template-columns: minmax(0,1fr); padding: 12px; gap: 16px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .sidebar { position: relative; top: auto; height: auto; min-width: 0; padding: 16px; border-radius: 24px; overflow: visible; }
  .sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
  .sidebar .wordmark { font-size: 23px; padding: 0; }
  .sidebar > .nav, .sidebar > .sidebar-footer { display: none; }
  .farm-menu { width: min(55%, 350px); min-width: 0; }
  .farm-menu-panel { left: auto; right: 0; width: min(400px, calc(100vw - 56px)); max-height: 65dvh; overflow-y: auto; z-index: 30; }
  .main { min-width: 0; padding: 0; }
  #workspace { min-width: 0; }
  .mobile-bottom-nav { display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 8px max(6px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)); background: #f7fcf9f5; border-top: 1px solid #d4e6df; box-shadow: 0 -6px 24px #164c4510; backdrop-filter: blur(16px); }
  .mobile-bottom-nav button { flex: 1; min-width: 0; min-height: 54px; padding: 4px 2px; border: 0; border-radius: 14px; background: transparent; color: #59757b; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 10px; line-height: 1.2; overflow-wrap: anywhere; }
  .mobile-bottom-nav button[aria-current] { color: #087970; background: #e0f3eb; }
  .mobile-bottom-nav .nav-icon { width: 25px; height: 25px; padding: 2px; background: transparent; box-shadow: none; }
  .mobile-more-icon { font-size: 22px; height: 25px; line-height: 20px; }
  .pwa-install { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }
  input, select, textarea { font-size: 16px; }
  .table-wrap, .table-scroll { max-width: 100%; overflow-x: auto; }
}
@media (max-width: 540px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .sidebar-top { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
  .farm-menu { width: 100%; }
  .sidebar .wordmark { font-size: 22px; }
  .workspace-heading h1 { font-size: 28px; overflow-wrap: anywhere; }
  .panel, .editor-panel { padding: 16px; }
  .form-grid, .settings-grid { grid-template-columns: minmax(0,1fr); }
  .dialog-card { padding: 16px; }
  .dashboard-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dashboard-main-grid > * { min-width: 0; overflow-wrap: anywhere; }
  .mobile-menu-sheet { padding-left: 14px; padding-right: 14px; }
}
