/* ══ Create menu: the pill that spreads into its panel ════ */
/* Bencho's "Create menu" (MIT, bencho.dev/licence); js/ux/create-menu.js drives it, on every dropdown: the Stories pill, Choose's filter menus, the country code.
   Bencho's tokens have no global mapping here, on purpose. --fill-slab / --board (the shape's fill) and --pane-edge (its edge) are read from each panel at the moment it
   opens, because a dropdown here is dark on the scenes, white on the Day map and white on the paper pages. --fill-on / --ink, the -rgb pair and --font-ui are the rows' and
   pills' own, already set by R13. The !important is deliberate and only ever holds for the few hundred ms of the move: these beat the app's own hide and show rules. */

/* width, height and the corner are written from the spring; nothing is laid out inside the shape */
.cm-body {
  position: absolute;
  display: block;
  margin: 0;
  pointer-events: none;
  contain: layout;}

/* the panel goes clear and holds still while the shape does the moving */
.cm-run {
  background: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;}

.cm-open { animation: none !important; }

.cm-run:not(.cm-in) { pointer-events: none !important; }

.cm-row {
  transition-property: opacity, translate !important;
  transition-duration: 160ms, 220ms !important;
  transition-timing-function: ease, cubic-bezier(0.22, 1, 0.36, 1) !important;
  transition-delay: var(--cm-d, 0ms) !important;}

/* going down, the words only fade (a short ease, the far rows first, no slide): sliding 6px while fading, under a shrinking edge, read as a glitch in the text */
.cm-run:not(.cm-in) .cm-row {
  opacity: 0 !important;
  translate: none !important;
  transition-duration: 150ms, 0ms !important;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1), linear !important;}

/* the pill during the move */
.cm-pill {
  transition: opacity 150ms ease, scale 420ms cubic-bezier(0.22, 1, 0.36, 1) !important;}

/* 120 against a 95ms handoff: the spread starts while this
   is still running, so there is never a frame where nothing
   is moving */
.cm-pill.cm-sink {
  scale: 0.94;
  transition: scale 160ms cubic-bezier(0.22, 1, 0.36, 1) !important;}

.cm-gone { opacity: 0 !important; pointer-events: none !important; }

/* ---------- where the panel sits: on its pill, not under it, so the pill can become it ---------- */
body #ui > #sdock .sd-pop.cm-open { top: 0; bottom: auto; z-index: 2; min-width: max(15rem, 100%); }
body #ui > #sdock.sd-low .sd-pop.cm-open { top: auto; bottom: 0; }

/* the panel's big soft shadow, apart from the shape: still, only faded (js/ux/create-menu.js) */
.cm-shadow {
  position: absolute;
  display: block;
  margin: 0;
  pointer-events: none;
  will-change: opacity;}
