/* ============================================================
   All is Well — Student Portal : in-page help ("?")
   A small "?" beside every screen and section title opens a plain-English
   explanation inside the site. Same look as the Leadership Dashboard help. Brand: purple #662D91 for text and
   buttons, lavender tints for surfaces. Flat colour, no gradients.
   Dashboard version built 15 Sep 2026; copied here 23 Sep 2026.
   ============================================================ */

/* ---- the "?" button ---- */
.help-trigger{
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;margin-left:8px;border-radius:50%;
  background:var(--lav-tint,#F3EEF8);color:var(--purple,#662D91);
  border:1.5px solid var(--lavender,#A381BD);
  font-family:var(--font);font-size:13px;font-weight:700;line-height:1;
  cursor:pointer;vertical-align:middle;user-select:none;
  transition:background .15s,transform .15s,border-color .15s;
}
h1 .help-trigger{width:26px;height:26px;font-size:15px;margin-left:10px;position:relative;top:-2px}
.help-trigger:hover{background:var(--purple,#662D91);color:#fff;border-color:var(--purple,#662D91);transform:scale(1.08)}
.help-trigger:focus-visible{outline:2px solid var(--purple,#662D91);outline-offset:2px}

/* ---- the popup ---- */
.help-backdrop{
  position:fixed;inset:0;z-index:9500;
  background:rgba(102,45,145,.18);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);
  display:flex;align-items:center;justify-content:center;padding:20px;
  animation:help-fade .18s ease-out;
}
@keyframes help-fade{from{opacity:0}to{opacity:1}}
.help-modal{
  background:#fff;border-radius:16px;border-top:4px solid var(--purple,#662D91);
  width:100%;max-width:680px;max-height:86vh;overflow-y:auto;position:relative;
  box-shadow:0 18px 50px rgba(40,20,60,.22);
  animation:help-rise .22s ease-out;
}
@keyframes help-rise{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
.help-head{
  position:sticky;top:0;z-index:1;background:#fff;
  display:flex;align-items:center;gap:12px;padding:18px 26px 14px;
  border-bottom:1px solid var(--lav-line,#DCD2E7);
}
.help-head .help-icon{
  width:36px;height:36px;flex-shrink:0;border-radius:10px;
  background:var(--purple,#662D91);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:19px;font-weight:700;
}
.help-head h3{flex:1;margin:0;font-size:18px;font-weight:600;letter-spacing:-.01em;color:var(--ink,#221A2C);line-height:1.3}
.help-head .help-kicker{display:block;font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft,#5A4E66);margin-bottom:2px}
.help-close{
  width:32px;height:32px;border-radius:8px;flex-shrink:0;
  background:var(--lav-tint,#F3EEF8);border:1px solid var(--lav-line,#DCD2E7);
  color:var(--ink-soft,#5A4E66);font-size:18px;font-weight:600;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.help-close:hover{background:var(--lav-tint-2,#E9E1F1);color:var(--purple,#662D91)}
.help-body{padding:18px 26px 24px;font-size:14.5px;line-height:1.65;color:var(--ink,#221A2C)}
.help-body h4{
  font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;
  color:var(--purple,#662D91);margin:18px 0 6px;
}
.help-body h4:first-child{margin-top:0}
.help-body p{margin:0 0 10px}
.help-body ul,.help-body ol{margin:6px 0 12px 22px}
.help-body li{margin-bottom:5px}
.help-body strong,.help-body b{color:var(--ink,#221A2C);font-weight:600}
.help-body code{
  background:var(--lav-tint,#F3EEF8);border:1px solid var(--lav-line,#DCD2E7);
  padding:1px 6px;border-radius:4px;font-size:12.5px;color:var(--purple,#662D91);
}
.help-body .help-callout{
  background:var(--lav-tint,#F3EEF8);border-left:3px solid var(--purple,#662D91);
  padding:10px 14px;border-radius:0 8px 8px 0;margin:12px 0;font-size:13.5px;
}
.help-body .help-callout.warn{background:#FBF4E6;border-left-color:var(--warn,#9A6206)}
.help-body .help-callout.danger{background:#FCEDEC;border-left-color:var(--bad,#B3261E)}
.help-body .help-callout.ok{background:#EAF6EE;border-left-color:var(--ok,#1E7A48)}
.help-body table{width:100%;border-collapse:collapse;font-size:13.5px;margin:8px 0 14px}
.help-body th{background:var(--purple,#662D91);color:#fff;text-align:left;padding:7px 10px;font-weight:600;font-size:12px;letter-spacing:.04em;text-transform:uppercase}
.help-body td{padding:7px 10px;border-bottom:1px solid var(--lav-line,#DCD2E7);vertical-align:top}
.help-body .help-kbd{display:inline-block;border:1px solid var(--lav-line);border-bottom-width:2px;border-radius:4px;padding:0 6px;font-size:12px;background:#fff}
.help-foot{
  display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;
  padding:14px 26px 18px;border-top:1px solid var(--lav-line,#DCD2E7);background:var(--bg-off,#F8F5FB);
  font-size:13px;color:var(--ink-soft,#5A4E66);
}
.help-foot a{color:var(--purple,#662D91);font-weight:600;text-decoration:none}
.help-foot a:hover{text-decoration:underline}
.help-foot .help-manual-btn{
  display:inline-block;padding:8px 14px;border-radius:999px;background:var(--purple,#662D91);color:#fff;font-weight:600;
}
.help-foot .help-manual-btn:hover{background:var(--purple-deep,#4A2069);text-decoration:none}

/* ---- floating "Help" button (bottom-right, every tab) ---- */
.help-fab{
  position:fixed;right:18px;bottom:18px;z-index:9000;
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 16px;border-radius:999px;border:none;cursor:pointer;
  background:var(--purple,#662D91);color:#fff;font-family:var(--font);font-size:14px;font-weight:600;
  box-shadow:0 8px 24px rgba(74,32,105,.28);
}
.help-fab:hover{background:var(--purple-deep,#4A2069)}
.help-fab .q{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:#fff;color:var(--purple,#662D91);font-weight:700;font-size:14px}
@media print{.help-trigger,.help-fab,.help-backdrop{display:none!important}}
@media (max-width:600px){
  .help-modal{border-radius:14px;max-height:92vh}
  .help-head{padding:14px 18px 12px}
  .help-body{padding:16px 18px 20px;font-size:14px}
  .help-fab{right:12px;bottom:12px;padding:9px 13px;font-size:13px}
}

/* ---- how-to videos inside the popup (help/videos.js, 28 Sep 2026) ---- */
.help-trigger{position:relative}
.help-trigger.has-video::after{
  content:"";position:absolute;right:-5px;bottom:-4px;width:12px;height:12px;border-radius:50%;
  background:var(--purple,#662D91) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.5 3.2v5.6L9 6z' fill='%23fff'/%3E%3C/svg%3E") center/100% no-repeat;
  border:1.5px solid #fff;box-sizing:content-box;
}
.help-video{margin:0 0 18px;border:1px solid var(--lav-line,#DCD2E7);border-radius:10px;overflow:hidden;background:var(--bg-off,#F8F5FB)}
.help-vhead{display:flex;align-items:center;gap:9px;padding:9px 12px;font-size:13.5px}
.help-vhead b{flex:1;font-weight:600;color:var(--ink,#221A2C);line-height:1.3}
.help-vnote{font-size:11.5px;color:var(--ink-soft,#5A4E66);white-space:nowrap}
.help-vplay{
  flex:none;display:inline-block;width:18px;height:18px;border-radius:50%;
  background:var(--purple,#662D91) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.5 3.2v5.6L9 6z' fill='%23fff'/%3E%3C/svg%3E") center/100% no-repeat;
}
.help-vframe{background:#1d0f2a;aspect-ratio:16/9;line-height:0}
.help-vframe video{display:block;width:100%;height:100%;background:#1d0f2a}
.help-vmore{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:10px 12px}
.help-vmore > span{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft,#5A4E66);margin-right:4px}
.help-vchip{
  display:inline-flex;align-items:center;gap:6px;padding:5px 10px 5px 6px;border-radius:6px;cursor:pointer;
  border:1px solid var(--lav-line,#DCD2E7);background:#fff;color:var(--purple,#662D91);
  font-family:var(--font);font-size:12.5px;font-weight:600;line-height:1.2;text-align:left;
}
.help-vchip .help-vplay{width:15px;height:15px;background-color:var(--lavender,#A381BD)}
.help-vchip:hover{background:var(--lav-tint,#F3EEF8)}
.help-vchip.on{border-color:var(--purple,#662D91);background:var(--lav-tint,#F3EEF8)}
.help-vchip.on .help-vplay{background-color:var(--purple,#662D91)}

/* ---- additions for this site ---- */
summary .help-trigger{width:20px;height:20px;font-size:12px}
/* when a side panel is open, move the Help button to the left so it never covers Save */
body:has(#drawer:not([hidden])) .help-fab{right:auto;left:18px}
/* "?" inside the purple staff bar and the yellow demo bar */
.staffbar .help-trigger,.demobar .help-trigger{width:20px;height:20px;font-size:12px}
