/* PR-UI07: Parent, teacher and institution workspaces. */
:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content > .role-workspace {
  display: grid;
  gap: 1rem;
  inline-size: min(100%, 76rem);
  margin-inline: auto;
  min-inline-size: 0;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content > .role-workspace > .page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin: 0;
  border-block-end: 1px solid #d9e3df;
  padding-block: 1.1rem 1rem;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content > .role-workspace > .page-head h2 {
  margin: 0;
  color: #183733;
  font-size: 34px;
  line-height: 1.15;
  text-wrap: balance;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content > .role-workspace > .page-head :is(p, .page-context) {
  max-inline-size: 62ch;
  margin: .4rem 0 0;
  color: #5a686e;
  line-height: 1.55;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: clip;
  border: 1px solid #d9e3df;
  border-radius: 8px;
  background: #fff;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-summary .study-card {
  position: relative;
  display: grid;
  align-content: center;
  min-block-size: 6.6rem;
  min-inline-size: 0;
  border: 0;
  border-inline-end: 1px solid #e0e8e5;
  border-block-end: 1px solid #e0e8e5;
  border-radius: 0;
  padding: 1rem 2.6rem 1rem 1rem;
  background: #fff;
  box-shadow: none;
  text-align: start;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-summary .study-card::after {
  content: "›";
  position: absolute;
  inset-inline-end: 1rem;
  inset-block-start: 50%;
  translate: 0 -50%;
  color: #71827f;
  font-size: 1.35rem;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-summary .study-card:is(:hover, :focus-visible) {
  background: #f2f7f5;
  color: inherit;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-summary .study-card strong {
  color: #183733;
  font-size: 1rem;
  line-height: 1.3;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-summary .study-card em {
  color: #5c6d72;
  font-size: .9rem;
  line-height: 1.45;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-workspace > .panel,
:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-workspace .task83-member-workspace,
:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-workspace .institution-member-tree {
  min-inline-size: 0;
  border-color: #d9e3df;
}

/* Parent child management */
body[data-role="parent"] #module-content .family-child-card {
  border-inline-start: 4px solid #3f8d82;
}

body[data-role="parent"] #module-content .family-child-card-header {
  padding-block-end: .8rem;
  border-block-end: 1px solid #e0e8e5;
}

body[data-role="parent"] #module-content .family-child-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

body[data-role="parent"] #module-content .family-child-card .student-practice-profile-form,
body[data-role="parent"] #module-content .family-child-card .child-login-form,
body[data-role="parent"] #module-content .family-child-card .child-device-panel {
  min-inline-size: 0;
}

body[data-role="parent"] #module-content .family-child-create {
  border-inline-start: 4px solid #d58b52;
  background: #fffdf9;
}

body[data-role="parent"] #module-content .parent-effective-access {
  border-block-start: 3px solid #3f8d82;
}

/* Teacher and institution action panels */
:is(body[data-role="teacher"], body[data-role="institution"]) #module-content .member-self-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-inline-size: 0;
}

body[data-role="institution"] #module-content .institution-member-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

:is(body[data-role="teacher"], body[data-role="institution"]) #module-content .member-self-service-grid > .panel {
  min-inline-size: 0;
  align-self: start;
  border-block-start: 3px solid #3f8d82;
  background: #fff;
}

:is(body[data-role="teacher"], body[data-role="institution"]) #module-content .member-self-service-grid > .managed-member-bind {
  border-block-start-color: #d58b52;
  background: #fffdf9;
}

:is(body[data-role="teacher"], body[data-role="institution"]) #module-content .member-self-service-grid > .panel > summary {
  min-block-size: 3.25rem;
  align-items: center;
  padding: .8rem 1rem;
}

:is(body[data-role="teacher"], body[data-role="institution"]) #module-content .member-self-service-grid .mini-form {
  min-inline-size: 0;
}

:is(body[data-role="teacher"], body[data-role="institution"]) #module-content .task83-member-toolbar {
  border-block-end: 1px solid #d9e3df;
  padding-block-end: 1rem;
}

:is(body[data-role="teacher"], body[data-role="institution"]) #module-content .task83-table-wrap {
  border-color: #d9e3df;
  border-radius: 8px;
}

:is(body[data-role="teacher"], body[data-role="institution"]) #module-content .task83-member-table th {
  background: #edf4f1;
  color: #183733;
}

:is(body[data-role="teacher"], body[data-role="institution"]) #module-content .task83-member-table td {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

:is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .task83-row-actions :is(.button, .text-button) {
  min-inline-size: 44px;
  min-block-size: 44px;
  justify-content: center;
}

/* Institution relationship tree */
body[data-role="institution"] #module-content .institution-member-tree {
  border-block-start: 3px solid #063f3c;
  padding: 1rem;
}

body[data-role="institution"] #module-content .institution-tree-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  min-inline-size: 0;
}

body[data-role="institution"] #module-content .institution-tree-teacher {
  min-inline-size: 0;
  border: 1px solid #d9e3df;
  border-inline-start: 3px solid #3f8d82;
  border-radius: 6px;
  background: #fbfdfc;
}

body[data-role="institution"] #module-content .institution-tree-teacher header {
  display: flex;
  gap: .75rem;
  align-items: start;
  justify-content: space-between;
  padding: .8rem .9rem;
  background: #edf4f1;
}

body[data-role="institution"] #module-content .institution-tree-teacher header > div,
body[data-role="institution"] #module-content .institution-tree-teacher li > span {
  min-inline-size: 0;
}

body[data-role="institution"] #module-content .institution-tree-teacher header strong {
  color: #183733;
}

body[data-role="institution"] #module-content .institution-tree-teacher ul {
  margin: 0;
  padding: .45rem .8rem .6rem 1.8rem;
}

body[data-role="institution"] #module-content .institution-tree-teacher li {
  padding-block: .45rem;
  border-block-end: 1px solid #e0e8e5;
}

body[data-role="institution"] #module-content .institution-tree-teacher li:last-child {
  border-block-end: 0;
}

body[data-role="institution"] #module-content .institution-assignment-list {
  display: grid;
  gap: .55rem;
}

body[data-role="institution"] #module-content .institution-student-assignment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 16rem) auto;
  gap: .75rem;
  align-items: center;
  min-inline-size: 0;
  border-block-end: 1px solid #e0e8e5;
  padding: .65rem 0;
}

body[data-role="institution"] #module-content .institution-student-assignment > span {
  min-inline-size: 0;
}

/* All managed-role mobile pages reserve the fixed dock without changing UI01. */
@media (max-width: 1023px) {
  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content > .role-workspace {
    inline-size: 100%;
  }

  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content > .role-workspace > .page-head h2 {
    font-size: 30px;
  }

  body[data-role="institution"] #module-content .institution-member-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content > .role-workspace {
    gap: .8rem;
    padding-block-end: calc(8rem + env(safe-area-inset-bottom, 0px));
  }

  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content > .role-workspace > .page-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    padding-block: .9rem;
  }

  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-summary .study-card {
    min-block-size: 6rem;
    padding: .8rem 1.8rem .8rem .8rem;
  }

  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content > .role-workspace > .page-head h2 {
    font-size: 26px;
  }

  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content .role-summary .study-card::after {
    inset-inline-end: .6rem;
  }

  :is(body[data-role="teacher"], body[data-role="institution"]) #module-content .member-self-service-grid,
  body[data-role="institution"] #module-content .institution-member-actions,
  body[data-role="institution"] #module-content .institution-tree-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-role="institution"] #module-content .institution-student-assignment {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  body[data-role="institution"] #module-content .institution-student-assignment :is(select, button) {
    inline-size: 100%;
  }

  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) .whatsapp-floating-contact {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content a,
  :is(body[data-role="parent"][data-page-module="myLearning"], body[data-role="parent"][data-page-module="myStudents"], body[data-role="teacher"][data-page-module="myLearning"], body[data-role="teacher"][data-page-module="myStudents"], body[data-role="institution"][data-page-module="myLearning"], body[data-role="institution"][data-page-module="myStudents"]) #module-content button {
    transition: none;
  }
}
