/* Menus, toasts and dialogs. */

/* the surface of what is raised over the page */
.menu,
.toast {
  background: var(--pop);
  border: 1px solid var(--popb);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.menu {
  position: fixed;
  z-index: 50;
  min-width: 200px;
  max-width: 340px;
  padding: 6px;
}
.mi {
  position: relative;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-radius: 4px;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}
.mi:hover,
.mi.open {
  background: var(--sel);
}
.mi.dis {
  color: var(--dim);
  cursor: default;
}
.mi.dis:hover {
  background: none;
}
.mi kbd,
.mi .mi-hint,
.mi .why {
  margin-left: auto;
  padding-left: 18px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
}
.mi .why {
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}
.mi .lead {
  width: 16px;
  flex: none;
  display: grid;
  place-items: center;
}
.mi .more {
  margin-left: auto;
  width: 12px;
  height: 12px;
}
.mi .mi-hint + .more {
  margin-left: 0;
}
.msep {
  height: 1px;
  background: var(--line);
  margin: 5px 2px;
}
.mhead {
  padding: 4px 8px 2px;
  color: var(--dim);
  font-size: 11.5px;
}
.menu .menu {
  display: none;
  position: absolute;
  left: calc(100% - 2px);
  top: -7px;
}
.menu.flip .menu {
  left: auto;
  right: calc(100% - 2px);
}
.mi:hover > .menu,
.mi.open > .menu {
  display: block;
}
.toast {
  position: fixed;
  right: 52px;
  bottom: 36px;
  z-index: 60;
  max-width: min(380px, calc(100vw - 32px));
  padding: 10px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}
/* what git says in several lines reads as lines */
.toast span {
  white-space: pre-line;
}
.toast button {
  color: var(--link);
  white-space: nowrap;
}
.veil {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  padding: 16px;
}
.dlg {
  width: min(440px, 100%);
  background: var(--bg);
  border: 1px solid var(--popb);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dlg h2 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}
.dlg label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
/* what is said under a field of a dialog */
.dlg .dlg-hint {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.45;
}
/* why what a dialog asked for was refused: the words of whoever refused it, with their lines */
.dlg .dlg-no {
  margin: 6px 0 0;
  color: var(--red);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.dlg .acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
/* a dialog there is nothing to confirm in at the moment */
.dlg .acts .btn:disabled {
  opacity: 0.45;
  cursor: default;
  filter: none;
}
.dlg.wide {
  width: min(880px, calc(100vw - 48px));
}
/* the button that confirms with more under an arrow beside it: the two read as one */
.dlg .acts .split {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.dlg .acts .more {
  position: relative;
  margin-left: -7px;
}
.dlg .acts .arrow {
  padding-inline: 6px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid color-mix(in srgb, currentColor 35%, transparent);
}
.dlg .acts .arrow .i {
  transform: rotate(90deg);
}
.dlg .acts .more .menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
}
.dlg .acts .oth {
  margin-right: auto;
}

@media (max-width: 700px) {
  .toast {
    right: 16px;
  }
}
