/* Auto-Health keeps the same draft, category and save handlers in Compact mode. */
.auto-health-category-counts { display: none; }
html.gom-compact #autoHealthOverlay {
  position: fixed;
  inset: 0;
  height: var(--compact-viewport-height, 100dvh);
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) calc(var(--compact-nav-height, 66px) + env(safe-area-inset-bottom) + 6px) max(6px, env(safe-area-inset-left));
  align-items: stretch;
  justify-content: stretch;
  box-sizing: border-box;
}
html.gom-compact #autoHealthOverlay .auto-health-card {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  padding: 14px;
  gap: 12px;
  box-sizing: border-box;
  zoom: 1;
}
html.gom-compact #autoHealthOverlay .auto-health-header { min-width: 0; gap: 10px; align-items: start; justify-content: space-between; }
html.gom-compact #autoHealthOverlay .auto-health-header > div { min-width: 0; }
html.gom-compact #autoHealthOverlay .auto-health-header h3 { overflow-wrap: anywhere; }
html.gom-compact #autoHealthOverlay [data-auto-health-close] { width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex: 0 0 44px; }
html.gom-compact #autoHealthOverlay .auto-health-body { padding-right: 2px; scrollbar-gutter: auto; touch-action: pan-y; }
html.gom-compact #autoHealthOverlay .auto-health-grid { grid-template-columns: minmax(0, 1fr); }
html.gom-compact #autoHealthOverlay :is(.auto-health-category,.auto-health-category-header,.auto-health-category-body,.auto-health-food-row) { min-width: 0; box-sizing: border-box; }
html.gom-compact #autoHealthOverlay .auto-health-category-header { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 8px; padding: 8px; }
html.gom-compact #autoHealthOverlay .auto-health-category-toggle { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; white-space: normal; }
html.gom-compact #autoHealthOverlay .auto-health-category-label { flex: 1 1 100px; min-width: 0; overflow-wrap: anywhere; }
html.gom-compact #autoHealthOverlay :is(.auto-health-category-summary,.auto-health-category-label--available) { display: none; }
html.gom-compact #autoHealthOverlay .auto-health-category-counts { display: inline; flex: 0 0 auto; margin-left: auto; color: var(--mg-text-main); font-variant-numeric: tabular-nums; white-space: nowrap; }
html.gom-compact #autoHealthOverlay .auto-health-category-blocked-count { color: var(--mg-text-muted); }
html.gom-compact #autoHealthOverlay .auto-health-category-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; min-width: 0; }
html.gom-compact #autoHealthOverlay .auto-health-category-actions button { min-width: 0; min-height: 44px; padding: 8px; white-space: normal; overflow-wrap: anywhere; }
html.gom-compact #autoHealthOverlay .auto-health-category-body { max-height: none; overflow: visible; padding: 0 8px 8px; }
html.gom-compact #autoHealthOverlay .auto-health-food-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 44px 44px;
  grid-template-areas: "icon name block priority" "icon meta block priority" ". badge block priority";
  gap: 4px 6px;
  align-items: center;
  padding: 8px;
}
html.gom-compact #autoHealthOverlay .auto-health-food-icon { grid-area: icon; width: 32px; height: 32px; }
html.gom-compact #autoHealthOverlay .auto-health-food-name { grid-area: name; min-width: 0; overflow-wrap: anywhere; white-space: normal; font-size: 13px; line-height: 1.3; }
html.gom-compact #autoHealthOverlay .auto-health-food-meta { grid-area: meta; min-width: 0; white-space: normal; overflow-wrap: anywhere; font-size: 12px; }
html.gom-compact #autoHealthOverlay .auto-health-priority-badge { grid-area: badge; justify-self: start; min-width: 0; min-height: 20px; padding: 1px 5px; }
html.gom-compact #autoHealthOverlay .auto-health-block-toggle { grid-area: block; display: grid; place-items: center; width: 44px; min-height: 44px; cursor: pointer; }
html.gom-compact #autoHealthOverlay .auto-health-block-label { display: none; }
html.gom-compact #autoHealthOverlay .auto-health-block-mark { width: 22px; height: 22px; box-sizing: border-box; }
html.gom-compact #autoHealthOverlay .auto-health-block-toggle:focus-within { outline: 2px solid var(--mg-brass); outline-offset: 1px; }
html.gom-compact #autoHealthOverlay [data-auto-health-priority-add] { grid-area: priority; display: grid; place-items: center; width: 44px; min-width: 44px; min-height: 44px; padding: 0; font-size: 20px; }
html.gom-compact #autoHealthOverlay .auto-health-priority-row { min-width: 0; align-items: center; }
html.gom-compact #autoHealthOverlay .auto-health-priority-row > span { min-width: 0; overflow-wrap: anywhere; }
html.gom-compact #autoHealthOverlay [data-auto-health-priority-remove] { width: 44px; min-width: 44px; min-height: 44px; padding: 0; }
html.gom-compact #autoHealthOverlay :is(.auto-health-toggle,.auto-health-unit-switch button,[data-auto-health-save]) { min-height: 44px; }
html.gom-compact #autoHealthOverlay .auto-health-grid input { min-height: 44px; font-size: 16px; }
