@mobile-breakpoint: 650px;

.touchable {
  transition: all .25s ease;

  &.touching, body:not(.touch) &:active {
    transition: all 0s ease;
  }
}

.touchable-bg(@bgcolor) {
  .touchable;

  &.touching, body:not(.touch) &:active {
    background: fade(darken(desaturate(@bgcolor, 15%), 45%), 50%);
  }
}

.touchable-opacity(@opacity: .65) {
  .touchable;

  &.touching, body:not(.touch) &:active {
    opacity: @opacity;
  }
}

.touchable-custom(@rules) {
  .touchable;

  &.touching, body:not(.touch) &:active {
    @rules();
  }
}

.larger-target(@width, @height) {
  // note: requires element to be positioned.
  &:after {
    content: '';
    position: absolute;
    left: -@width;
    right: -@width;
    top: -@height;
    bottom: -@height;
  }
}

.larger-touch-target(@width, @height) {
  body.touch & {
    .larger-target(@width, @height);
  }
}

.icon(@url, @size, @right-spacing: 0, @opacity: 1) {
  &:before {
    flex-shrink: 0;
    display: inline-block;
    content: '';
    width: @size;
    height: @size;
    margin-right: @right-spacing;
    background: data-uri(@url) no-repeat center center;
    background-size: contain;
    opacity: @opacity;
  }
}

.button-icon(@url, @size, @spacing: 3px, @opacity: .75, @alignment: center) {
  .inner {
    align-items: @alignment;
    display: flex;
    white-space: pre;
    .icon(@url, @size, @spacing, @opacity);
  }
}

.fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

.box-outline {
  &:before {
    content: '';
    .fill;
    border-radius: 3px;
    box-shadow: 0 0 1px fade(black, 65%) inset;
    z-index: 10;
  }
}

.hex {
  position: relative;

  svg {
    .fill;
    width: 100%;
    height: 100%;
  }
}

.raised-filled-button(@color, @radius: 3px, @depth: 1px) {
  text-decoration: none;
  color: white;
  font-weight: bold;
  white-space: nowrap;
  background: @color;
  border: none;
  padding: 4px 14px;
  border-radius: @radius;
  box-shadow: 0 2*@depth 2*@depth fade(black, 12.5%);
  transition: all .15s ease-out;

  .touchable-custom({
    background: desaturate(darken(@color, 15%), 5%);
    box-shadow: 0 0 2*@depth fade(black, 35%);
    transform: translateY((3/2) * @depth);
    transition-duration: .035s;
  });

  &:hover {
    background: darken(@color, 10%);
  }

  &:disabled {
    opacity: .5;
    pointer-events: none;
  }
}

@dialog-padding: 22px;
.dialog-shape() {
  background: rgba(240, 240, 240, .95);
  border-radius: 10px;
  box-shadow: 0 3px 20px rgba(0, 0, 0, .15);
}

.emoji {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  background-repeat: no-repeat;
  background-position: center center;
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: bottom;
}

@neutral-color: #e8e8e8;
@public-color: lighten(blue, 43%);
@pm-color: lighten(green, 63%);
@welcome-color: #e5f2e5;
@account-color: #006500;
@passcode-color: #eedba0;
@manager-color: #ddccff;
@manager-dark-color: darken(desaturate(@manager-color, 15%), 25%);
@topic-color: #4040a8;
@faded-topic-color: #7070be;
@disconnected-color: #ff7c7c;
@error-color: #9d5a5a;
@focus-green: fade(green, 50%);
@brand-color: #80c080;
@pane-bg-color: #f4f4f4;
