window {
  // lamefun trick to get rounded borders regardless of CSD use
  border-width: 0px;

  // this needs to be transparent
  // see bug #722563
  $_wm_border: if($variant=='light', transparentize(black, 0.77), transparentize(black, 0.25));
  $_wm_border_backdrop: if($variant=='light', transparentize(black, 0.82), transparentize(black, 0.25));

  &.csd {
    box-shadow: 0 3px 9px 1px transparentize(black, 0.5),
                0 2px 6px 2px transparent,
                0 0 0 1px $_wm_border; //doing borders with box-shadow
    margin: 0px;
    border-radius: $window_radius;

    @if $variant == 'dark' {
      $_window_outline: if($contrast=='high', transparentize(white, .7), transparentize(white, .9));
      outline: 1px solid $_window_outline;
      outline-offset: -1px;
    }

    &:backdrop {
      // the transparent shadow here is to enforce that the shadow extents don't
      // change when we go to backdrop, to prevent jumping windows.
      // The biggest shadow should be in the same order then in the active state
      // or the jumping will happen during the transition.
      box-shadow: 0 3px 9px 1px transparent,
                  0 2px 6px 2px transparentize(black, 0.8),
                  0 0 0 1px $_wm_border_backdrop;
      transition: $backdrop_transition;
    }

    &.dialog.message {
      box-shadow: 0 1px 2px transparentize(black, 0.8),
                  0 0 0 1px transparentize($_wm_border, 0.1);
    }

    &.tiled,
    &.tiled-top,
    &.tiled-left,
    &.tiled-right,
    &.tiled-bottom {
      border-radius: 0;
      outline: none;

      box-shadow: 0 0 0 1px $_wm_border,
                  0 0 0 20px transparent; //transparent control workaround -- #3670

      &:backdrop {
        box-shadow: 0 0 0 1px $_wm_border_backdrop,
                    0 0 0 20px transparent;
      }
    }

    &.maximized,
    &.fullscreen {
      border-radius: 0;
      outline: none;
      box-shadow: none;
      transition: none;
    }
  }

  &.solid-csd {
    margin: 0;
    padding: 4px;
    border: solid 1px $borders_color;
    border-radius: 0;
    box-shadow: inset 0 0 0 4px $borders_color, inset 0 0 0 3px $headerbar_bg_color;

    &:backdrop { box-shadow: inset 0 0 0 4px $borders_color, inset 0 0 0 3px $bg_color; }
  }

  // server-side decorations as used by mutter
  &.ssd { box-shadow: 0 0 0 1px $_wm_border; } //just doing borders, wm draws actual shadows
}
