/* Persistent marker for the explicit, fictional demo environment. */
body:has(#app-shell.guided-demo) {
  min-width: 0;
  overflow-x: hidden;
}

#app-shell.guided-demo {
  --demo-mode-banner-height: calc(44px + env(safe-area-inset-top));
  width: min(100dvw, 430px);
  max-width: 100%;
  padding-top: var(--demo-mode-banner-height);
}

.demo-mode-banner {
  position: fixed;
  z-index: 120;
  top: 0;
  left: 50%;
  display: flex;
  width: min(100dvw, 430px);
  max-width: 100%;
  min-height: var(--demo-mode-banner-height, calc(44px + env(safe-area-inset-top)));
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(110deg, #073b3d, #075e61);
  box-shadow: 0 8px 22px rgba(4, 27, 30, 0.22);
  color: #fff;
  font-family: var(--font-body, sans-serif);
  transform: translateX(-50%);
}

.demo-mode-banner-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
  line-height: 1.1;
}

.demo-mode-banner-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9px;
}

.demo-mode-banner-icon svg {
  width: 14px;
  height: 14px;
}

.demo-mode-banner-copy strong,
.demo-mode-banner-copy span,
.demo-mode-banner-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-mode-banner-copy strong {
  color: inherit;
  font-family: var(--font-heading, sans-serif);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demo-mode-banner-copy span,
.demo-mode-banner-copy small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 9px;
}

.demo-mode-banner button {
  display: inline-flex;
  min-height: 30px;
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.demo-mode-banner button svg {
  width: 13px;
  height: 13px;
}

.demo-mode-banner button:hover {
  background: rgba(255, 255, 255, 0.21);
}

.demo-mode-banner button:focus-visible {
  outline-color: #fff;
  outline-offset: 2px;
}

#app-shell.guided-demo .topbar {
  top: var(--demo-mode-banner-height);
}

/* Guided tour: it lives outside the inert app shell and owns the top layer. */
.demo-tour-root {
  --demo-tour-overlay: rgba(4, 18, 27, 0.68);
  position: fixed;
  z-index: 260;
  inset: 0;
  pointer-events: none;
  color: var(--ink, #17324b);
  font-family: var(--font-body, sans-serif);
  isolation: isolate;
}

.demo-tour-blocker {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: var(--demo-tour-overlay);
  pointer-events: auto;
  transition: background 180ms ease;
}

.demo-tour-root.has-target .demo-tour-blocker {
  background: transparent;
}

.demo-tour-spotlight {
  position: fixed;
  z-index: 1;
  display: none;
  border: 3px solid #36d1c4;
  background: transparent;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px var(--demo-tour-overlay), 0 0 0 5px rgba(54, 209, 196, 0.18), 0 10px 35px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transition: inset 180ms ease, width 180ms ease, height 180ms ease, opacity 150ms ease;
}

.demo-tour-root.has-target .demo-tour-spotlight {
  display: block;
}

.demo-tour-root.is-moving .demo-tour-spotlight {
  opacity: 0;
}

.demo-tour-card {
  position: fixed;
  z-index: 2;
  width: min(402px, calc(100dvw - 24px));
  max-width: calc(100% - 20px);
  max-height: calc(100dvh - 24px);
  padding: 18px;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--ebag-teal, #089c9d) 28%, var(--line, #ded8cc));
  background: var(--paper-strong, #fff);
  border-radius: 22px;
  box-shadow: 0 24px 72px rgba(3, 18, 29, 0.34);
  pointer-events: auto;
  scrollbar-width: thin;
  transition: top 180ms ease, left 180ms ease, opacity 150ms ease, transform 150ms ease;
}

.demo-tour-card[aria-busy="true"] {
  cursor: progress;
}

.demo-tour-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.demo-tour-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.demo-tour-heading-group {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.demo-tour-eyebrow {
  color: var(--ebag-teal-dark, #05787a);
  font-family: var(--font-heading, sans-serif);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.demo-tour-progress-text {
  color: var(--muted, #5b6c7a);
  font-size: 11px;
  font-weight: 700;
}

.demo-tour-skip {
  min-width: 44px;
  min-height: 34px;
  margin: -7px -8px 0 0;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--muted, #5b6c7a);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.demo-tour-skip:hover {
  background: var(--cream, #f4efe5);
  color: var(--navy, #102a43);
}

.demo-tour-progress {
  height: 5px;
  margin: 12px 0 16px;
  overflow: hidden;
  background: var(--navy-soft, #dbe4ea);
  border-radius: 99px;
}

.demo-tour-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--ebag-teal-dark, #05787a), var(--ebag-teal, #089c9d));
  border-radius: inherit;
  transition: width 220ms ease;
}

.demo-tour-title {
  margin: 0 0 8px;
  color: var(--navy, #102a43);
  font-family: var(--font-heading, sans-serif);
  font-size: clamp(20px, 5.8vw, 24px);
  line-height: 1.14;
}

.demo-tour-body {
  margin: 0;
  color: var(--ink, #17324b);
  font-size: 14px;
  line-height: 1.52;
}

.demo-tour-hint {
  margin: 12px 0 0;
  padding: 10px 11px;
  border-inline-start: 3px solid var(--ebag-teal, #089c9d);
  background: var(--ebag-teal-soft, #dff3f1);
  color: var(--muted, #5b6c7a);
  border-radius: 0 10px 10px 0;
  font-size: 12px;
  line-height: 1.42;
}

.demo-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
}

.demo-tour-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

.demo-tour-button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--line, #ded8cc);
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
}

.demo-tour-button-secondary,
.demo-tour-button-replay {
  background: var(--paper, #fffdf8);
  color: var(--navy, #102a43);
}

.demo-tour-button-replay {
  max-width: 158px;
}

.demo-tour-button-primary {
  border-color: var(--ebag-teal-dark, #05787a);
  background: var(--ebag-teal-dark, #05787a);
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--ebag-teal, #089c9d) 25%, transparent);
}

.demo-tour-button:hover {
  filter: brightness(1.06);
}

.demo-tour-card button:focus-visible {
  outline: 3px solid var(--burgundy, #7d2637);
  outline-offset: 2px;
}

html[data-theme="dark"] .demo-mode-banner {
  border-bottom-color: rgba(119, 213, 205, 0.3);
  background: linear-gradient(110deg, #0a2828, #104442);
}

html[data-theme="dark"] .demo-tour-root {
  --demo-tour-overlay: rgba(0, 5, 7, 0.76);
}

html[data-theme="dark"] .demo-tour-card {
  color-scheme: dark;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] .demo-tour-button-primary {
  border-color: var(--ebag-teal, #4bc2b8);
  background: var(--ebag-teal, #4bc2b8);
  color: #092322;
}

@media (max-width: 350px) {
  #app-shell.guided-demo {
    --demo-mode-banner-height: calc(42px + env(safe-area-inset-top));
  }

  .demo-mode-banner {
    gap: 6px;
    padding-inline: 8px;
  }

  .demo-mode-banner-copy span,
  .demo-mode-banner-copy small {
    display: none;
  }

  .demo-mode-banner button {
    max-width: 116px;
    padding-inline: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .demo-tour-card {
    width: calc(100dvw - 16px);
    max-width: calc(100% - 16px);
    padding: 15px;
    border-radius: 18px;
  }

  .demo-tour-title {
    font-size: 19px;
  }

  .demo-tour-body {
    font-size: 13px;
  }

  .demo-tour-footer,
  .demo-tour-actions {
    gap: 6px;
  }

  .demo-tour-footer {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .demo-tour-actions {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .demo-tour-button {
    min-width: 0;
    padding-inline: 10px;
  }

  .demo-tour-button-replay {
    max-width: min(130px, 44vw);
    white-space: normal;
  }
}

@media (max-height: 590px) {
  .demo-tour-card {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .demo-tour-progress {
    margin-block: 6px 10px;
  }

  .demo-tour-title {
    margin-bottom: 6px;
    font-size: 20px;
  }

  .demo-tour-body {
    font-size: 13px;
    line-height: 1.42;
  }

  .demo-tour-hint {
    margin-top: 7px;
    padding: 7px 9px;
    font-size: 11px;
    line-height: 1.35;
  }

  .demo-tour-footer {
    margin-top: 9px;
  }
}

/* Mobile Chrome can leave far less vertical room while its browser chrome is
 * visible. Compact only the demo shell's decorative spacing; keep controls at
 * a comfortable touch size and leave ordinary-height phones unchanged. */
@media (max-width: 500px) and (max-height: 700px) {
  #app-shell.guided-demo {
    --demo-mode-banner-height: calc(38px + env(safe-area-inset-top));
    --mobile-nav-clearance: calc(64px + env(safe-area-inset-bottom));
  }

  .demo-mode-banner {
    gap: 7px;
    padding: calc(4px + env(safe-area-inset-top)) 10px 4px;
  }

  .demo-mode-banner-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
  }

  .demo-mode-banner-copy small {
    font-size: 8px;
  }

  .demo-mode-banner button {
    min-height: 28px;
    padding-block: 4px;
  }

  #app-shell.guided-demo .topbar {
    min-height: 54px;
    padding-block: 5px;
  }

  #app-shell.guided-demo .mobile-home-brand img {
    width: 34px;
    height: 34px;
  }

  #app-shell.guided-demo .topbar .icon-button,
  #app-shell.guided-demo .topbar-actions .primary-button,
  #app-shell.guided-demo .mobile-actions-menu > summary {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  #app-shell.guided-demo main {
    padding-top: 10px;
  }

  #app-shell.guided-demo .page-heading {
    margin-bottom: 9px;
  }

  #app-shell.guided-demo .page-heading .kicker {
    margin-bottom: 2px;
  }

  #app-shell.guided-demo .page-heading h1,
  #app-shell.guided-demo .compact-heading h1,
  #app-shell.guided-demo #calendar-view > .page-heading h1,
  #app-shell.guided-demo #offers-view .page-heading h1,
  #app-shell.guided-demo #listings-view .page-heading h1 {
    margin-bottom: 2px;
    font-size: 25px;
  }

  #app-shell.guided-demo .month-controls {
    min-height: 44px;
  }

  #app-shell.guided-demo .month-controls .icon-button,
  #app-shell.guided-demo .month-label {
    min-height: 40px;
  }

  #app-shell.guided-demo .roster-sync-banner {
    margin-bottom: 8px;
  }

  #app-shell.guided-demo .sidebar,
  #app-shell.guided-demo .sidebar.open {
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 4px 5px calc(4px + env(safe-area-inset-bottom));
  }

  #app-shell.guided-demo .sidebar .nav-item,
  #app-shell.guided-demo .sidebar.open .nav-item {
    min-height: 54px;
  }

  #app-shell.guided-demo .sidebar .nav-item[data-nav="calendar"] {
    min-height: 60px;
    margin-top: -8px;
  }

  #app-shell.guided-demo .sidebar .nav-item[data-nav="calendar"] > svg {
    width: 36px;
    height: 36px;
    margin-top: -5px;
    padding: 7px;
  }
}

@media (max-width: 500px) and (max-height: 520px) {
  .demo-mode-banner-copy small,
  .demo-tour-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-tour-blocker,
  .demo-tour-spotlight,
  .demo-tour-card,
  .demo-tour-progress-fill {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .demo-tour-spotlight {
    border: 4px solid Highlight;
  }

  .demo-tour-card,
  .demo-tour-button,
  .demo-mode-banner {
    border: 1px solid CanvasText;
  }
}
