/* Mathster — the pupil top bar (Richard, 10 Nov 2026: option B, "navy brand bar + page bar").
   One bar on every pupil page: resources/views/student/partials/topbar.blade.php.
   Every rule is under .msb (or .ms-drawer / .ms-scrim for the settings panel), with each property set
   explicitly, because the pages it sits on still carry their own global rules for a, p, button and h1. */

.msb{flex:0 0 auto;position:relative;z-index:40;height:56px;box-sizing:border-box;display:flex;align-items:center;gap:22px;
  padding:0 24px;background:#17324D;color:#fff;font-family:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  -webkit-font-smoothing:antialiased}
.msb *{box-sizing:border-box}
.msb a.msb-brand{display:flex;align-items:center;gap:9px;padding:0;margin:0;background:none;border:0;border-radius:0;
  color:#fff;text-decoration:none;font-size:17px;font-weight:700;line-height:1}
.msb a.msb-brand b{font-family:'Newsreader',Georgia,'Times New Roman',serif;font-weight:700;font-size:18px;color:#fff}
.msb .msb-tabs{display:flex;gap:4px;margin:0;padding:0}
.msb a.msb-tab{display:inline-block;margin:0;padding:9px 14px;border:0;border-radius:999px;background:transparent;
  color:#C7D0E6;text-decoration:none;font-size:14px;font-weight:600;line-height:1}
.msb a.msb-tab:hover{background:rgba(255,255,255,.1);color:#fff}
.msb a.msb-tab[aria-current="page"]{background:#fff;color:#17324D}
.msb .msb-gap{flex:1 1 auto}
.msb button.msb-ib{width:36px;height:36px;margin:0;padding:0;border:1px solid #2A4763;border-radius:8px;background:transparent;
  color:#C7D0E6;display:grid;place-items:center;cursor:pointer;flex:0 0 auto}
.msb button.msb-ib:hover{border-color:#C7D0E6;color:#fff}
.msb .msb-who{display:flex;align-items:center;gap:10px;color:#fff;min-width:0}
.msb .msb-av{width:32px;height:32px;border-radius:50%;background:#F59E0B;color:#17324D;display:grid;place-items:center;
  font-size:12px;font-weight:700;flex:0 0 auto;margin:0;padding:0;border:0;line-height:1}
.msb .msb-name{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.msb .msb-name b{font-size:13px;font-weight:700;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
.msb .msb-name small{font-size:11px;color:#C7D0E6;white-space:nowrap}
.msb form.msb-out{margin:0;padding:0;display:block}
.msb button.msb-outbtn{margin:0;padding:8px 4px;border:0;background:transparent;color:#C7D0E6;font:inherit;font-size:13px;
  font-weight:600;cursor:pointer;border-radius:6px}
.msb button.msb-outbtn:hover{color:#fff;text-decoration:underline}
.msb button.msb-menubtn{display:none;cursor:pointer}
.msb :focus-visible{outline:3px solid #F59E0B;outline-offset:2px}

/* The phone menu behind the initials. */
.msb .msb-menu{position:absolute;top:52px;right:12px;width:220px;background:#fff;border:1px solid #E4DFD5;border-radius:12px;
  box-shadow:0 8px 40px rgba(23,50,77,.18);padding:6px 0;z-index:60;color:#17324D}
.msb .msb-menu[hidden]{display:none}
.msb .msb-menu .msb-mhead{display:block;padding:10px 14px 8px;border-bottom:1px solid #E4DFD5}
.msb .msb-menu .msb-mhead b{display:block;font-size:13px;font-weight:700;color:#17324D}
.msb .msb-menu .msb-mhead small{font-size:11.5px;color:#5A6577}
.msb .msb-menu a,.msb .msb-menu button{display:block;width:100%;margin:0;padding:11px 14px;border:0;border-radius:0;background:transparent;
  color:#17324D;text-align:left;text-decoration:none;font:inherit;font-size:14px;font-weight:500;line-height:1.2;cursor:pointer}
.msb .msb-menu a:hover,.msb .msb-menu button:hover{background:#F4F1EB}
.msb .msb-menu a[aria-current="page"]{font-weight:700}
.msb .msb-menu form{margin:0;padding:0;border-top:1px solid #E4DFD5}

/* Animations off in Settings: the logo stays still too (it already does for prefers-reduced-motion). */
.stu-nomotion .msb .mathster-mark svg{animation:none}

@media (max-width:760px){
  .msb{gap:10px;padding:0 12px;height:52px}
  .msb .msb-tabs,.msb .msb-name,.msb form.msb-out{display:none}
  .msb .msb-who .msb-av{display:none}
  .msb button.msb-menubtn{display:grid}
  .msb a.msb-brand b{font-size:17px}
}

/* The settings side panel, for pages that do not load mathster-student.css (the same look as there). */
.ms-scrim{position:fixed;inset:0;background:rgba(11,14,26,.45);z-index:90}
.ms-scrim[hidden],.ms-drawer[hidden]{display:none}
.ms-drawer{position:fixed;top:0;right:0;bottom:0;width:400px;max-width:100%;background:#fff;box-shadow:0 8px 40px rgba(11,14,26,.16);
  z-index:91;display:flex;flex-direction:column;overflow-y:auto;color:#17324D;font-family:'Inter',system-ui,sans-serif;text-align:left}
.ms-drawer *{box-sizing:border-box}
.ms-drawer .drawer-head{padding:20px 22px;border-bottom:1px solid #E4DFD5;display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.ms-drawer .drawer-head h3{margin:0;font-family:'Newsreader',Georgia,serif;font-size:20px;font-weight:700;color:#17324D}
.ms-drawer .drawer-head .iconbtn{width:38px;height:38px;border-radius:8px;border:1px solid #D8D2C6;background:#fff;color:#4B5A6E;
  display:grid;place-items:center;cursor:pointer;padding:0;margin:0;font-size:15px}
.ms-drawer .drawer-body{padding:20px 22px;display:flex;flex-direction:column;gap:0}
.ms-drawer .empty-note{color:#5A6577;font-size:13.5px;margin:0 0 6px;line-height:1.5}
.ms-drawer .settings-row{display:flex;align-items:center;gap:14px;padding:13px 0;border-bottom:1px solid #E4DFD5}
.ms-drawer .settings-row>div:first-child{flex:1;min-width:0}
.ms-drawer .settings-row b{display:block;font-size:14px;font-weight:600;color:#17324D}
.ms-drawer .settings-row span{display:block;font-size:12px;color:#5A6577;margin-top:1px}
.ms-drawer .settings-grp{font-size:10.5px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:#5A6577;margin:18px 0 2px}
.ms-drawer .sw{width:46px;height:26px;border-radius:999px;border:1px solid #D8D2C6;background:#F4F1EB;position:relative;cursor:pointer;padding:0;margin:0;flex:0 0 auto}
.ms-drawer .sw i{position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(11,14,26,.2);transition:left .14s}
.ms-drawer .sw[aria-checked="true"]{background:#2563EB;border-color:#2563EB}
.ms-drawer .sw[aria-checked="true"] i{left:22px}
.ms-drawer .stepper{display:flex;align-items:center;gap:4px;border:1px solid #D8D2C6;border-radius:10px;padding:3px}
.ms-drawer .stepper button{width:32px;height:30px;border:0;background:transparent;font-weight:700;color:#4B5A6E;border-radius:7px;cursor:pointer;padding:0;margin:0}
.ms-drawer .stepper button:disabled{opacity:.35;cursor:not-allowed}
.ms-drawer .stepper span{min-width:40px;text-align:center;font-size:12.5px;color:#4B5A6E;font-variant-numeric:tabular-nums;margin:0}
.ms-drawer .seg2{display:flex;gap:3px;background:#F4F1EB;border-radius:9px;padding:3px}
.ms-drawer .seg2 button{border:0;background:transparent;font-size:11.5px;font-weight:600;color:#4B5A6E;padding:5px 9px;border-radius:6px;cursor:pointer;margin:0}
.ms-drawer .seg2 button[aria-pressed="true"]{background:#fff;color:#1D4ED8}
/* Colour swatches (Homework colour, Practice colour; 10 Nov 2026): label above, six round buttons below. */
.ms-drawer .settings-row.ms-stack{flex-direction:column;align-items:stretch;gap:10px}
.ms-drawer .ms-swatches{display:flex;gap:8px;flex-wrap:wrap}
.ms-drawer .ms-swatches button{width:44px;height:44px;border-radius:50%;border:2px solid transparent;background:#fff;padding:3px;margin:0;cursor:pointer;display:grid;place-items:center}
.ms-drawer .ms-swatches button i{display:block;width:100%;height:100%;border-radius:50%;background:var(--sw)}
.ms-drawer .ms-swatches button[data-sw="dark"] i{background:radial-gradient(circle,#60A5FA 0 34%,#0F172A 36%)}
.ms-drawer .ms-swatches button[aria-pressed="true"]{border-color:#17324D}
.ms-drawer .ms-swatches button:focus-visible{outline:3px solid #93C5FD;outline-offset:1px}
