.runner {
  header {
    background-color: #f8f8f8;
    box-shadow: 0 1px 3px #ccc;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    left: 0;
    line-height: 22px;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
  }

  .sel-url-wrap {
    display: flex;
    flex-grow: 2;
    padding-left: 0.4em;
  }

  .selector-playground-toggle-tooltip-wrapper {
    display: flex;
  }

  .header-button {
    background: none;
    border: none;
    color: #4f4f4f;
    cursor: pointer;
    border-radius: 0;
    display: block;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    outline: 0;
    padding: 10px 16px;
    text-align: center;
    touch-action: manipulation;
    white-space: nowrap;
    user-select: none;

    &:focus {
      background: transparent;
    }

    &:hover {
      background: #e9e9e9;
    }

    &:active {
      box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
      background: #e9e9e9;
    }

    &[disabled],
    &[disabled]:hover,
    &[disabled]:active {
      background: none;
      box-shadow: none;
      color: #999;
    }
  }

  .display-selector-playground {
    padding-left: 0;

    .selector-playground-toggle {
      display: block;
    }
  }

  .showing-selector-playground {
    .selector-playground {
      display: flex;
    }

    .selector-playground-toggle {
      background-color: #e9e9e9;
      box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    }
  }

  .showing-studio {
    .studio {
      display: flex;
    }
  }

  .header-popup {
    align-items: center;
    background-color: #f8f8f8;
    border-top: solid 1px #e3e3e3;
    display: none;
    padding: 8px;
    position: relative;
    width: 100%;
    color: #565554;
  }

  .selector-playground {
    &.invalid-selector, &.no-elements {
      .selector-input {
        input {
          color: #E74C41;

          &:focus, &:active {
            border: 1px solid lighten(#E74C41, 20%);
            box-shadow: 0 0 0 0.1rem rgba(255,0,0,.25);
          }
        }
      }
    }

    &.no-elements, &.invalid-selector {
      .num-elements {
        background-color: #CC4239;
      }
    }

    .selector {
      font-size: 1em;
      align-items: center;
      display: flex;
      position: relative;
      width: calc(100% - 115px);
    }

    .selector-info {
      color: #4971C6;
      margin: 0 1.5em;
      white-space: nowrap;
    }

    .num-elements {
      margin-right: 5px;
      margin-left: 0;
      font-size: 100%;
      padding: 4px 6px;
    }

    .selector,
    .selector-input,
    .info .spacer {
      font-family: $font-mono;
    }

    .wrap {
      align-items: center;
       // needs a background to hide the copy-to-clipboard backer input
      background: #f8f8f8;
      display: flex;
      flex-grow: 2;
      padding: 0 6px;
    }

    .syntax-object { color: #e45649; }
    .syntax-operator { color: #383a42; }
    .syntax-method { color: #6478f2; }
    .syntax-string { color: #50a160; }

    .selector-input {
      flex-grow: 2;

      input {
        border: 0;
        color: #476fc9;
        min-width: 5em;
        outline: none;
        padding: 6px 8px 6px 9px;
        font-family: $font-mono;
        border: 1px solid #ced4da;
        font-size: 1em;
        border-radius: 6px;
        width: 100%;

        &:focus {
          border: 1px solid #80bdff;
          box-shadow: 0 0 0 0.1rem rgba(0,123,255,.25);
        }
      }
    }

    .copy-backer {
      font-size: 1px;
      left: 6px;
      position: absolute;
      top: 6px;
      z-index: -1;
    }

    .method {
      position: relative;

      button {
        border: 0;
        background-color: #f8f8f8;
        color: #565554;
        padding: 5px 0 4px;
        font-family: $font-mono;
        font-size: 1em;

        &:hover {
          color: #111;
        }

        &:focus, &:active {
          outline: 0;
          box-shadow: none;
        }
      }

      .syntax-method {
        cursor: pointer;
        border-bottom: dotted 1px #6478f2;
      }

      .method-picker {
        background: #f8f8f8;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        display: none;
        font-size: 12px;
        padding: 3px;
        position: absolute;
        top: 110%;
        left: 7px;
        border-radius: 6px;
        border: 1px solid #ddd;

        div {
          cursor: pointer;
          margin-top: 2px;
          padding: 3px 6px;

          &:first-child {
            margin-top: 0;
          }

          &:hover {
            background: #e3e3e3;
          }
        }
      }

      &.is-showing .method-picker {
        display: block;
      }
    }

    .highlight-toggle {
      background: #f8f8f8;
      border: 0;
      padding: 0;
      margin-right: 5px;
      color: #767574;
      padding-left: 3px;

      &.active, &:active {
        box-shadow: none;
        color: #4971C6;
      }

      &:focus {
        outline: 0;
      }

      .fa-stack {
        font-size: 14px;
      }

      .fa-square {
        top: 0px;
        left: 0px;
        font-size: 22px;
      }

      .fa-mouse-pointer {
        left: 1.5px;
        top: -1px;
        font-size: 10px;
      }
    }

    button.copy-to-clipboard, button.print-to-console {
      background: #fff;
      border: 1px solid #ced4da;
      color: #565554;
      padding: 6px 8px;
      font-size: 0.9em;

      &:disabled, &:disabled:hover, &:disabled:focus, &:disabled:active {
        cursor: not-allowed;
        outline: 0;
        opacity: 0.65;
        background-color: #fff;
        color: #565554;
      }

      &:hover, &:focus, &:active {
        box-shadow: none;
        color: #333;
        outline: 0;
        background-color: #f8f8f8;
      }
    }

    button.copy-to-clipboard {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }

    button.print-to-console {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
      border-left: 0;
    }

    .info {
      display: block;
      margin-left: 6px;
    }

    .close {
      background: none;
      border: none;
      color: #888;
      padding: 4px 6px;
      position: absolute;
      top: 0;
      right: 5px;
      font-weight: bold;

      &:hover,
      &:focus,
      &:active {
        color: #333;
        outline: 0;
        box-shadow: none;
      }
    }
  }

  .studio {
    font-family: $open-sans;
    font-size: 1em;
    font-weight: 600;
    padding: 0;

    .text-block {
      padding: 10px;
      text-transform: uppercase;

      .icon {
        margin-right: 3px;
        color: #3386d4;

        i {
          @extend .fa-magic;
        }

        &.is-active {
          animation: flash-studio-recording 1.5s linear infinite;
          color: $error;

          i {
            @extend .fa-circle;
          }
        }

        @keyframes flash-studio-recording {
          0%, 60% {
            opacity: 1;
          }

          61%, 100% {
            opacity: 0;
          }
        }
      }

      .beta {
        color: #b4b5bc;
      }

      &:not(:first-child) {
        border-left: solid 1px #e3e3e3;
      }
    }

    .link-disabled {
      opacity: 0.5;
      cursor: default;

      &:hover, &:focus {
        color: $link-text;
        text-decoration: none;
      }
    }
  }

  .url-container {
    display: flex;
    flex-grow: 2;
    padding: 10px 5px;
    position: relative;

    &.menu-open {
      z-index: 2;
    }
  }

  .loading-container {
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 2px 18px 18px 2px;
    color: #555;
    display: none;
    font-size: 0.9em;
    height: 26px;
    line-height: 26px;
    padding-left: 5px;
    padding-right: 3px;
    position: absolute;
    right: 0;
    top: 10px;

    i {
      margin: 0 5px 0 2px;
      font-size: 14px;
    }
  }

  .loading .loading-container {
    display: inline-block;
  }

  .url {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
    border: solid 1px #d3d3d3;
    border-radius: 20px;
    font-size: 12px;
    height: 26px;
    outline: none;
    padding: 2px 10px;
    letter-spacing: 0.3px;
    width: 100%;

    &:not(.input-active) {
      cursor: pointer;

      &:hover,
      &:focus,
      &:active {
        color: #2363CC;
        text-decoration: underline;
      }
    }
  }

  .loading .url {
    padding-right: 87px;
  }

  .highlighted .url,
  .url:focus {
    background-color: #FFF4DE;
  }

  .menu {
    padding: 10px 0;
    text-align: right;
  }

  .viewport-info {
    margin-top: 1px;
    margin-right: 5px;
    margin-left: 5px;
    position: relative;

    button {
      background: none;
      border: none;
      color: #888;
      outline: none;
      padding: 0;
      text-shadow: 0 1px 1px #FFF;

      i {
        font-size: 0.9em;
        margin-left: 5px;
      }

      &:active {
        box-shadow: none;
      }

      &:hover {
        background: none;
        color :#333;
      }

      &:focus {
        background: none;
      }
    }

    // HACK: Do not change this. It preloads the font to prevent rendering
    // issues in the reporter when taking screenshots
    .the-x {
      font-family: $open-sans;
    }
  }

  .viewport-scale {
    font-size: 12px;
    margin-left: 3px;
    opacity: 0.9;
  }

  .popup-menu {
    background: #FFF;
    background-clip: padding-box;
    border: solid 1px rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    display: none;
    padding: 7px 15px;
    z-index: 999;
  }

  .menu-open .popup-menu {
    display: block;
  }

  .viewport-menu {
    position: absolute;
    right: 0;
    text-align: left;
    top: 100%;
    width: 300px;

    i {
      font-size: 13px;
      margin-right: 5px;
    }
  }

  .url-menu {
    border-radius: 5px;
    font-size: 14px;
    position: absolute;
    text-align: center;
    top: 45px;
    width: 250px;

    p {
      margin-bottom: 5px;
    }

    .menu-buttons {
      display: flex;
      justify-content: space-between;

      button {
        border-radius: 5px;
        font-family: $font-sans;
        font-size: 12px;
        padding: 4px 12px;

        i {
          font-size: 10px;
        }

        &:focus {
          outline: none;
        }

        &.btn-cancel {
          background-color: #e8e8ec;
          border-color: #e8e8ec;
          color: #777;

          &:hover, &:focus {
            background-color: darken(#e8e8ec, 5%);
            border-color: darken(#e8e8ec, 5%);
          }
        }

        &.btn-submit {
          background-color: #3386d4;
          border-color: #3386d4;
          color: #fff;

          &:hover, &:focus {
            background-color: darken(#3386d4, 10%);
            border-color: darken(#3386d4, 10%);
          }

          &[disabled],
          &[disabled]:hover,
          &[disabled]:active {
            background-color: #3386d4;
            opacity: 0.5;
          }
        }
      }
    }

    &::before {
      content: " ";
      position: absolute;
      bottom: 100%;
      left: 50%;
      margin-left: -10px;
      border-width: 10px;
      border-style: solid;
      border-color: transparent transparent rgba(0, 0, 0, 0.15) transparent;
    }

    &::after {
      content: " ";
      position: absolute;
      bottom: 100%;
      left: 50%;
      margin-left: -9px;
      border-width: 9px;
      border-style: solid;
      border-color: transparent transparent white transparent;
    }
  }

  .menu-cover {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.2);

    &.menu-cover-display {
      display: block;
    }
  }

  @media all and (max-width: 950px) {
    header {
      justify-content: flex-end;
    }

    .sel-url-wrap {
      width: 100%;
    }

    .selector-playground {
      border-right: solid 1px #e3e3e3;
      flex-grow: 2;
      width: auto;
    }

    .showing-selector-playground .menu {
      border-bottom: none;
      padding-left: 5px;
      order: 3;
    }
  }
}
