/*
 * MATAMET responsive recovery 1.4.2
 * Route-specific corrections only. This file deliberately avoids global width,
 * height, button and grid overrides so application breakpoints remain intact.
 */

/* Application pages should end with their content rather than an artificial 55vh floor. */
body.matamet-route--analysis .site-main,
body.matamet-route--materials-library .site-main,
body.matamet-route--metallurgy .site-main,
body.matamet-route--sustainability .site-main,
body.matamet-route--steel-lab .site-main,
body.matamet-route--market-intelligence .site-main,
body.matamet-route--markets .site-main {
  min-height: 0 !important;
  min-block-size: 0 !important;
}
body.matamet-route--sustainability :where(.page-shell, .entry-content, .isw-shell, .isw-view.is-active),
body.matamet-route--steel-lab :where(.page-shell, .entry-content, #immes-steel-virtual-lab, .svl-app, .svl-home-main) {
  min-height: 0 !important;
  min-block-size: 0 !important;
}
body.matamet-route--sustainability .site-footer,
body.matamet-route--steel-lab .site-footer { margin-top: 0 !important; }

/* Analysis: filters use a predictable grid. Text can wrap inside its own control. */
.immes-analysis-root .ia-library-head {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px) !important;
  gap: clamp(24px, 4vw, 56px) !important;
  align-items: end !important;
}
.immes-analysis-root .ia-filters {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: 9px !important;
  overflow: visible !important;
  padding-block: 18px 24px !important;
}
.immes-analysis-root .ia-filter {
  inline-size: 100% !important;
  min-inline-size: 0 !important;
  max-inline-size: none !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.2 !important;
  text-align: center !important;
  padding: 10px 12px !important;
}

/* Sustainability: compact close, no orphaned internal-note blocks. */
body.matamet-route--sustainability .isw-shell {
  padding-bottom: 18px !important;
  margin-bottom: 0 !important;
}
body.matamet-route--sustainability .isw-view.is-active { height: auto !important; }
body.matamet-route--sustainability .isw-workspace-footer {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  min-height: 0 !important;
  margin-top: 18px !important;
  padding: 14px 0 0 !important;
  border-top: 1px solid var(--matamet-rule) !important;
}
body.matamet-route--sustainability .isw-workspace-footer:empty,
body.matamet-route--sustainability :where(.isw-note-band, .isw-result, .isw-module):empty { display: none !important; }

/* Steel Lab: exact selected palette and natural document height. */
body.matamet-route--steel-lab #immes-steel-virtual-lab {
  --svl-ink: #151719 !important;
  --svl-muted: #696E6E !important;
  --svl-blue: #123F46 !important;
  --svl-blue-2: #2F6268 !important;
  --svl-blue-soft: #DDE7E5 !important;
  --svl-orange: #C7653B !important;
  --svl-orange-soft: #E8DDD2 !important;
  --svl-line: #D8D1C7 !important;
  --svl-line-2: #E8DDD2 !important;
  --svl-panel: #FEFDF9 !important;
  --svl-bg: #F6F3EC !important;
  background: #F6F3EC !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab :where(.svl-app, .svl-home-main, .svl-content) {
  height: auto !important;
  min-height: 0 !important;
  min-block-size: 0 !important;
  background: #F6F3EC !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-main {
  max-width: 1440px !important;
  padding: 20px clamp(14px, 2vw, 26px) 24px !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab :where(.svl-home-library-section, .svl-home-path, .svl-card) {
  background: #FEFDF9 !important;
  border-color: #D8D1C7 !important;
  box-shadow: none !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-family-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-family {
  background: #FEFDF9 !important;
  border-color: #D8D1C7 !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-family > header {
  min-height: 66px !important;
  background: #E8DDD2 !important;
  border-bottom-color: #D8D1C7 !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-family > header > span { color: #C7653B !important; }
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-family header h2,
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-library-section h2 { color: #123F46 !important; }
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-family button {
  min-height: 68px !important;
  background: #FEFDF9 !important;
  border-bottom-color: #D8D1C7 !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-family button:hover,
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-family button:focus-visible {
  background: #DDE7E5 !important;
  box-shadow: inset 3px 0 0 #C7653B !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-process-code,
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-process-icon {
  background: #DDE7E5 !important;
  color: #123F46 !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab :where(.svl-topbar, .svl-sidebar, .svl-tabs) {
  background: #FEFDF9 !important;
  border-color: #D8D1C7 !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-process-link:hover { background: #DDE7E5 !important; }
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-process-link.is-active {
  background: #E8DDD2 !important;
  color: #123F46 !important;
  box-shadow: inset 3px 0 0 #C7653B !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-tabs button.is-active {
  color: #123F46 !important;
  border-bottom-color: #C7653B !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab :where(.svl-primary-action, .svl-home-actions .svl-primary-action) {
  background: #123F46 !important;
  border-color: #123F46 !important;
  color: #fff !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab :where(.svl-secondary-action, .svl-mini-action) {
  background: #FEFDF9 !important;
  border-color: #2F6268 !important;
  color: #123F46 !important;
}
body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-note:empty { display: none !important; }

/* The desktop sidebar may be sticky, but it must not create the document height. */
@media (min-width: 1025px) {
  body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-sidebar {
    height: auto !important;
    max-height: calc(100svh - 110px) !important;
    align-self: start !important;
  }
}

@media (max-width: 1180px) {
  .immes-analysis-root .ia-library-head { grid-template-columns: 1fr !important; }
  body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 720px) {
  .immes-analysis-root .ia-filters { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body.matamet-route--steel-lab #immes-steel-virtual-lab .svl-home-family-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 440px) {
  .immes-analysis-root .ia-filters { grid-template-columns: 1fr !important; }
}
