/* Demo School sandbox (feature D1): only demo.html loads this file.
   The real app's styles are src/style.css; nothing here changes them. */

/* The sign-in screens never show in the demo (it opens straight into Demo
   School); hidden before the first paint so they don't flash. The staff
   survey form (#staff-entry) is the "Staff (survey)" view, shown by
   demo-sandbox.js. */
body.m60-demo #landing,
body.m60-demo #school-picker,
body.m60-demo #staff-survey-list,
body.m60-demo #staging-label,
body.m60-demo #idle-warning-banner { display: none !important; }

/* No sign-out in the demo: "Switch Role / Exit" goes; the other button
   reads "Home". */
body.m60-demo .switch-role button:not(#switch-school-btn) { display: none; }

/* The red bar: the visitor's own words, not shouted in capitals. */
body.m60-demo .demo-banner-bar .demo-banner-label { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
body.m60-demo .m60-demo-actions .m60-demo-book {
  font-size: 11.5px; padding: 5px 12px; border-radius: 4px; font-weight: 700; text-decoration: none;
  background: var(--gold); color: var(--navy); border: 1px solid var(--gold); white-space: nowrap;
}
body.m60-demo .m60-demo-actions .m60-demo-book:hover { background: #DDB840; }
body.m60-demo .m60-demo-actions .m60-demo-book:focus-visible,
body.m60-demo .m60-demo-roles button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
body.m60-demo .m60-demo-actions .m60-demo-confirm-text { font-weight: 700; }
/* The Staff (survey) view's fixed copy of the red bar, buttons included. */
body.m60-demo #demo-staff-preview-banner .m60-demo-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; white-space: nowrap; }
body.m60-demo #demo-staff-preview-banner .m60-demo-actions button {
  font-size: 11.5px; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-weight: 700;
  border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12); color: #fff;
}

/* The navy bar: the view buttons. */
body.m60-demo .m60-demo-roles { display: flex; gap: 8px; flex-wrap: nowrap; overflow: hidden; }
body.m60-demo .m60-demo-roles button {
  font-size: 11.5px; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-weight: 700; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.08); color: #fff;
}
body.m60-demo .m60-demo-roles button:hover { background: rgba(255,255,255,.2); }
body.m60-demo .m60-demo-roles button.active { background: var(--gold); border-color: var(--gold); color: var(--navy); }

/* "In the demo, this is simulated" — the same box on every simulated page. */
body.m60-demo .m60-demo-sim {
  padding: 10px 14px; margin-bottom: 14px; border-radius: 6px; text-align: left;
  background: #FBF6E8; border: 1px dashed var(--gold); color: var(--charcoal, #333); font-size: 12.5px; line-height: 1.5;
}
body.m60-demo .m60-demo-sim strong { color: var(--navy); }
body.m60-demo #se-confirm .m60-demo-sim { margin: 0 0 14px; }
/* The demo's note on Staff (survey)'s welcome card. */
body.m60-demo .m60-demo-note {
  margin: 0 0 14px; padding: 8px 12px; border-radius: 6px; text-align: left;
  background: #FBF6E8; border: 1px dashed var(--gold); color: var(--charcoal, #333); font-size: 12.5px; line-height: 1.5;
}

/* Shown only if the demo couldn't start. */
#m60-demo-failed {
  display: none; max-width: 520px; margin: 80px auto; padding: 24px 28px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line); font-family: var(--sans); font-size: 14px; color: var(--navy);
}

/* ---------- The guided checklist (PR D1c) ----------
   Bottom-right, above the page; folds into a small button. */
body.m60-demo .m60-demo-checklist {
  position: fixed; right: 20px; bottom: 20px; z-index: 900; width: 320px; max-height: calc(100vh - 140px); overflow: auto;
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 8px;
  box-shadow: 0 8px 28px rgba(27,42,74,.18); font-family: var(--sans); color: var(--navy);
}
body.m60-demo .m60-demo-checklist.folded { width: auto; border: none; background: none; box-shadow: none; overflow: visible; }
body.m60-demo .m60-demo-checklist-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 6px; }
body.m60-demo .m60-demo-checklist-head h2 { margin: 0; font-size: 14px; font-weight: 800; }
body.m60-demo .m60-demo-checklist-head h2 span { font-weight: 600; color: var(--slate); font-size: 12px; margin-left: 6px; }
body.m60-demo .m60-demo-checklist-hide {
  font-size: 12px; padding: 3px 10px; border-radius: 4px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer;
}
body.m60-demo .m60-demo-checklist ol { list-style: none; margin: 0; padding: 4px 14px 12px; }
body.m60-demo .m60-demo-checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px solid #F0EDE6; }
body.m60-demo .m60-demo-checklist li:first-child { border-top: none; }
body.m60-demo .m60-demo-tick {
  flex: 0 0 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800; background: #EEF1F6; color: var(--navy);
}
body.m60-demo .m60-demo-checklist li.done .m60-demo-tick { background: #1F8A5F; color: #fff; }
body.m60-demo .m60-demo-step {
  border: none; background: none; padding: 0; margin: 0; cursor: pointer; text-align: left;
  font-size: 13px; font-weight: 700; color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px;
}
body.m60-demo .m60-demo-checklist li.done .m60-demo-step { color: var(--slate); text-decoration-color: transparent; }
body.m60-demo .m60-demo-checklist-intro { margin: 0; padding: 0 14px 2px; font-size: 12px; color: var(--slate); line-height: 1.45; }
body.m60-demo .m60-demo-optional { font-size: 12px; font-weight: 600; color: var(--slate); white-space: nowrap; }
body.m60-demo .m60-demo-hint { display: block; font-size: 12px; color: var(--slate); line-height: 1.45; margin-top: 2px; }
body.m60-demo .m60-demo-checklist-done { margin: 0 14px 14px; padding: 10px 12px; background: #FBF6E8; border-radius: 6px; font-size: 12.5px; }
body.m60-demo .m60-demo-checklist-done a { color: var(--navy); font-weight: 700; }
body.m60-demo .m60-demo-checklist-show {
  font-size: 12.5px; font-weight: 700; padding: 9px 14px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--gold); background: var(--navy); color: #fff; box-shadow: 0 4px 14px rgba(27,42,74,.25);
}
body.m60-demo .m60-demo-step:focus-visible,
body.m60-demo .m60-demo-checklist-hide:focus-visible,
body.m60-demo .m60-demo-checklist-show:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
body.m60-demo .m60-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Phones and narrow screens (PR D1c) ----------
   Under 900px wide, only the note shows, until "Continue anyway"
   (body.m60-demo-continue, and a 1200px-wide page from then on). */
#m60-demo-phone { display: none; }
@media (max-width: 899px){
  body.m60-demo:not(.m60-demo-continue) > *:not(#m60-demo-phone) { display: none !important; }
  body.m60-demo:not(.m60-demo-continue) #m60-demo-phone {
    display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px 16px; box-sizing: border-box;
  }
}
#m60-demo-phone .m60-demo-phone-card {
  max-width: 420px; width: 100%; background: #fff; border-radius: 10px; border-top: 4px solid var(--gold);
  padding: 28px 22px; box-shadow: 0 8px 28px rgba(27,42,74,.15); font-family: var(--sans); color: var(--navy); text-align: center;
}
#m60-demo-phone .m60-demo-phone-mark { font-weight: 800; font-size: 14px; letter-spacing: .02em; margin-bottom: 14px; }
#m60-demo-phone .m60-demo-phone-mark span { color: var(--gold); }
#m60-demo-phone h1 { font-family: var(--serif, Georgia, serif); font-size: 24px; line-height: 1.25; margin: 0 0 12px; }
#m60-demo-phone p { font-size: 15px; line-height: 1.55; color: var(--slate); margin: 0 0 22px; }
#m60-demo-phone button { width: 100%; padding: 13px 16px; font-size: 16px; border-radius: 6px; cursor: pointer; }
#m60-demo-phone a { display: inline-block; margin-top: 16px; font-size: 15px; color: var(--navy); font-weight: 700; }

/* ---------- Wide pages (PR D1c) ----------
   Some pages (Section Counts, Master Schedule) are wider than the window
   and the page scrolls sideways. "Book a live demo" and "Reset demo" stay
   pinned to the right edge of the window. The bar clips instead of hiding
   its overflow, so the buttons can stick (overflow:hidden would stop that). */
body.m60-demo #demo-banner { overflow: clip; }
body.m60-demo #demo-banner .m60-demo-actions {
  position: sticky; right: 16px; z-index: 1;
  padding-left: 12px; background: #7A2E1F; box-shadow: -10px 0 10px -6px #7A2E1F;
}

/* ---------- "Show me" walkthroughs (PR D1d) ---------- */
body.m60-demo .m60-demo-showme {
  display: inline-block; margin-top: 6px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--gold); background: #FBF6E8; color: var(--navy);
}
body.m60-demo .m60-demo-showme:hover { background: var(--gold); }
body.m60-demo .m60-demo-showme:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.m60-wt {
  position: absolute; z-index: 1001; width: 320px; max-width: calc(100vw - 32px); box-sizing: border-box;
  background: #fff; color: var(--navy); border: 2px solid var(--gold); border-radius: 10px; padding: 12px 14px 12px;
  box-shadow: 0 10px 30px rgba(27,42,74,.28); font-family: var(--sans); font-size: 13px; line-height: 1.5;
}
/* Walkthrough 7: wider, so shorter (the Board Overview's pinned header row
   leaves less room under the page's title). */
.m60-wt.wide { width: 520px; }
.m60-wt-arrow {
  position: absolute; top: -9px; width: 14px; height: 14px; background: #fff;
  border-left: 2px solid var(--gold); border-top: 2px solid var(--gold); transform: rotate(45deg);
}
.m60-wt.above .m60-wt-arrow { top: auto; bottom: -9px; transform: rotate(225deg); }
.m60-wt.centered .m60-wt-arrow { display: none; }
.m60-wt-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #8A6D12; margin-bottom: 6px; }
.m60-wt-count { color: var(--slate); font-weight: 600; white-space: nowrap; }
.m60-wt-text { outline: none; }
.m60-wt-text:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
.m60-wt-already { display: block; margin-top: 6px; font-size: 12px; color: #1F8A5F; font-weight: 700; }
.m60-wt-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.m60-wt-buttons button { font-size: 12px; padding: 6px 12px; border-radius: 5px; cursor: pointer; }
.m60-wt-buttons button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.m60-wt-ring {
  position: absolute; z-index: 1000; pointer-events: none; border-radius: 6px;
  border: 3px solid var(--gold); box-shadow: 0 0 0 3px rgba(27,42,74,.55);
}
.m60-wt-ring.main { animation: m60-wt-pulse 1.6s ease-in-out infinite; }
@keyframes m60-wt-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(27,42,74,.55); } 50% { box-shadow: 0 0 0 7px rgba(201,162,39,.45); } }
.m60-wt-flash { animation: m60-wt-flash 1s ease-in-out 3; outline: 3px solid var(--gold); outline-offset: -3px; }
@keyframes m60-wt-flash { 50% { background: var(--gold); color: var(--navy); } }
@media (prefers-reduced-motion: reduce){
  .m60-wt-ring.main, .m60-wt-flash { animation: none; }
}
/* "Show me where": a short, stronger pulse on the outline. */
.m60-wt-ring.ping { animation: m60-wt-ping .6s ease-in-out 3; }
@keyframes m60-wt-ping { 50% { box-shadow: 0 0 0 10px rgba(201,162,39,.75); border-color: #E2B93B; } }
@media (prefers-reduced-motion: reduce){ .m60-wt-ring.ping { animation: none; border-width: 5px; } }

/* ---------- Section Counts: headings stay on screen (PR D1d) ----------
   The table scrolls with the page instead of inside its own box, so its
   headings can pin just under the page's title (--m60-sa-head, measured
   by demo-sandbox.js), and the first two columns just right of the side
   menu (240px; 0 when it's hidden) when the page scrolls sideways. */
body.m60-demo #view-sectionAllocation .m60-sa-box { overflow: visible !important; max-height: none !important; }
body.m60-demo #view-sectionAllocation .sa-table thead th { top: calc(var(--sticky-banner-offset, 0px) + var(--m60-sa-head, 0px)); }
body.m60-demo #view-sectionAllocation .sa-table th:nth-child(1),
body.m60-demo #view-sectionAllocation .sa-table td:nth-child(1) { left: var(--m60-sidebar-w, 240px); }
body.m60-demo #view-sectionAllocation .sa-table th:nth-child(2),
body.m60-demo #view-sectionAllocation .sa-table td:nth-child(2) { left: calc(var(--m60-sidebar-w, 240px) + 90px); }
body.m60-demo #view-sectionAllocation .sa-table thead th:nth-child(1),
body.m60-demo #view-sectionAllocation .sa-table thead th:nth-child(2) { z-index: 5; }
body.m60-demo #app-shell.sidebar-hidden { --m60-sidebar-w: 0px; }
.m60-wt.detached .m60-wt-arrow { display: none; }
/* PR D1d review: one outline around everything a bubble talks about,
   and a highlight on each number it names. */
.m60-wt-ring.group { border-radius: 8px; }
.m60-wt-ring.mark {
  z-index: 999; border: 2px solid var(--gold); box-shadow: none; border-radius: 4px;
  background: rgba(201,162,39,.18);
}
.m60-wt-ring.group.cut { border-top-style: dashed; border-top-left-radius: 0; border-top-right-radius: 0; }
