#demo-entry { display: none; }
body.empty #demo-entry:not([hidden]) {
  display: flex; align-items: baseline; gap: 4px; width: fit-content; margin: -12px auto 24px;
  font: inherit; font-size: 13.5px; cursor: pointer; color: var(--accent-dark);
  padding: 6px 16px 6px 12px; border-radius: 999px;
  border: 1px solid var(--accent-tint-line); background: var(--accent-tint);
}
#demo-entry:hover { border-color: var(--accent); background: var(--warm); }
#demo-entry .play { font-size: 10px; margin-right: 4px; color: var(--accent); align-self: center; }
#demo-entry b { font-size: 17px; font-weight: 700; margin-left: 3px; font-variant-numeric: tabular-nums; }
#demo-entry i { font-style: normal; font-size: 11px; margin-right: 1px; }

body.public.empty #sugs, body.public #cost { display: none; }

#demo-cta { display: none; }
body.public.empty #demo-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px;
  margin: 14px auto 0; font-size: 13px; color: var(--muted);
}
#demo-cta a {
  text-decoration: none; font-weight: 600; padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--fg);
}
#demo-cta a:first-of-type { background: var(--accent); border-color: var(--accent); color: var(--bg); }
#demo-cta a:hover { border-color: var(--accent); }

.demo-hole {
  position: fixed; z-index: 9001; pointer-events: none; border-radius: 12px;
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 200vmax var(--scrim);
  animation: demo-in .25s ease-out;
}
.demo-hole.none { left: 50%; top: 50%; width: 0; height: 0; box-shadow: 0 0 0 200vmax var(--scrim); }
.demo-hole.move { transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease; }

.demo-pop {
  position: fixed; z-index: 9002; width: min(380px, calc(100vw - 24px));
  background: var(--panel); color: var(--fg);
  border-radius: 14px; padding: 16px 20px 14px;
  box-shadow: 0 16px 48px var(--pop-shadow), 0 0 0 1px var(--line);
  font-size: 14px; line-height: 1.8;
  animation: demo-in .25s ease-out;
}
.demo-pop.move { transition: left .35s ease, top .35s ease; }
.demo-pop.wide { width: min(520px, calc(100vw - 24px)); padding: 22px 26px 16px; }
.demo-pop h3 { margin: 0 24px 6px 0; font-size: 17px; line-height: 1.5; color: var(--heading); font-weight: 700; }
.demo-pop.wide h3 { font-size: 21px; margin-bottom: 8px; }
.demo-pop h3 .nu b { font-size: 1.35em; font-weight: 700; }
.demo-pop h3 .nu i { font-size: .62em; margin: 0 2px; }
.demo-pop p { margin: 0; }
.demo-pop .nb { white-space: nowrap; }
.demo-pop p .nu b { font-size: 1.25em; font-weight: 700; }
.demo-note { margin-top: 8px !important; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.demo-x {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  border: 0; background: none; border-radius: 6px; cursor: pointer; font-size: 18px; line-height: 1; color: var(--subtle);
}
.demo-x:hover { background: var(--hover); color: var(--fg); }

.demo-kicker { font-size: 12px; color: var(--accent-dark); font-weight: 600; margin: 0 28px 2px 0; }
.demo-kicker b { font-size: 16px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.demo-kicker i { font-style: normal; font-size: 10.5px; margin: 0 8px 0 3px; color: var(--muted); }

.demo-segs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 0 30px 10px 0; }
.demo-segs button {
  font: inherit; cursor: pointer; min-width: 0; padding: 5px 0 0; border: 0; background: none;
  border-top: 3px solid var(--line); color: var(--subtle); text-align: left; font-size: 10.5px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.demo-segs button b { font-size: 12px; margin-right: 3px; font-variant-numeric: tabular-nums; }
.demo-segs button.past { border-top-color: var(--accent-tint-line); color: var(--muted); }
.demo-segs button.cur { border-top-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.demo-segs button:hover { color: var(--fg); }

.demo-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.demo-foot .sp { flex: 1; }
.demo-pop .db {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--fg);
}
.demo-pop .db:hover { background: var(--hover); }
.demo-pop .db.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.demo-pop .db.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.demo-pop button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-auto { font: inherit; font-size: 12px; cursor: pointer; border: 0; background: none; padding: 4px 2px; color: var(--muted); white-space: nowrap; }
.demo-auto:hover, .demo-auto.on { color: var(--accent-dark); }

.demo-prog { position: absolute; left: 14px; right: 14px; bottom: 5px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.demo-prog i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; animation: demo-prog linear forwards; }
@keyframes demo-prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.demo-scenes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 5px; }
.demo-scenes button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; cursor: pointer;
  padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--heading);
}
.demo-scenes button:hover { background: var(--hover); border-color: var(--line-strong); }
.demo-scenes b {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; background: var(--accent-tint); color: var(--accent-dark); font-variant-numeric: tabular-nums;
}

.demo-more { margin-top: 14px; display: grid; gap: 5px; }
.demo-more .cap { font-size: 12px; color: var(--muted); }
.demo-more ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.demo-more li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; line-height: 1.6; padding: 3px 0 3px 12px; border-left: 2px solid var(--line); }
.demo-more li b { font-size: 13px; color: var(--heading); }
.demo-more li span { font-size: 12px; color: var(--muted); }
.demo-pop a.db { text-decoration: none; display: inline-block; line-height: inherit; }
.demo-pop a.db:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#composer.demo-typing { border-color: var(--accent); background: var(--warm); }
.demo-press { outline: 3px solid var(--accent) !important; outline-offset: 2px; transition: outline-offset .2s; }

html.demo-on #input { caret-color: transparent; }

@keyframes demo-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .demo-hole, .demo-pop { animation: none; }
  .demo-hole.move, .demo-pop.move { transition: none; }
}

@media (max-width: 640px) {
  html.demo-sheet #app { height: calc(100vh - var(--demo-sheet, 0px)); height: calc(100dvh - var(--demo-sheet, 0px)); }
  html.demo-sheet body.empty #dock { padding-bottom: 14px; }
  html.demo-sheet #notice-pop { max-height: calc(100dvh - var(--demo-sheet, 0px) - 58px); }
  html.demo-sheet #todo-pop, html.demo-sheet #recwin {
    bottom: calc(var(--demo-sheet, 0px) + 10px); max-height: calc(100dvh - var(--demo-sheet, 0px) - 66px);
  }
  html.demo-sheet .demo-pop {
    left: 0 !important; top: auto !important; bottom: 0; width: 100%; box-sizing: border-box;
    border-radius: 16px 16px 0 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    font-size: 15px; line-height: 1.7; animation: none; transition: none;
  }
  html.demo-sheet .demo-pop h3 { font-size: 18px; margin-bottom: 4px; }
  html.demo-sheet .demo-kicker, html.demo-sheet .demo-note { display: none; }
  html.demo-nodock body:not(.empty) #dock { display: none; }
  html.demo-sheet .demo-segs { margin-bottom: 8px; }
  html.demo-sheet .demo-segs button { padding-top: 7px; font-size: 11px; }
  html.demo-sheet .demo-foot { margin-top: 10px; }
  html.demo-sheet .demo-prog { bottom: auto; top: 0; left: 0; right: 0; border-radius: 0; }

  .demo-pop .db { min-height: 44px; padding: 8px 18px; font-size: 15px; }
  .demo-pop a.db { display: inline-flex; align-items: center; }
  .demo-x { width: 40px; height: 40px; top: 4px; right: 4px; font-size: 22px; }
  .demo-auto { min-height: 44px; font-size: 13px; }

  .demo-pop.wide { padding: 18px 18px 14px; max-height: calc(100dvh - 24px); overflow-y: auto; font-size: 15px; }
  .demo-pop.wide h3 { font-size: 20px; }
  .demo-scenes button { min-height: 44px; }
  .demo-pop.wide .demo-foot { flex-wrap: wrap; }
  .demo-pop.wide .demo-foot .sp { display: none; }
  .demo-pop.wide .demo-foot .db { flex: 1 1 auto; text-align: center; justify-content: center; }

  body.empty #demo-entry:not([hidden]) { display: block; width: auto; text-align: center; border-radius: 14px; padding: 10px 14px; line-height: 1.6; }
}
