/* Medical advertising guide: keep decision fields readable inside the workspace. */
html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage .mag-check-grid {
  min-width: 0 !important;
  width: 100% !important;
}

html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage .mag-check-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage .mag-check-grid > label,
html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage .mag-critical-check {
  position: static !important;
  min-width: 0 !important;
  width: auto !important;
}

/* Restore the original form/result two-column layout. */
html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage .mag-decision-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, .75fr) !important;
  align-items: start !important;
}

html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage .mag-decision-result {
  position: sticky !important;
  top: 18px !important;
}

/* The guide's title is floated by the shared form style. Clear that float so
   the specialty controls start on a new, full-width line inside the fieldset. */
html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage .mag-segment.specialty {
  clear: both !important;
  float: none !important;
  position: static !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  width: 100% !important;
  margin-top: 12px !important;
}

/* Scope the repair to "진료영역과 심의기구" and override inherited offsets. */
html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage #magDecisionForm fieldset:nth-of-type(3) {
  display: block !important;
}

html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage #magDecisionForm fieldset:nth-of-type(3) > .mag-segment.specialty {
  clear: both !important;
  box-sizing: border-box !important;
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* "게재 매체" label was also flowing beside the floated legend. */
html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage #magDecisionForm fieldset:nth-of-type(2) > .mag-field {
  clear: both !important;
  float: none !important;
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage #magDecisionForm fieldset:nth-of-type(2) > .mag-field > select {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* The shared form style floats every legend.  Clear that float for every
   real fieldset child so labels, selects and button groups cannot flow to
   the far right of the section. */
html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage #magDecisionForm fieldset > :not(legend) {
  clear: both !important;
}

html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage #magDecisionForm fieldset:nth-of-type(2) > .mag-field {
  position: static !important;
}

html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage .mag-segment.specialty > button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: static !important;
  float: none !important;
  inset: auto !important;
  transform: none !important;
  min-width: 0 !important;
}

@media (max-width: 720px) {
  html body #app main.app-shell section.content div.workspace #medicalAdvertisingGuidePage .mag-check-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

}
