/* HTNS v302 r60 — Schedule team selector highlight fix + Worship reference-match pass.
   Mobile visual update only. Existing schedule data, autosync, permissions,
   conflict detection, assignment selects and Songbook integration remain intact. */

@media (max-width:520px){
  /* Media / Worship selector — restore the compact reference geometry. */
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tabs{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:7px !important;
    margin:0 0 8px !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tab{
    height:42px !important;
    min-height:42px !important;
    display:grid !important;
    grid-template-columns:30px minmax(0,1fr) auto !important;
    align-items:center !important;
    justify-content:stretch !important;
    gap:7px !important;
    padding:0 9px !important;
    border:1px solid #D3E1EC !important;
    border-radius:11px !important;
    background:#FFFFFF !important;
    color:#0B315D !important;
    box-shadow:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tab::before{
    content:none !important;
    display:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tab > svg{
    width:28px !important;
    height:28px !important;
    padding:6px !important;
    border-radius:50% !important;
    box-sizing:border-box !important;
    background:#F1F5F8 !important;
    color:#66839D !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tab span{
    min-width:0 !important;
    color:#0B315D !important;
    font-size:12.5px !important;
    line-height:1 !important;
    font-weight:900 !important;
    letter-spacing:.018em !important;
    text-align:left !important;
    white-space:nowrap !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tab small{
    min-width:43px !important;
    margin:0 !important;
    padding:5px 8px !important;
    border-radius:999px !important;
    background:#F1F5F9 !important;
    color:#6C8096 !important;
    font-size:10px !important;
    line-height:1 !important;
    font-weight:850 !important;
    text-align:center !important;
    opacity:1 !important;
  }
  /* Active team selector states. r59 only restyled the Worship (last-child)
     state at this specificity, which unintentionally overrode the older Media
     active rule and left MEDIA TEAM looking unselected. Keep both tabs on the
     same clearly selected light-blue treatment. */
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tabs .simple-team-tab:first-child.active{
    background:#EAF6FF !important;
    border-color:#91C9EE !important;
    color:#0B315D !important;
    box-shadow:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tabs .simple-team-tab:first-child.active > svg{
    background:#D8EEFF !important;
    color:#1688D8 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tabs .simple-team-tab:first-child.active span{
    color:#0B315D !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tabs .simple-team-tab:first-child.active small{
    background:#DDF0FF !important;
    color:#1789DE !important;
  }

  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tabs .simple-team-tab:last-child.active{
    background:#EAF6FF !important;
    border-color:#91C9EE !important;
    color:#0B315D !important;
    box-shadow:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tabs .simple-team-tab:last-child.active > svg{
    background:#D8EEFF !important;
    color:#1688D8 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tabs .simple-team-tab:last-child.active span{
    color:#0B315D !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-tabs .simple-team-tab:last-child.active small{
    background:#DDF0FF !important;
    color:#1789DE !important;
  }

  /* Worship Team shell — one clean card with divider rows, matching the reference. */
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"]{
    margin-top:0 !important;
    padding:0 10px 8px !important;
    overflow:hidden !important;
    border:1px solid #D6E4EF !important;
    border-radius:13px !important;
    background:#FFFFFF !important;
    box-shadow:0 5px 18px rgba(47,91,133,.05) !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-team-editor-head{
    min-height:42px !important;
    padding:8px 0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:8px !important;
    border-bottom:1px solid #D7E6F0 !important;
    background:transparent !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-team-editor-head > div{
    min-width:0 !important;
    display:flex !important;
    align-items:center !important;
    gap:12px !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-team-editor-head > div > svg{
    width:23px !important;
    height:23px !important;
    flex:0 0 23px !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    color:#1688D8 !important;
    opacity:1 !important;
    fill:none !important;
    stroke:currentColor !important;
    stroke-width:1.8 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
    box-sizing:border-box !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-team-editor-head h3{
    margin:0 !important;
    color:#0B315D !important;
    font-size:15px !important;
    line-height:1.1 !important;
    font-weight:900 !important;
    letter-spacing:.015em !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-team-editor-head h3::after{
    content:none !important;
    display:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-fill-pill{
    min-width:58px !important;
    height:23px !important;
    padding:0 8px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:5px !important;
    border:0 !important;
    border-radius:999px !important;
    background:#E4F3FE !important;
    color:#1484D1 !important;
    font-size:10px !important;
    line-height:1 !important;
    font-weight:850 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-fill-pill svg{
    width:14px !important;
    height:14px !important;
  }

  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-list{
    padding:0 !important;
    display:block !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-list .simple-schedule-row:not(.singers-row){
    min-height:46px !important;
    display:grid !important;
    grid-template-columns:132px minmax(0,1fr) !important;
    align-items:center !important;
    gap:6px !important;
    margin:0 !important;
    padding:6px 0 !important;
    border:0 !important;
    border-bottom:1px solid #E0EBF3 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:not(.singers-row) .simple-role-label{
    min-width:0 !important;
    display:flex !important;
    align-items:center !important;
    gap:9px !important;
    color:#0B315D !important;
    font-size:12.5px !important;
    line-height:1.17 !important;
    font-weight:850 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:not(.singers-row) .simple-role-label > span:last-child{
    min-width:0 !important;
    grid-column:auto !important;
    align-self:auto !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:not(.singers-row) .simple-role-label > span:last-child::after{
    content:none !important;
    display:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:not(.singers-row) .schedule-role-icon{
    width:28px !important;
    height:28px !important;
    flex:0 0 28px !important;
    display:grid !important;
    place-items:center !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:50% !important;
    box-sizing:border-box !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:not(.singers-row) .schedule-role-icon svg{
    width:19px !important;
    height:19px !important;
    fill:none !important;
    stroke:currentColor !important;
    stroke-width:1.7 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
  }

  /* Reference pastel identities: Leaders / Piano / Guitar / Sub Key / Drums / Bass. */
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:nth-child(1) .schedule-role-icon{background:#E5F3FF !important;color:#0D83D4 !important;}
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:nth-child(2) .schedule-role-icon{background:#F0E6FF !important;color:#7634C5 !important;}
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:nth-child(3) .schedule-role-icon{background:#E1F7EC !important;color:#07865B !important;}
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:nth-child(4) .schedule-role-icon{background:#FFF0CF !important;color:#D58F00 !important;}
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:nth-child(5) .schedule-role-icon{background:#FFE4EA !important;color:#B91E4E !important;}
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:nth-child(6) .schedule-role-icon{background:#E3F3FF !important;color:#177FD0 !important;}

  /* Assignment fields: solid reference outline, including unfilled roles. */
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-row-control,
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-select-wrap{
    min-width:0 !important;
    width:100% !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-select,
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-person-static,
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-select:has(option:checked[value=""]){
    width:100% !important;
    max-width:100% !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 28px 0 10px !important;
    border:1px solid #C6DBEA !important;
    border-radius:9px !important;
    background:#FFFFFF !important;
    color:#0B315D !important;
    box-shadow:none !important;
    font-family:inherit !important;
    font-size:13px !important;
    line-height:1.15 !important;
    font-weight:750 !important;
    text-overflow:ellipsis !important;
    appearance:none !important;
    -webkit-appearance:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-select-wrap::after{
    content:"" !important;
    position:absolute !important;
    right:12px !important;
    top:50% !important;
    width:7px !important;
    height:7px !important;
    border:0 !important;
    border-right:2px solid #0B315D !important;
    border-bottom:2px solid #0B315D !important;
    transform:translateY(-70%) rotate(45deg) !important;
    pointer-events:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-select-wrap.has-conflict .simple-schedule-select,
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-person-static.has-conflict{
    border-color:#D6B568 !important;
    background:#FFF9EC !important;
  }

  /* Singers row — compact header and all five assigned singers on one line. */
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .singers-row{
    display:block !important;
    margin:0 !important;
    padding:8px 0 9px !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .singers-row .simple-singer-top{
    min-height:30px !important;
    margin:0 0 7px !important;
    padding:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:10px !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .singers-row .simple-role-label{
    min-width:0 !important;
    display:flex !important;
    align-items:center !important;
    gap:9px !important;
    color:#0B315D !important;
    font-size:12.5px !important;
    line-height:1.15 !important;
    font-weight:850 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .singers-row .schedule-role-icon{
    width:28px !important;
    height:28px !important;
    flex:0 0 28px !important;
    display:grid !important;
    place-items:center !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:50% !important;
    background:#F0E6FF !important;
    color:#7935CC !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .singers-row .schedule-role-icon svg{
    width:19px !important;
    height:19px !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .singers-row .simple-role-label > span:last-child{
    font-size:0 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .singers-row .simple-role-label > span:last-child::before{
    content:"Singers" !important;
    display:block !important;
    color:#0B315D !important;
    font-size:12.5px !important;
    line-height:1.15 !important;
    font-weight:850 !important;
  }
  html[lang="vi"].htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .singers-row .simple-role-label > span:last-child::before{
    content:"Ca sĩ" !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .singers-row .simple-role-label > span:last-child::after{
    content:none !important;
    display:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-singer-count{
    margin:3px 0 0 37px !important;
    color:#607B96 !important;
    font-size:9.5px !important;
    line-height:1 !important;
    font-weight:700 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-singer-edit{
    min-height:30px !important;
    height:30px !important;
    padding:0 12px !important;
    border:1.2px solid #117ABF !important;
    border-radius:12px !important;
    background:#FFFFFF !important;
    color:#117ABF !important;
    box-shadow:none !important;
    font-size:10px !important;
    line-height:1 !important;
    font-weight:900 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-singer-chips{
    width:100% !important;
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    gap:5px !important;
    overflow-x:auto !important;
    padding:0 !important;
    scrollbar-width:none !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-singer-chips::-webkit-scrollbar{display:none !important;}
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-singer-chip{
    flex:0 0 auto !important;
    min-width:0 !important;
    height:31px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    padding:0 10px !important;
    border:1px solid #DDC8F2 !important;
    border-radius:999px !important;
    background:#F2E9FB !important;
    color:#7133B2 !important;
    font-size:10px !important;
    line-height:1 !important;
    font-weight:850 !important;
    white-space:nowrap !important;
  }

  /* Select Song — compact, closed-by-default reference card. */
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-worship-songs{
    margin:8px 0 0 !important;
    border:1.2px solid #CBA7ED !important;
    border-radius:14px !important;
    background:#FBF7FF !important;
    overflow:hidden !important;
    box-shadow:0 2px 8px rgba(101,49,155,.035) !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-worship-songs-toggle{
    width:100% !important;
    min-height:54px !important;
    display:grid !important;
    grid-template-columns:34px minmax(0,1fr) 31px 18px !important;
    align-items:center !important;
    gap:8px !important;
    padding:7px 10px !important;
    border:0 !important;
    background:transparent !important;
    color:#6E2BBE !important;
    text-align:left !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-worship-songs .simple-song-icon{
    width:34px !important;
    height:34px !important;
    display:grid !important;
    place-items:center !important;
    border-radius:50% !important;
    background:#F0E4FF !important;
    color:#7433C7 !important;
    font-size:22px !important;
    line-height:1 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-worship-songs .simple-song-copy b{
    display:block !important;
    color:#6E2BBE !important;
    font-size:13px !important;
    line-height:1.05 !important;
    font-weight:900 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-worship-songs .simple-song-copy small{
    display:block !important;
    max-width:none !important;
    margin-top:3px !important;
    color:#71839A !important;
    font-size:9px !important;
    line-height:1.15 !important;
    font-weight:600 !important;
    white-space:normal !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-worship-songs .simple-song-count{
    width:31px !important;
    height:31px !important;
    display:grid !important;
    place-items:center !important;
    margin:0 !important;
    border-radius:50% !important;
    background:#EEF3FF !important;
    color:#6F2CBF !important;
    font-size:11px !important;
    line-height:1 !important;
    font-weight:900 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-worship-songs .simple-song-chevron{
    color:#7A2CC1 !important;
    font-size:18px !important;
    line-height:1 !important;
    font-weight:900 !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-worship-songs.open .simple-song-body{
    border-top:1px solid #E6D8F4 !important;
    background:#FFFFFF !important;
  }
}

@media (max-width:350px){
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-list .simple-schedule-row:not(.singers-row){
    grid-template-columns:118px minmax(0,1fr) !important;
    gap:5px !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-schedule-row:not(.singers-row) .simple-role-label,
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .singers-row .simple-role-label{
    gap:6px !important;
    font-size:11px !important;
  }
  html.htns-theme-v234 body #mainApp#mainApp #view-schedule#view-schedule .simple-team-editor[data-team="worship"] .simple-singer-chip{
    padding-left:8px !important;
    padding-right:8px !important;
    font-size:9px !important;
  }
}
