#studentAssignments {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 22px 0;
}
#studentAssignments details {
  padding: 0 clamp(16px,3vw,32px);
  border: 1px solid #94e7d8;
  border-radius: 18px;
  background: linear-gradient(110deg,#effcf4,#ccf4e9 68%,#b5e9df);
  color: #103630;
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
}
#studentAssignments summary {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}
#studentAssignments summary::-webkit-details-marker { display: none; }
#studentAssignments summary::after {
  content: '';
  width: 11px;
  height: 11px;
  flex: none;
  border: solid #166454;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
#studentAssignments details[open] summary::after { transform: rotate(225deg); }
#studentAssignments h2 {
  margin: 0;
  color: #103b32;
  font: 700 clamp(1.8rem,3.5vw,2.65rem)/1.05 'Crimson Text',Georgia,serif;
  letter-spacing: -.025em;
}
#studentAssignments .sa-count {
  margin-left: auto;
  color: #21574c;
  font: 650 .94rem/1.25 system-ui,sans-serif;
  text-align: right;
}
#studentAssignments .sa-description, #studentAssignments .sa-trouble, #studentAssignments .sa-notice {
  margin: 0 0 13px;
  font: .94rem/1.4 system-ui,sans-serif;
  color: #295c51;
}
#studentAssignments .sa-list {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,305px),1fr));
  gap: 9px;
  max-height: clamp(100px, 32vh, 300px);
  overflow-y: auto;
  margin: 0 0 18px;
  padding: 2px;
  list-style: none;
}
#studentAssignments .sa-open {
  display: flex;
  width: 100%;
  min-height: 74px;
  height: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #73a99c;
  border-radius: 10px;
  background: #fbfffd;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
#studentAssignments .sa-open:hover { background: #fff; border-color: #17705d; }
#studentAssignments :is(summary,button):focus-visible { outline: 3px solid #0d6450; outline-offset: -2px; }
#studentAssignments .sa-label { display: grid; gap: 4px; overflow-wrap: anywhere; }
#studentAssignments .sa-course { color: #16644f; font: 750 .84rem/1.2 system-ui,sans-serif; }
#studentAssignments [data-subject="ugmicro"] .sa-course { color: #4e4481; }
#studentAssignments .sa-label strong { font: 700 clamp(1.2rem,1.8vw,1.4rem)/1.25 system-ui,sans-serif; }
#studentAssignments .sa-label small { color: #416257; font: .93rem/1.32 system-ui,sans-serif; }
#studentAssignments .sa-action {
  flex: none;
  padding: 7px 12px;
  border-radius: 6px;
  background: #135a48;
  color: white;
  font: 650 .88rem/1.2 system-ui,sans-serif;
  white-space: nowrap;
}
#studentAssignments .sa-complete { background: #ebf7ef; border-color: #9bbfb1; }
#studentAssignments .sa-complete .sa-action { padding-inline: 0; background: transparent; color: #286042; }
#studentAssignments .sa-trouble button {
  color: #12543f;
  font: inherit;
  background: transparent;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}
#studentAssignments:not([hidden]) ~ #app .hm-ultra-shell {
  height: calc(100vh - var(--student-assignments-height,0px));
  height: calc(100dvh - var(--student-assignments-height,0px));
}
body:has(#studentAssignments:not([hidden])):has(.hm-ultra-shell) #themeToggleBtn {
  top: calc(var(--student-assignments-height,0px) + 11px);
}
body:has(.hm-ultra-shell) #studentAssignments .sa-list { max-height: min(156px,18dvh); }
@media (max-width: 540px) {
  #studentAssignments { padding: 8px 10px 0; }
  #studentAssignments details { padding: 0 13px; border-radius: 13px; }
  #studentAssignments summary { min-height: 62px; gap: 9px; }
  #studentAssignments h2 { font: 750 clamp(1.36rem,5.8vw,1.8rem)/1.12 system-ui,sans-serif; }
  #studentAssignments .sa-count { max-width: 80px; font-size: .78rem; }
  #studentAssignments .sa-description { margin-bottom: 9px; font-size: .86rem; }
  #studentAssignments .sa-list { gap: 6px; margin-bottom: 12px; }
  #studentAssignments .sa-open { min-height: 65px; padding: 8px 10px; }
  #studentAssignments .sa-label small { font-size: .89rem; }
  #studentAssignments .sa-action { font-size: .82rem; }
  #studentAssignments .sa-action { padding: 6px 8px; }
}
#studentAssignments[hidden], #studentAssignments [hidden], #studentAssignments .sa-notice:empty { display: none; }
#studentAssignments .sa-phone-open, #studentAssignments .sa-phone-dialog:not([open]) { display: none; }
@media (max-width: 700px), (orientation: landscape) and (max-height: 540px) and (pointer: coarse) {
  body:has(#app .hm-full) #studentAssignments {
    padding: max(6px,env(safe-area-inset-top)) calc(116px + env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left));
  }
  body:has(#app .hm-full) #studentAssignments > details { display: none; }
  body:has(#app .hm-full) #studentAssignments .sa-phone-open {
    display: inline-flex; align-items: center; justify-content: center; gap: .35em;
    min-height: 44px; max-width: 100%; padding: .35em .75em;
    color: #103b32; background: #d2f6e9; border: 1px solid #94e7d8; border-radius: 10px;
    font: 700 clamp(1rem,3.8vw,1.18rem)/1.15 system-ui,sans-serif; cursor: pointer;
  }
  #studentAssignments .sa-phone-count { color: #29594a; font-size: .8em; font-weight: 600; }
  #studentAssignments .sa-phone-count:empty { display: none; }
  body:has(#app .hm-full) #themeToggleBtn {
    position: absolute !important; top: max(6px,env(safe-area-inset-top)); bottom: auto !important;
    right: max(10px,env(safe-area-inset-right)) !important; width: 98px; min-height: 44px;
    padding: 5px 8px !important; font-size: 11px !important; letter-spacing: 0 !important;
  }
  #studentAssignments[hidden] + #app:has(.hm-full)::before { content: ''; display: block; height: 44px; }
  #studentAssignments .sa-phone-dialog[open] {
    position: fixed; inset: 0; display: flex; flex-direction: column; gap: 10px;
    width: min(510px,calc(100% - 24px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
    margin: auto; padding: 14px; overflow: hidden; border: 1px solid #74af9c; border-radius: 15px;
    background: #eafaf1; color: #103630; box-shadow: 0 16px 52px rgba(0,0,0,.43);
  }
  #studentAssignments .sa-phone-dialog::backdrop { background: rgba(8,13,24,.72); }
  #studentAssignments .sa-dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  #studentAssignments .sa-dialog-top h3 { margin: 0; color: #103b32; font: 750 1.5rem/1.12 system-ui,sans-serif; }
  #studentAssignments .sa-dialog-close {
    min-height: 44px; min-width: 58px; padding: 5px 9px; color: #184d40; background: transparent;
    border: 1px solid #729e8e; border-radius: 8px; font: 600 .94rem/1.2 system-ui,sans-serif; cursor: pointer;
  }
  #studentAssignments .sa-phone-dialog .sa-content { min-height: 0; overflow: auto; overscroll-behavior: contain; }
  #studentAssignments .sa-phone-dialog .sa-list { max-height: none; margin-bottom: 0; overflow: visible; grid-template-columns: 1fr; }
  body:has(#saPhoneDialog[open]) { overflow: hidden; }
}
