/* V160 final rendered-screen repair.
   Light surfaces, their foregrounds, and the selected state move together.
   This block is intentionally last because several legacy feature sheets still
   carry dark !important declarations. */
@media screen{
  /* A page-level header rule in the original academy stylesheet must never
     size or pin headers that live inside cards and dialogs. */
  body.app-academy.app-academy.app-academy main :where(section,article,div,details)>header,
  body.app-academy.app-academy.app-academy .modal :where(section,article,div,details)>header,
  body.app-academy.app-academy.app-academy .modal>.dialog>header{
    position:static!important;
    inset:auto!important;
    width:auto!important;
    height:auto!important;
    min-height:0!important;
    box-shadow:none!important;
  }

  /* Guardian vehicle period tabs: unmistakable selected state, including
     assistive-technology state kept in sync by app.js. */
  body.app-guardian.app-guardian.app-guardian [data-vehicle-request-editor] .vehicle-scope-tabs{
    gap:10px!important;
    padding:5px!important;
    border-width:1px!important;
    border-style:solid!important;
    border-radius:15px!important;
  }
  body.app-guardian.app-guardian.app-guardian [data-vehicle-request-editor] .vehicle-scope-tabs button{
    position:relative!important;
    display:grid!important;
    place-items:center!important;
    gap:3px!important;
    min-height:62px!important;
    padding:10px 8px!important;
    border-width:2px!important;
    border-style:solid!important;
    box-shadow:none!important;
  }
  body.app-guardian.app-guardian.app-guardian [data-vehicle-request-editor] .vehicle-scope-tabs button.active,
  body.app-guardian.app-guardian.app-guardian [data-vehicle-request-editor] .vehicle-scope-tabs button[aria-selected="true"]{
  }
  body.app-guardian.app-guardian.app-guardian [data-vehicle-request-editor] .vehicle-scope-tabs button.active::after,
  body.app-guardian.app-guardian.app-guardian [data-vehicle-request-editor] .vehicle-scope-tabs button[aria-selected="true"]::after{
    content:"✓ 선택됨";
    font-size:11px!important;
    font-weight:900!important;
    letter-spacing:.02em!important;
  }
  body.app-guardian.app-guardian.app-guardian :where(
    .request-types button.active,.session-buttons button.active,.route-option.active,
    .survey-modes button.on,.guardian-request-choice button.active
  ){
  }
  body.app-guardian.app-guardian.app-guardian :where(
    .request-types button.active,.session-buttons button.active,.route-option.active,
    .survey-modes button.on,.guardian-request-choice button.active
  ) :where(b,strong,span,small){
  }
  body.app-guardian.app-guardian.app-guardian [data-vehicle-request-editor] .same-schedule{
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    min-height:56px!important;
    margin:0!important;
    padding:14px!important;
    border-width:1px!important;
    border-style:solid!important;
    border-radius:13px!important;
    font-weight:850!important;
  }
  body.app-guardian.app-guardian.app-guardian [data-vehicle-request-editor] .same-schedule input{
    flex:0 0 auto!important;
    width:22px!important;
    height:22px!important;
    min-height:22px!important;
    margin:0!important;
  }

  /* Public academy card and guardian state chips may not keep a legacy dark
     surface after the page text switches to dark ink. */
  body.app-guardian.app-guardian.app-guardian .public-brand{
  }
  body.app-guardian.app-guardian.app-guardian .public-brand h2{
  }
  body.app-guardian.app-guardian.app-guardian .public-brand p{
  }
  body.app-guardian.app-guardian.app-guardian :where(
    .guardian-event-card>header,.guardian-event-application>header
  ){
    min-height:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  body.app-guardian.app-guardian.app-guardian .guardian-event-status.open{
  }
  body.app-guardian.app-guardian.app-guardian :where(.guardian-event-status.closed,.guardian-event-status.archived){
  }
  body.app-guardian.app-guardian.app-guardian .guardian-event-application>header strong{
  }
  body.app-guardian.app-guardian.app-guardian .guardian-event-application.confirmed>header strong{
  }
  body.app-guardian.app-guardian.app-guardian .guardian-event-application.cancelled>header strong{
  }
  body.app-guardian.app-guardian.app-guardian .request-item .status{
    border-width:1px!important;
    border-style:solid!important;
  }
  body.app-guardian.app-guardian.app-guardian .request-item.approved .status{
  }
  body.app-guardian.app-guardian.app-guardian .request-item.cancellation-requested .status{
  }
  body.app-guardian.app-guardian.app-guardian .program-inquiry button{
    min-height:52px!important;
    border-width:2px!important;
    border-style:solid!important;
  }
  body.app-guardian.app-guardian.app-guardian #managerPreview{
    padding-bottom:calc(96px + env(safe-area-inset-bottom))!important;
  }
  body.app-guardian.app-guardian.app-guardian #managerPreview .program-intro-topbar{
    position:static!important;
  }

  /* Event colors are owned by warm-light-v153.css. */
  body.app-academy.app-academy.app-academy #events :where(
    .event-summary-grid article,.event-toolbar,.event-program-card,.event-detail,
    .event-applicant-card,.event-application-table,.event-workspace-panel
  ){
  }
  body.app-academy.app-academy.app-academy #events :where(
    .event-count-row span,.event-card-meta span,.event-applicant-note,
    .event-finance-box,.event-registration-loading,.event-empty
  ){
  }
  body.app-academy.app-academy.app-academy #events :where(
    .event-program-heading h3,.event-detail-heading h2,.event-count-row b,
    .event-card-meta b,.event-applicant-head b,.event-applicant-note span
  ){
  }
  body.app-academy.app-academy.app-academy #events :where(
    .event-program-heading p,.event-detail-heading p,.event-applicant-head small,
    .event-applicant-note small,.event-list-tools label span,.event-applicant-search>span
  ){
  }
  body.app-academy.app-academy.app-academy #events :where(
    .event-workspace-tabs,.event-create-tabs
  ){
  }
  body.app-academy.app-academy.app-academy #events :where(
    .event-workspace-tabs button:not(.on),.event-create-tabs button:not(.on),
    .event-toolbar button:not(.on)
  ){
  }
  body.app-academy.app-academy.app-academy #events :where(
    .event-workspace-tabs button.on,.event-create-tabs button.on,
    .event-toolbar button.on
  ){
  }
  body.app-academy.app-academy.app-academy #events :where(
    .event-workspace-tabs button.on,.event-create-tabs button.on,
    .event-toolbar button.on
  ) :where(span,strong,small,b){
  }
  body.app-academy.app-academy.app-academy #events :where(
    .event-list-tools input,.event-applicant-search input
  ){
  }

  /* Administrator guide: reset the inherited fixed page header and keep
     controls below the title on narrow screens. */
  body.app-academy.app-academy.app-academy #copyrightModal .staff-guide-root>header{
    position:static!important;
    inset:auto!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:start!important;
    gap:14px!important;
    width:auto!important;
    height:auto!important;
    min-height:0!important;
    margin:0 0 16px!important;
    padding:16px!important;
    border-width:1px!important;
    border-style:solid!important;
    border-radius:14px!important;
    box-shadow:none!important;
  }
  body.app-academy.app-academy.app-academy #copyrightModal .staff-guide-root>header :where(h2,small){
  }
  body.app-academy.app-academy.app-academy #copyrightModal .staff-guide-root>header>div:last-child{
    display:flex!important;
    flex-wrap:wrap!important;
    justify-content:flex-end!important;
    gap:8px!important;
  }

  /* Consultation dialog: a two-row shell prevents the page header rules and
     mobile keyboard from stacking the title, history, and form together. */
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-dialog{
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    width:min(1000px,96vw)!important;
    height:min(92dvh,960px)!important;
    max-height:min(92dvh,960px)!important;
    overflow:hidden!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-head{
    position:relative!important;
    inset:auto!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:start!important;
    gap:14px!important;
    width:auto!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:18px 20px!important;
    border-bottom-width:1px!important;
    border-bottom-style:solid!important;
    box-shadow:none!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-head>div{
    min-width:0!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-head :where(h2,p,span){
    position:static!important;
    max-width:100%!important;
    overflow-wrap:anywhere!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-head p{
    margin:5px 0 0!important;
    line-height:1.5!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-body{
    display:block!important;
    min-height:0!important;
    max-height:none!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal :where(
    .consultation-history,.consultation-body form,.consultation-section-title,
    .consultation-record,#consultationFollowUps,.consultation-actions
  ){
    position:static!important;
    inset:auto!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-actions{
    border-top-width:1px!important;
    border-top-style:solid!important;
  }
}

@media screen and (max-width:760px){
  body.app-academy.app-academy.app-academy{
    height:auto!important;
    min-height:100dvh!important;
  }
  body.app-academy.app-academy.app-academy main{
    padding-bottom:120px!important;
  }
  body.app-academy.app-academy.app-academy .page.on{
    padding-bottom:120px!important;
  }
  body.app-academy.app-academy.app-academy #newStudentModal{
    bottom:calc(74px + env(safe-area-inset-bottom))!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body.app-academy.app-academy.app-academy #newStudentModal.on{
    align-items:stretch!important;
  }
  body.app-academy.app-academy.app-academy #newStudentModal .new-student-dialog{
    width:100%!important;
    max-height:calc(100dvh - 74px - env(safe-area-inset-bottom))!important;
    padding:14px 12px!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    border-radius:18px 18px 0 0!important;
  }
  body.app-academy.app-academy.app-academy #newStudentModal .modal-actions{
    position:sticky!important;
    z-index:7!important;
    bottom:-14px!important;
    margin-inline:-12px!important;
    padding:12px!important;
  }
  body.app-academy.app-academy.app-academy #copyrightModal .staff-guide-root>header{
    grid-template-columns:1fr!important;
    padding:14px!important;
  }
  body.app-academy.app-academy.app-academy #copyrightModal .staff-guide-root>header>div:last-child{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    justify-content:stretch!important;
  }
  body.app-academy.app-academy.app-academy #copyrightModal .staff-guide-root>header button{
    width:100%!important;
    min-height:48px!important;
    white-space:normal!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-dialog{
    width:100%!important;
    height:100dvh!important;
    max-height:100dvh!important;
    border-radius:20px 20px 0 0!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-head{
    padding:14px 15px!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-head h2{
    margin:3px 0!important;
    font-size:21px!important;
    line-height:1.25!important;
  }
  body.app-academy.app-academy.app-academy #studentConsultationModal .consultation-head p{
    font-size:13px!important;
  }
}
