/* Application-only responsive layout; desktop and submission rules stay unchanged. */
@media ((max-width: 900px) and (not ((hover: hover) and (pointer: fine)))) {
  #view-logic-apply { min-width: 0; }
  #lgApplyForm, #lgApplyForm fieldset { box-sizing: border-box; min-width: 0; }
  #lgApplyForm .lg-basic .lg-q-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  #lgApplyForm .lg-apply-school,
  #lgApplyForm .lg-field:has([name="studentPhone"]),
  #lgApplyForm .lg-field:has([name="mockEnglishGrade"]) { grid-column: 1 / -1; }
  #lgApplyForm .lg-basic .lg-field > span { min-height: 0; display: block; margin-bottom: 6px; line-height: 1.4; }
  #lgApplyForm .lg-basic input, #lgApplyForm select { width: 100%; min-width: 0; box-sizing: border-box; }
}

@media ((max-width: 640px) and (not ((hover: hover) and (pointer: fine)))) {
  #view-logic-apply > .lg-head { margin: 12px 0; }
  #lgApplyHeading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0; font-size: 21px; line-height: 1.4; }
  #lgApplyHeading .lg-role-badge { font-size: 12px; padding: 5px 8px; }
  #lgApplyForm.lg-form { padding: 16px 12px; border-radius: 12px; }
  #lgApplyForm .lg-q { margin-bottom: 18px; padding-bottom: 16px; }
  #lgApplyForm .lg-q legend { max-width: 100%; box-sizing: border-box; font-size: 15px; line-height: 1.5; }
  #lgApplyForm .lg-basic > legend { background: #edf4fc; color: #234775; border-radius: 6px; padding: 3px 8px; }
  #lgApplyForm .lg-basic .lg-q-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 12px 10px; }
  #lgApplyForm .lg-basic .lg-field > span { font-size: 13px; font-weight: 700; }
  #lgApplyForm .lg-field input[type="text"],
  #lgApplyForm .lg-field input[type="tel"],
  #lgApplyForm .lg-field select {
    min-height: 44px; height: 44px; padding: 10px; border: 1px solid #bdcadd;
    border-radius: 7px; font-family: inherit; font-size: 16px; line-height: 1.35; background: #fff; color: #18283e;
  }
  #lgApplyForm .lg-field input:focus-visible, #lgApplyForm select:focus-visible { outline: 2px solid #527fb3; outline-offset: 2px; }
  #lgApplyForm .lg-basic .lg-guardian-field { padding: 8px; border-radius: 7px; }
  #lgApplyForm .lg-school-hint { display: block; margin-top: 4px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
  #lgApplySchools { left: 0; right: 0; width: auto; min-width: 0; max-width: 100%; max-height: min(240px, 40dvh); box-sizing: border-box; }
  #lgApplySchools li { min-height: 44px; box-sizing: border-box; padding: 10px 8px; line-height: 1.5; overflow-wrap: anywhere; }
  #lgApplySchools li small { display: block; margin: 0; }
  #lgApplyForm .lg-role-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #lgApplyForm .lg-role-options label:first-child { grid-column: 1 / -1; }
  #lgApplyForm .lg-role-options span { min-height: 44px; box-sizing: border-box; font-size: 14px; }
  #lgApplyForm .lg-feedback .lg-field > span { font-size: 13px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
  #lgApplyForm .lg-agreement { padding: 4px 10px 10px; margin-bottom: 14px; }
  #lgApplyForm .lg-agreement .lg-opt { padding: 9px 0; min-height: 44px; box-sizing: border-box; gap: 9px; font-size: 14px; line-height: 1.65; }
  #lgApplyForm .lg-opt input[type="checkbox"] { width: 20px; height: 20px; min-width: 20px; margin: 2px 0 0; accent-color: #315b9d; }
  #lgApplyForm .lg-opt > span { min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
  #lgApplyForm .lg-agreement-all .lg-opt { padding: 12px; font-size: 14px; }
  #lgApplyForm .lg-refund-copy { line-height: 1.65; }
  #lgApplyForm .lg-refund-line + .lg-refund-line { margin-top: 6px; }
  #lgApplyForm .lg-q-note { font-size: 12px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
  #lgApplyForm .lg-consult-notice { padding: 9px 10px; font-size: 13px; }
  #lgApplyForm .lg-form-foot { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 12px; }
  #lgApplyNote { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
  #lgApplyNote:empty { display: none; }
  #lgApplySubmit { width: 100%; min-height: 48px; margin: 0; padding: 12px; font-size: 16px; border-radius: 8px; }
  #lgTypeDialog { width: calc(100% - 24px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px; }
  #lgTypeDialog h2 { font-size: 16px; line-height: 1.5; }
  #lgTypeQuestion { font-size: 18px; }
  #lgTypeDialog .lg-dialog-actions,
  #lgTypeDialog .lg-dialog-actions:has([data-account-action]:not([hidden])) { display: flex; flex-direction: column; gap: 8px; }
  #lgTypeDialog .lg-dialog-actions button { width: 100%; min-height: 44px; box-sizing: border-box; white-space: normal; line-height: 1.5; }
  #lgApplyDone { padding: 24px 14px; }
}

@media ((max-width: 360px) and (not ((hover: hover) and (pointer: fine)))) {
  #lgApplyForm .lg-basic .lg-guardian-field { grid-column: 1 / -1; }
}

#view-logic-apply .lg-application-account { padding: 22px 18px; border: 1px solid #cfdbeb; border-radius: 12px; }
#view-logic-apply .lg-application-account h2 { margin: 0 0 8px; font-size: 18px; }
#view-logic-apply .lg-application-account p { line-height: 1.6; color: #52647b; }
#view-logic-apply .lg-application-account button { min-height: 44px; margin: 4px 6px 0 0; padding: 10px 16px; }
