/* J191: the demo's bar and its notice (scripts/build-demo.mjs, public/js/demo-mode.js).
   Tokens only; the page's own sheet already loaded tokens.css. */
.demo-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--color-ink); color: var(--color-surface);
  font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif); font-size: 14px; line-height: 1.35;
  box-shadow: 0 -8px 24px rgba(15, 27, 51, 0.25);
}
.demo-bar__text { margin: 0; font-weight: 600; text-align: center; }
.demo-bar__views { display: inline-flex; gap: 6px; padding: 3px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.12); }
.demo-bar__view { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill); color: var(--color-surface); font-weight: 700; text-decoration: none; }
.demo-bar__view[aria-current="page"] { background: var(--color-surface); color: var(--color-ink); }
.demo-bar__view:focus-visible, .demo-bar__go:focus-visible, .demo-bar__exit:focus-visible { outline: 2px solid var(--color-surface); outline-offset: 2px; }
/* J204: the way out and the way in, on every demo page at every width. Plain links. */
.demo-bar__actions { display: inline-flex; gap: 8px; }
.demo-bar__exit, .demo-bar__go { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill); font-weight: 800; text-decoration: none; white-space: nowrap; }
.demo-bar__exit { border: 1.5px solid var(--color-on-dark-muted); color: var(--color-surface); background: transparent; }
.demo-bar__exit:hover { border-color: var(--color-surface); }
.demo-bar__go { background: var(--color-primary); color: var(--color-surface); }
/* Dark mode: the page is the bar's navy, so the bar gets a visible top edge. */
html[data-theme="dark"] .demo-bar { border-top: 1px solid var(--color-night-edge); }
/* Room for the bar under the last line of every page. */
body[data-demo] { padding-bottom: 128px; }
@media (max-width: 1023.98px) { body[data-demo] { padding-bottom: 176px; } }
/* Organizer pages keep their phone tab bar (68px) at the very bottom: the demo bar sits on it. */
@media (max-width: 1023.98px) {
  body[data-demo="organizer"] .demo-bar { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; }
  body[data-demo="organizer"] { padding-bottom: 260px; }
  .demo-bar { gap: 6px 10px; padding-top: 8px; }
  .demo-bar__text { flex-basis: 100%; font-size: 13px; }
  .demo-bar__view, .demo-bar__exit, .demo-bar__go { min-height: 36px; padding: 0 12px; }
}
/* J204: the bar starts where the rail ends. It was 12rem (the old 192px sidebar), and the app rail is 84px: the 108px between showed the light page as a white box at the bottom left. */
@media (min-width: 1024px) { body[data-demo="organizer"] .demo-bar { left: 12rem; } html.app-c body[data-demo="organizer"] .demo-bar { left: 84px; } }
@media print { .demo-bar { display: none; } body[data-demo] { padding-bottom: 0; } }

.demo-notice { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 27, 51, 0.55); }
.demo-notice[hidden] { display: none; }
.demo-notice__box { max-width: 420px; width: 100%; padding: 22px; border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-card); }
.demo-notice__text { margin: 0 0 16px; font-size: 17px; font-weight: 700; line-height: 1.4; }
.demo-notice__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-notice__go { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--radius-pill); background: var(--color-primary); color: var(--color-surface); font-weight: 800; text-decoration: none; }
.demo-notice__close { min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); border: 1.5px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-ink); font-weight: 700; }

/* The /demo intro (the indexable page only). */
.demo-intro { margin: 0 0 20px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-card); font-size: 15px; line-height: 1.5; }
.demo-intro__sample { font-weight: 700; color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
/* The intro card stays white in Dark mode, so its link keeps the blue focus ring (the navy-theme light ring is 1.47:1 on white). */
html body[data-demo] .demo-intro a.demo-intro__sample:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
