@font-face {
  font-family: Cairo;
  src: url('/assets/cairo.woff') format('woff');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  font-family: Cairo, system-ui, sans-serif;
  --menu-green: #176345;
}
button, input, select, textarea { font-family: inherit; }

details {
  margin-block: 8px;
  border: 1px solid #d6e2dc;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

:is(#jp-teacher .jp-window, #jp-admin-demo) details {
  padding: 0;
  background: #fff;
}

:is(#jp-teacher .jp-window, #jp-admin-demo) details > summary {
  display: block;
  position: relative;
  list-style: none;
  min-height: 48px;
  box-sizing: border-box;
  padding: 10px 12px 12px 32px;
  background: var(--menu-green);
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-weight: 700;
  cursor: pointer;
}

#jp-teacher .jp-window :is(.jp-panel > [data-action="grade-menu"], [data-panel="lessons"] [data-action="lesson-list"].jp-back) {
  background: var(--menu-green);
  border-color: var(--menu-green);
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
details[open] > summary::after { transform: rotate(225deg); }
details > summary:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

#jp-teacher .jp-window [data-panel] :is(.jp-lesson,.jp-live-quizzes) details > :is(button,label),
#jp-teacher .jp-window .jp-profile-menu details > :is(p,a) {
  background: #fff;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
  margin: 6px 8px;
  padding: 7px 10px;
  text-align: right;
}

#jp-teacher .jp-window .jp-lesson details > button { width: calc(100% - 16px); }
#jp-teacher .jp-window .jp-live-quizzes details > label { min-height: 44px; }
#jp-teacher .jp-window .jp-lock,
#jp-teacher .jp-window .jp-lock::before { border-color: #176345; }
#jp-teacher .jp-window .jp-teacher-threads details > ol { margin-inline: 8px; }
#jp-admin-demo details > :is(div,ul) { margin: 8px; }
#jp-admin-demo details .jp-section-name,
#jp-admin-demo details ul .btn { color: #000; }

#jp-teacher .jp-window .jp-quiz-chapter {
  position: relative;
  margin-block: 6px;
}
#jp-teacher .jp-window .jp-quiz-chapter details {
  margin-block: 0;
}
#jp-teacher .jp-window .jp-quiz-chapter summary {
  padding-inline-start: 46px;
}
#jp-teacher .jp-window .jp-quiz-chapter-check {
  position: absolute;
  inset-inline-start: 12px;
  top: 12px;
  z-index: 1;
  width: 24px;
  height: 24px;
  margin: 0;
  color-scheme: light;
}

/* Student quiz selection, attempt and review. */
#jp-teacher .jp-window [data-panel="tests"] .jp-quiz-guide{
  background:#fff;border:1px solid #dce7de;border-radius:14px;padding:12px;margin:8px 0
}
#jp-teacher .jp-window .jp-quiz-guide p{margin:2px 0 0}
#jp-teacher .jp-window .jp-quiz-chapter{margin:8px 0}
#jp-teacher .jp-window .jp-quiz-chapter summary{min-height:52px}
#jp-teacher .jp-window .jp-quiz-chapter label{min-height:46px;padding:8px 14px;font-weight:600}
#jp-teacher .jp-window .jp-quiz-chapter input[type=checkbox]{width:20px;height:20px;flex:none}
#jp-teacher .jp-window .jp-quiz-start{position:sticky;bottom:max(8px,env(safe-area-inset-bottom));z-index:1;min-height:48px}
#jp-teacher .jp-window .jp-quiz-heading{background:#12462e;border-radius:12px;color:#fff;padding:8px 10px}
#jp-teacher .jp-window [data-panel="tests"] .jp-quiz-heading h3,
#jp-teacher .jp-window .jp-quiz-counter{color:#fff!important;-webkit-text-fill-color:#fff!important}
#jp-teacher .jp-window .jp-question-steps li{width:34px;min-width:34px;height:34px;background:#fff;border:1px solid #217633;border-radius:50%;color:#217633!important;-webkit-text-fill-color:#217633!important}
#jp-teacher .jp-window .jp-question-steps li[aria-current="step"]{background:#217633;color:#fff!important;-webkit-text-fill-color:#fff!important}
#jp-teacher .jp-window .jp-quiz-form .jp-answer-grid label{min-height:50px;font-weight:700;border-radius:12px;padding:8px 12px}
#jp-teacher .jp-window .jp-quiz-form .jp-answer-grid label:has(input:checked){background:#d8ebdc;border-color:#217633;color:#145a26!important;-webkit-text-fill-color:#145a26!important}
#jp-teacher .jp-window .jp-quiz-actions [type=submit]{grid-column:2}
#jp-teacher .jp-window .jp-quiz-actions [data-quiz-prev]{background:#d8ebdc;color:#145a26!important;-webkit-text-fill-color:#145a26!important}
#jp-teacher .jp-review-options{grid-template-columns:1fr}
#jp-teacher .jp-review-perfect span{display:inline-block;font-size:1.5em}
/* Private student and teacher messaging */
#jp-teacher .jp-window [data-panel="teacher"]>.jp-inner-art{opacity:.18;pointer-events:none}
#jp-teacher .jp-window [data-panel="teacher"]{background:#fff9efaa;border:1px solid #d4dfd6;border-radius:18px;overflow:hidden;padding:14px}
#jp-teacher .jp-chat-private{font-size:13px;text-align:center;color:#62766b;margin:0 0 10px}
#jp-teacher .jp-window .jp-teacher-threads{display:flex;flex-direction:column;gap:12px;height:45svh;min-height:220px;max-height:540px;overflow-y:auto;padding:14px 8px;background:#eaf0e8;border-radius:12px;overscroll-behavior:contain}
#jp-teacher .jp-window .jp-teacher-threads li{width:fit-content;max-width:85%;padding:12px 15px;border:0;border-radius:16px 16px 4px 16px;box-shadow:0 2px 5px #173f2610;font-size:16px;line-height:1.8;background:#fff;align-self:flex-end;color:#234836}
#jp-teacher .jp-window .jp-teacher-threads li[data-sender="student"]{align-self:flex-start;background:#d4e8d9;border-radius:16px 16px 16px 4px}
#jp-teacher .jp-teacher-threads p{margin:4px 0;white-space:pre-wrap}
#jp-teacher .jp-teacher-threads strong{font-size:12px}
#jp-teacher .jp-teacher-threads time{display:block;font-size:11px;color:#62766b;margin-top:5px}
#jp-teacher .jp-window .jp-teacher-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:12px 0 0;background:#f4f7f2;position:sticky;bottom:0}
#jp-teacher .jp-teacher-form>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#jp-teacher .jp-window .jp-teacher-form textarea{grid-column:1;min-height:50px;max-height:140px;border:1px solid #cbd9d0;background:#fff;border-radius:24px;padding:12px 16px;font-size:16px;resize:vertical;margin:0}
#jp-teacher .jp-window .jp-teacher-form>.jp-primary{grid-column:2;grid-row:1;min-width:66px;min-height:48px;border-radius:24px;margin:0;background:#14543c;color:#fff;-webkit-text-fill-color:#fff}
#jp-teacher .jp-teacher-form .jp-photo-actions,#jp-teacher .jp-teacher-form .jp-photo-preview,#jp-teacher .jp-teacher-form .jp-photo-status{grid-column:1/-1;margin:0}
#jp-teacher .jp-teacher-form .jp-photo-actions{display:flex;gap:8px}
#jp-teacher .jp-chat-badge{display:inline-block;background:#a42c37;color:#fff!important;-webkit-text-fill-color:#fff!important;font:700 12px Cairo,system-ui;padding:3px 9px;border-radius:15px;margin:4px}
#jp-teacher [data-service="teacher"],#jp-teacher [data-tab="teacher"]{position:relative}
body:has(#conversation) main{max-width:1000px}
body:has(#conversation) main>section:first-of-type{display:grid;grid-template-columns:minmax(220px,32%) minmax(0,1fr);gap:12px;padding:20px;border-radius:18px}
body:has(#conversation) h1,body:has(#conversation) main>section:first-of-type>p,body:has(#conversation) #refresh,body:has(#conversation) main>section:first-of-type>label{grid-column:1/-1;margin:0}
#unread-count{font-size:13px;background:#d9ecdf;padding:4px 10px;border-radius:16px;display:inline-block}
#threads{list-style:none;padding:0;margin:0;max-height:60svh;overflow-y:auto}
#threads button{width:100%;text-align:right;min-height:65px;border:0;background:#eef4ef;color:#24533d;padding:12px;border-radius:12px}
#threads button[data-unread="true"]{border-inline-start:4px solid #b88c2c;font-weight:700}
#threads button[aria-pressed="true"]{background:#185a40;color:white}
#conversation{border:1px solid #d9e4dc;border-radius:16px;overflow:hidden;background:#eaf0e8}
#conversation h2{font-size:17px;padding:14px;margin:0;background:#14543c;color:white}
#conversation ol{list-style:none;display:flex;flex-direction:column;gap:12px;height:48svh;min-height:240px;overflow-y:auto;margin:0;padding:16px;overscroll-behavior:contain}
#conversation ol li{max-width:85%;width:fit-content;align-self:flex-start;border-radius:16px 16px 4px 16px;background:white;padding:12px 15px;white-space:pre-wrap}
#conversation ol li[data-sender="teacher"]{align-self:flex-end;background:#d4e8d9;border-radius:16px 16px 16px 4px}
#conversation time{display:block;font-size:11px;color:#62766b;margin-top:6px}
#reply{display:flex;gap:8px;padding:12px;background:#fff;align-items:end}
#reply label{flex:1;min-width:0}
#reply .reply-label{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
#reply textarea{min-height:48px;max-height:140px;border-radius:22px;padding:10px 14px;margin:0;resize:vertical}
#reply button{border-radius:24px;min-height:48px;margin:0;background:#14543c}
@media(max-width:650px){body:has(#conversation) main>section:first-of-type{grid-template-columns:minmax(0,1fr);padding:10px}#threads{max-height:180px}#conversation ol{height:42svh}}

#jp-teacher .jp-window [hidden],body:has(#conversation) [hidden]{display:none!important}
#jp-teacher .jp-window .jp-teacher-threads{background:#eee9dcdd}
#jp-teacher .jp-window .jp-teacher-form{background:#fff9ef}
#jp-teacher .jp-window [data-panel="teacher"]>h2{margin:3cqw 0 2cqw;font-size:clamp(23px,5cqw,38px)}
#jp-teacher .jp-window [data-chat-refresh]{display:none}
