/* Processing stations use one full-width browse/detail flow on smartphones. */
.processing-compact-toolbar { display: none; }

/* The app grid already gives #main exactly the space between the top bar,
   activity strip and navigation. Use that box, including keyboard/orientation
   changes, rather than sizing a nested fixed drawer from the full viewport. */
html.gom-compact #main:has(.processing-workbench-window) {
  contain: layout;
  overflow: clip;
}

html.gom-compact .location-scene-drawer.processing-workbench-window {
  position: fixed !important;
  inset: 6px max(6px, env(safe-area-inset-right)) 6px max(6px, env(safe-area-inset-left)) !important;
  display: block;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  transform: none !important;
}
html.gom-compact .processing-window-shell {
  isolation: isolate;
  grid-template-rows: auto minmax(0, 1fr);
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  background: var(--mg-surface-window);
}
/* The decorative GoM frame sits outside the scrolling content. Its side
   strips must stay visible above sticky controls, including while scrolling. */
html.gom-compact .processing-window-shell > .mg-frame-art { z-index: 10; }
html.gom-compact .processing-window-head { min-height: 56px; padding: 8px 12px; gap: 8px; cursor: default; box-sizing: border-box; background: var(--mg-surface-chrome); }
html.gom-compact .processing-window-title { min-width: 0; gap: 9px; flex: 1 1 auto; }
html.gom-compact .processing-window-title img { width: 30px; height: 30px; flex: 0 0 auto; }
html.gom-compact .processing-window-title h3 { min-width: 0; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
html.gom-compact .processing-window-head .gom-close-icon { position: static !important; inset: auto !important; flex: 0 0 44px; width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important; margin: 0; padding: 0; transform: none !important; }
html.gom-compact .processing-window-body { overflow: hidden; box-sizing: border-box; min-width: 0; padding: 0 7px 7px; }
html.gom-compact .processing-window-body .processing-ui { min-width: 0; min-height: 0; }
html.gom-compact .processing-workbench {
  display: block;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  background: var(--mg-surface-window);
}
html.gom-compact .processing-compact-toolbar { display: flex; position: sticky; top: 0; z-index: 5; gap: 8px; align-items: stretch; min-width: 0; max-width: 100%; box-sizing: border-box; padding: 8px 10px; border-bottom: 1px solid var(--mg-border-muted); background: var(--mg-surface-chrome); }
html.gom-compact .processing-compact-toolbar button { min-width: 0; min-height: 44px; margin: 0; padding: 8px 12px; font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
html.gom-compact [data-processing-compact-filters] { flex: 1 1 auto; text-align: left; }
html.gom-compact [data-processing-compact-filters] span { display: block; margin-top: 3px; font-size: 12px; line-height: 1.3; color: var(--mg-text-muted); }
html.gom-compact .processing-workbench[data-compact-view="recipes"] [data-processing-compact-back] { display: none; }
html.gom-compact .processing-workbench > .processing-view-options { display: flex; padding: 10px 12px; }
html.gom-compact .processing-workbench[data-compact-filters-open="false"] > :is(.processing-workbench-sidebar, .processing-view-options) { display: none; }
html.gom-compact .processing-workbench-sidebar { display: flex; height: auto; max-height: none; min-height: 0; padding: 12px; overflow: visible; scrollbar-gutter: auto; border-right: 0; border-bottom: 1px solid var(--mg-border-muted); background: var(--mg-surface-panel); }
html.gom-compact .processing-search { min-height: 44px; flex: 0 0 auto; box-sizing: border-box; }
html.gom-compact .processing-search input { height: 44px; font-size: 16px; }
html.gom-compact .processing-workbench :is(.processing-filter-list, .processing-category-list) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
html.gom-compact .processing-workbench :is(.processing-filter-list, .processing-category-list) button { min-width: 0; min-height: 44px; height: auto; margin: 0; font-size: 14px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
html.gom-compact .processing-category-list button { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 5px; }
html.gom-compact .processing-workbench-recipes { display: block; height: auto; border-right: 0; }
html.gom-compact .processing-workbench-recipes > header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); min-width: 0; min-height: 54px; height: auto; padding: 8px 12px; gap: 8px; }
html.gom-compact .processing-workbench-recipes select { min-height: 44px; height: auto; min-width: 0; max-width: 145px; font-size: 16px; box-sizing: border-box; }
html.gom-compact .processing-recipe-list { height: auto; overflow: visible; scrollbar-gutter: auto; padding: 8px; }
html.gom-compact .processing-recipe-list-row { grid-template-columns: minmax(0, 1fr) 44px; }
html.gom-compact .processing-window-shell .processing-recipe-button { grid-template-columns: 44px minmax(0, 1fr); min-height: 72px; height: auto; padding: 10px 8px; gap: 9px; }
html.gom-compact .processing-recipe-copy { gap: 4px; }
html.gom-compact .processing-recipe-copy :is(strong, small) { white-space: normal; text-overflow: clip; overflow: visible; overflow-wrap: anywhere; line-height: 1.35; }
html.gom-compact .processing-recipe-copy strong { font-size: 15px; }
html.gom-compact .processing-recipe-copy small { font-size: 12px; }
html.gom-compact .processing-window-shell .processing-favorite { min-width: 44px; min-height: 44px; }
html.gom-compact .processing-workbench-detail { display: block; height: auto; min-height: 0; overflow: visible; padding: 0; }
html.gom-compact .processing-workbench[data-compact-view="recipes"] .processing-detail-scroll { display: none; }
html.gom-compact .processing-workbench[data-compact-view="detail"] .processing-workbench-recipes { display: none; }
html.gom-compact .processing-workbench :is(.processing-detail-scroll, .processing-recipe-detail-layout, .processing-detail-config-scroll) { display: block; height: auto; max-height: none; min-height: 0; width: 100%; min-width: 0; padding: 0; overflow: visible; box-sizing: border-box; scrollbar-gutter: auto; }
html.gom-compact .processing-workbench .processing-detail-fixed-header { padding: 12px 12px 0; background: var(--mg-surface-panel); }
html.gom-compact .processing-workbench .processing-recipe-hero-main { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: start; }
html.gom-compact .processing-workbench .processing-recipe-hero-icon { width: 52px; height: 52px; min-height: 52px; box-sizing: border-box; }
html.gom-compact .processing-workbench .processing-recipe-hero-icon :is(img, .item-composite-icon) { max-width: 44px; max-height: 44px; }
html.gom-compact .processing-workbench .processing-recipe-hero h3 { font-size: 21px; line-height: 1.25; overflow-wrap: anywhere; }
html.gom-compact .processing-workbench .processing-recipe-hero-copy p { display: block; font-size: 14px; overflow: visible; line-height: 1.45; -webkit-line-clamp: unset; }
html.gom-compact .processing-workbench .processing-recipe-hero-copy dl { grid-template-columns: minmax(0, 1fr); gap: 5px; font-size: 13px; }
html.gom-compact .processing-workbench .processing-recipe-hero-copy dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
html.gom-compact .processing-workbench .processing-recipe-hero-copy :is(dt, dd) { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
html.gom-compact .processing-workbench .processing-recipe-hero-copy dt { min-width: 0; }
html.gom-compact .processing-workbench .processing-recipe-hero-copy dd { flex: 0 0 auto; }
html.gom-compact .processing-workbench .processing-detail-section { min-width: 0; padding: 12px; }
html.gom-compact .processing-workbench .processing-detail-action-dock { display: grid; grid-template-columns: minmax(0, 1fr); height: auto; padding: 12px; gap: 10px; background: var(--mg-surface-chrome); }
html.gom-compact .processing-workbench .processing-detail-action-dock .processing-quantity-row { display: flex; flex-wrap: wrap; gap: 8px; }
html.gom-compact .processing-workbench :is(.processing-quantity-controls, .processing-quantity-presets) { flex-wrap: wrap; gap: 6px; }
html.gom-compact .processing-workbench :is(button, input:not([type="checkbox"]):not([type="radio"]), select) { min-height: 44px !important; max-width: 100%; box-sizing: border-box; }
html.gom-compact .processing-workbench button { min-width: 44px; }
html.gom-compact .processing-workbench :is(input:not([type="checkbox"]):not([type="radio"]), select) { font-size: 16px; }
html.gom-compact .processing-workbench .processing-quantity-input { width: 80px; height: 44px; }
html.gom-compact .processing-workbench .processing-detail-action-summary { grid-template-columns: minmax(0, 1fr); }
html.gom-compact .processing-workbench .processing-detail-action-summary .crafting-duration-estimate { font-size: 13px; padding: 8px; }
html.gom-compact .processing-workbench .processing-detail-quantity-line > label { position: static; width: auto; height: auto; clip-path: none; font-size: 13px; }
html.gom-compact .processing-workbench .cooking-mobile-back { display: none; }
html.gom-compact .processing-workbench .processing-queue-panel { max-height: none; height: auto; overflow: visible; flex: none; }
html.gom-compact .processing-workbench .processing-queue-toggle { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
html.gom-compact .processing-workbench .processing-queue-toggle strong { min-width: 0; }
html.gom-compact .processing-workbench .processing-queue-toggle > span { flex: 0 0 auto; }
html.gom-compact .processing-workbench .processing-queue-list { max-height: none; overflow: visible; }
html.gom-compact .processing-workbench .processing-queue-body { max-height: none; overflow: visible; }
html.gom-compact .processing-workbench .processing-queue-panel.is-collapsed .processing-queue-body { display: none; }
html.gom-compact .processing-workbench .processing-queue-stop { min-width: 64px; font-size: 13px; }
html.gom-compact .processing-workbench :is(.mysticism-ingredient-slots, .mysticism-fixed-ingredient-slots, .processing-quantity-presets) { flex-wrap: wrap; }
html.gom-compact .processing-workbench :is(.mysticism-binding-card, .smithing-detail-material-selector, .craft-mastery-option, .ingredients) { min-width: 0; max-width: 100%; box-sizing: border-box; }
