/* Student pages (notes, quizzes, questions) inside the website layout, on top of mtabe.css. */

main.student { display: flex; flex-direction: column; align-items: center; background: var(--bg); padding: 18px 16px 64px; min-height: 60vh; }
main.student > * { width: 100%; max-width: 760px; }
main.student.wide > * { max-width: 1080px; }

/* sub-menu under the site header */
.subnav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px;
            background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--text-2); font-weight: 700;
            font-size: 15px; text-decoration: none; white-space: nowrap; }
.subnav a.on { background: var(--blue-50); box-shadow: inset 0 0 0 2px var(--action); color: var(--text); }

/* page heads (replace the phone app's top bar) */
.student .pagehead { padding: 4px 0 16px; }
.student .pagehead h1 { margin: 0; font-size: clamp(26px, 4vw, 36px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.student .pagehead p { margin: 6px 0 0; }
.student .topbar { position: static; min-height: 52px; padding: 0 0 8px; background: transparent; display: flex; align-items: center; gap: 4px; }
.student .ttl { flex: 1; font-weight: 750; font-size: 20px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--link); font-weight: 650; text-decoration: none; }

/* subject tiles */
.tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tilegrid .tile { min-height: 132px; }

/* chips and segmented controls as links */
a.chip { text-decoration: none; }
.fchip { position: relative; display: inline-flex; }
.fchip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.fchip input:checked + .chip { background: var(--blue-50); box-shadow: inset 0 0 0 2px var(--action); color: var(--text); }
.fchip input:focus-visible + .chip { outline: 3px solid var(--blue); outline-offset: 2px; }

/* forms */
.student select.input, .student input.input { width: 100%; font: inherit; color: var(--text); border: 0; background: var(--surface); }
.student .field-l { font-weight: 700; font-size: 14px; color: var(--text-2); }
.student .scr { overflow: visible; padding: 0 0 24px; }

/* long notes: reading layout */
.read-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 36px; align-items: start; }
.note { background: var(--surface); border-radius: var(--r-lg); padding: 28px 32px; box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.note-title { margin: 12px 0 6px; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.prose { font-size: 18px; line-height: 1.75; max-width: 70ch; overflow-wrap: anywhere; }
.prose p { margin: 0 0 1.05em; }
.prose h2 { font-size: 24px; line-height: 1.25; margin: 1.9em 0 .55em; font-weight: 800; scroll-margin-top: 90px; }
.prose h3 { font-size: 19px; line-height: 1.3; margin: 1.5em 0 .4em; font-weight: 750; color: var(--link); scroll-margin-top: 90px; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin: .38em 0; }
.side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 110px); overflow-y: auto; }
.sidelink { display: block; padding: 7px 10px; border-radius: 10px; color: var(--text-2); font-size: 15px; font-weight: 600; text-decoration: none; }
.sidelink:hover { background: var(--surface-2); }
.sidelink.on { background: var(--blue-50); color: var(--text); }
.toc-m { display: none; margin-bottom: 14px; }
@media (max-width: 900px) {
  .read-grid { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .note { padding: 20px 18px; }
  .toc-m { display: block; }
  .side .toc { display: none; }
  .prose { font-size: 17px; }
}

/* quiz */
.student details > summary { list-style: none; cursor: pointer; }
.student details > summary::-webkit-details-marker { display: none; }
.student button.opt { width: 100%; text-align: left; font: inherit; color: var(--text); border: 0; cursor: pointer; }
.student .opt .L { flex: none; width: 40px; height: 40px; border-radius: 14px; background: var(--surface-2); display: flex;
                   align-items: center; justify-content: center; font-weight: 800; }
.student div.opt { cursor: default; }
.student .opt.correct .L { background: var(--success); color: #fff; }
.student .opt.wrong .L { background: var(--danger); color: #fff; }
.student .steps i { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-3); }
.student .steps i.ok { background: var(--success); }
.student .steps i.no { background: var(--danger); }
.student .steps i.cur { background: var(--action); }
.student .score { width: 148px; height: 148px; border-radius: 999px; margin: 8px auto; display: flex; flex-direction: column;
                  align-items: center; justify-content: center; background: var(--blue-50); box-shadow: inset 0 0 0 8px var(--blue); }
.student .score b { font-size: 40px; line-height: 1; font-weight: 800; }

/* lists, questions, answers */
.student .li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 60px; text-decoration: none; color: inherit;
               border-top: 1px solid var(--line); }
.student .list > .li:first-child { border-top: 0; }
.student .qcard { text-decoration: none; color: inherit; }
.student .qcard .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.student .qcard .chan { display: inline-flex; align-items: center; gap: 4px; }
.student .qcard .qt { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.student .ans-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px 4px; font-weight: 700; }
.student .ans-f { padding: 0 16px 14px; font-size: 13px; color: var(--muted); }
.student .atext, .student .ntext { white-space: pre-line; overflow-wrap: anywhere; }
.student .pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.student .debug { background: #FFF4CC; color: #5C4400; border-radius: 12px; padding: 10px 14px; font-weight: 700; }

/* staff dashboard */
.dfilters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.dfilters .input { width: auto; min-width: 180px; flex: 1 1 180px; max-width: 320px; }
.dmsg { margin: 0 0 16px; }
.kpis a.kpi { text-decoration: none; color: inherit; }
.warn-t { color: var(--warn); }
.dcols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.dtext { width: 100%; font: 15px/1.6 ui-monospace, Menlo, monospace; resize: vertical; }
.dpre { white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.6 ui-monospace, Menlo, monospace; margin: 0; max-height: 720px; overflow: auto; }
.dflags { margin: 8px 0 0; padding-left: 1.2em; }
.tbl td, .tbl th { padding: 12px 14px; text-align: left; vertical-align: top; }
@media (max-width: 900px) { .dcols { grid-template-columns: 1fr; } }

/* Teacher Mtabe floating chat */
.tm-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px 0 16px;
          border: 0; border-radius: 999px; background: var(--action); color: var(--on-action, #fff); font: inherit; font-weight: 750; font-size: 16px; cursor: pointer;
          box-shadow: 0 8px 24px rgba(10, 30, 40, .28); }
.tm-fab:hover { filter: brightness(1.06); }
.tm-panel { position: fixed; right: 18px; bottom: 18px; z-index: 61; width: min(400px, calc(100vw - 24px)); height: min(620px, calc(100vh - 36px)); display: flex; flex-direction: column;
            background: var(--surface); border-radius: 22px; box-shadow: 0 16px 48px rgba(10, 30, 40, .3), inset 0 0 0 1px var(--line); overflow: hidden; }
.tm-panel[hidden], .tm-fab[hidden] { display: none; }
.tm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; background: var(--action); color: var(--on-action, #fff); }
.tm-head b { display: block; font-size: 17px; } .tm-head small { opacity: .85; font-size: 12.5px; }
.tm-x { border: 0; background: transparent; color: inherit; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 6px; }
.tm-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.tm-m { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.tm-m p { margin: 0 0 .5em; } .tm-m p:last-child { margin: 0; } .tm-m ul { margin: .3em 0; padding-left: 1.2em; }
.tm-user { align-self: flex-end; background: var(--action); color: var(--on-action, #fff); border-bottom-right-radius: 6px; }
.tm-assistant { align-self: flex-start; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-bottom-left-radius: 6px; }
.tm-wait { opacity: .6; }
.tm-src { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; } .tm-src a { color: var(--link); font-weight: 650; }
.tm-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px; background: var(--bg); } .tm-chips:empty { display: none; }
.tm-chip { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--blue-50); color: var(--link); font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; margin-bottom: 8px; }
.tm-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); }
.tm-form textarea { flex: 1; resize: none; border: 0; outline: 0; border-radius: 14px; padding: 11px 14px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; max-height: 120px; }
.tm-send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--action); color: var(--on-action, #fff); cursor: pointer; }
@media (max-width: 600px) { .tm-panel { right: 0; bottom: 0; width: 100vw; height: 86vh; border-radius: 22px 22px 0 0; } .tm-fab span { display: none; } .tm-fab { padding: 0 16px; } }
