avatar {
  border-radius: $circular_radius;
  font-weight: bold;

  // The list of colors to generate avatars.
  // Each avatar color is represented by a font color, a gradient start color and a gradient stop color.
  // There are 8 different colors for avtars in the list if you change the number of them you
  // need to update the NUMBER_OF_COLORS in src/adw-avatar.c.
  // The 2D list has this form: ((font-color, gradient-top-color, gradient-bottom-color)).
  $avatarcolorlist: (
   (#cfe1f5, #83b6ec, #337fdc), // blue
   (#caeaf2, #7ad9f1, #0f9ac8), // cyan
   (#cef8d8, #8de6b1, #29ae74), // green
   (#e6f9d7, #b5e98a, #6ab85b), // lime
   (#f9f4e1, #f8e359, #d29d09), // yellow
   (#ffead1, #ffcb62, #d68400), // gold
   (#ffe5c5, #ffa95a, #ed5b00), // orange
   (#f8d2ce, #f78773, #e62d42), // raspberry
   (#fac7de, #e973ab, #e33b6a), // magenta
   (#e7c2e8, #cb78d4, #9945b5), // purple
   (#d5d2f5, #9e91e8, #7a59ca), // violet
   (#f2eade, #e3cf9c, #b08952), // beige
   (#e5d6ca, #be916d, #785336), // brown
   (#d8d7d3, #c0bfbc, #6e6d71), // gray
  );

  @for $i from 1 through length($avatarcolorlist) {
    &.color#{$i} {
      $avatarcolor: nth($avatarcolorlist, $i);
      background-image: linear-gradient(nth($avatarcolor, 2), nth($avatarcolor, 3));
      color: nth($avatarcolor, 1);
    }
  }

  &.contrasted { color: white; }

  &.image { background: none; }
}

$opaque_button_default_bg: mix($base_color, $fg_color, 85%);

button {
  @at-root %opaque_button {
    box-shadow: none;
    transition: $button_transition;

    .osd &:focus:focus-visible {
      outline: none;
    }

    &:hover {
      background-image: image(gtkalpha(currentColor, .1));
    }

    &.keyboard-activating,
    &:active {
      background-image: image(transparentize(black, .8));
    }

    &:checked {
      background-image: image(transparentize(black, .85));

      &:hover {
        background-image: image(transparentize(black, .95));
      }

      &.keyboard-activating,
      &:active {
        background-image: image(transparentize(black, .7));
      }
    }
  }

  &.opaque {
    @extend %opaque_button;

    background-color: $opaque_button_default_bg;
    color: $fg_color;
  }

  &.destructive-action {
    @extend %opaque_button;

    color: $destructive_fg_color;

    &, &:checked {
      background-color: $destructive_color;
    }
  }

  &.suggested-action {
    @extend %opaque_button;

    color: $suggested_fg_color;

    &, &:checked {
      background-color: $suggested_color;
    }
  }

  // hide separators
  &.font {
    separator { background-color: transparent; }
    > box { border-spacing: 6px; }
    > box > box > label { font-weight: bold; }
  }

  @at-root %pill_button,
  &.pill {
    min-height: $medium_size;
    min-width: $medium_size;
    padding: $cont_padding;
    border-radius: $circular_radius;

    &.text-button {
      padding: 0 $cont_padding * 2;
    }

    &.image-text-button {
      padding: $cont_padding $cont_padding * 2;
    }
  }

  &.card {
    background-clip: padding-box;
    font-weight: inherit;
    padding: 0;
    @include button(normal);
    box-shadow: none;

    transition: $button_transition;

    &:hover {
      @include button(hover);
    }

    &.keyboard-activating,
    &:active {
      @include button(active);
    }

    &:checked {
      @include button(active);
    }

    &:drop(active) {
      color: $drop_target_color;
      box-shadow: inset 0 0 0 1px $drop_target_color;
    }
  }
}

menubutton {
  &.osd {
    background: none;
    color: inherit;

    > button { @extend %osd_button; }
  }

  &.circular > button { @extend %circular_button; }
  &.flat > button {
    @extend %flat_button;

    &:active {
      color: $fg_color;
    }

    &:checked {
      color: $selected_bg_color;
      background-color: transparent;
    }
  }

  &.pill > button { @extend %pill_button; }

  &.suggested-action {
    background-color: $suggested_color;
    color: $suggested_fg_color;
  }

  &.destructive-action {
    background-color: $destructive_color;
    color: $destructive_fg_color;
  }

  &.opaque {
    background-color: $opaque_button_default_bg;
    color: $fg_color;
  }

  &.suggested-action,
  &.destructive-action,
  &.opaque {
    border-radius: $bt_radius;

    &.circular, &.pill {
      border-radius: $circular_radius;
    }

    > button {
      @extend %opaque_button;

      &, &:checked {
        background-color: transparent;
        color: inherit;
      }
    }
  }

  &.image-button > button {
    min-width: 24px;
    padding-left: 5px;
    padding-right: 5px;
  }

  arrow {
    min-height: 16px;
    min-width: 16px;
    &.none {
      -gtk-icon-source: -gtk-icontheme('open-menu-symbolic');
    }
    &.down {
      -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
    }
    &.up {
      -gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
    }
    &.left {
      -gtk-icon-source: -gtk-icontheme('pan-start-symbolic');
    }
    &.right {
      -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
    }
  }
}

splitbutton {
  border-radius: $bt_radius;

  &, & > separator {
    transition: $button_transition;
    transition-property: background;
  }

  > separator {
    margin-top: 6px;
    margin-bottom: 6px;
    background: none;
  }

  > menubutton > button {
    padding-left: 4px;
    padding-right: 4px;
  }

  // Since the inner button doesn't have any style classes on it,
  // we have to add them manually
  &.image-button > button {
    min-width: 24px;
    padding-left: 6px;
    padding-right: 6px;
  }

  &.text-button.image-button > button,
  &.image-text-button > button {
    padding-left: 9px;
    padding-right: 9px;

    > box {
      border-spacing: 6px;
    }
  }

  // Reimplementing linked so we don't blow up css
  > button:dir(ltr),
  > menubutton > button:dir(rtl) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: -1px;
  }

  > button:dir(rtl),
  > menubutton > button:dir(ltr) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
  }

  @at-root %flat_split_button,
  &.flat {
    > separator {
      background: $borders_color;
    }

    &:hover,
    &:active,
    &:checked {
      background: gtkalpha(currentColor, 0.1);
      color: $fg_color;

      > separator {
        background: none;
      }
    }

    &:focus-within:focus-visible > separator {
      background: none;
    }

    > button,
    > menubutton > button {
      @extend %flat_button;

      border-radius: $bt_radius;
    }
  }

  &.suggested-action {
    background-color: $suggested_color;
    color: $suggested_fg_color;
  }

  &.destructive-action {
    background-color: $destructive_color;
    color: $destructive_fg_color;
  }

  &.opaque {
    background-color: $opaque_button_default_bg;
    color: $fg_color;
  }

  &.suggested-action,
  &.destructive-action,
  &.opaque {
    > button, > menubutton > button {
      @extend %opaque_button;

      &, &:checked {
        color: inherit;
        background-color: transparent;
      }
    }

    > menubutton > button {
      &:dir(ltr) { box-shadow: inset 1px 0 $borders_color; }
      &:dir(rtl) { box-shadow: inset -1px 0 $borders_color; }
    }
  }

  > menubutton > button > arrow.none {
    -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
  }
}

buttoncontent {
  border-spacing: 6px;

  > label {
    font-weight: bold;

    &:dir(ltr) { padding-right: 2px; }
    &:dir(rtl) { padding-left: 2px; }
  }

  .arrow-button > box > &,
  splitbutton > button > & {
    > label {
      &:dir(ltr) { padding-right: 0; }
      &:dir(rtl) { padding-left: 0; }
    }
  }
}

//
// Toasts
//

toast {
  @extend %osd;
  margin: 12px;
  margin-bottom: 24px;
  border-radius: $circular_radius;
  border-spacing: 6px;
  padding: 6px;

  &:dir(ltr) { padding-left: 12px; }
  &:dir(rtl) { padding-right: 12px; }

  > widget {
    margin: 0 6px;
  }

  button {
    @extend %osd_button;
  }
}

//
// AdwStatusPage
//

statuspage {
  > scrolledwindow > viewport > box {
    margin: 36px 12px;
    border-spacing: 36px;

    > clamp > box {
      border-spacing: 12px;

      > .icon {
        -gtk-icon-size: 128px;

        color: gtkalpha(currentColor, 0.45);

        &:disabled {
          opacity: 0.45;
        }

        &:not(:last-child) {
          margin-bottom: 24px;
        }
      }
    }
  }

  &.compact > scrolledwindow > viewport > box {
    margin: 24px 12px;
    border-spacing: 24px;

    > clamp > box {
      > .icon {
        -gtk-icon-size: 96px;

        &:not(:last-child) {
          margin-bottom: 12px;
        }
      }

      > .title {
        font-size: 18pt;
      }
    }
  }
}

// Cards
.card {
  @at-root %card, & {
    @include button(normal);
    border-radius: $bt_radius;
    box-shadow: none;
    border: 1px solid $borders_color;
    background-clip: padding-box;

    .osd &, &.osd {
      @include button(osd);
    }
  }

  &.activatable {
    transition: $button_transition;

    &:hover {
      background-image: image(gtkalpha(currentColor, .03));
    }

    &:active {
      background-image: image(gtkalpha(currentColor, .08));
    }
  }
}

// preferences
preferencespage > scrolledwindow > viewport > clamp > box {
  margin: 24px 12px;
  border-spacing: 24px;
}

preferencesgroup > box {
  &, .labels {
    border-spacing: 6px;
  }

  > box.header:not(.single-line) {
    margin-bottom: 6px;
  }

  > box.single-line {
    min-height: 34px;
  }
}

//
// viewswitcher
//

viewswitcher {
  margin: 0;

  button.toggle {
    &:hover {
      background-color: rgba($header_fg, 0.06);
      color: $header_fg;
    }

    &:active {
      background-color: rgba($header_fg, 0.16);
      color: $header_fg;
    }

    &:checked {
      background-color: rgba($header_fg, 0.08);
      color: $header_fg;
      box-shadow: inset 0 -2px $selected_bg_color;
    }
  }

  &.wide {
    border-spacing: 0;

    button.toggle {
      border-radius: 0;
      margin: 0;
      border: none;
    }
  }

  &.narrow button.toggle {
    border-radius: 0;
    margin: 0;
    border: none;
  }

  button.toggle {
    font-weight: bold;
    padding: 0;
    min-height: 0;
    border: none;

    > stack > box {
      &.narrow {
        font-size: 0.75rem;
        padding-top: 6px;
        padding-bottom: 5px;
        border-spacing: 3px;

        > stack > label {
          padding-left: 8px;
          padding-right: 8px;
        }
      }

      &.wide {
        padding: 0 12px;
        border-spacing: 6px;
      }
    }
  }
}

// AdwViewSwitcherBar
viewswitcherbar actionbar > revealer > box {
  padding: 0;

  viewswitcher {
    margin-top: -1px;

    button.toggle {
      &:hover {
        background-color: rgba($fg_color, 0.06);
        color: $fg_color;
      }

      &:active {
        background-color: rgba($fg_color, 0.16);
        color: $fg_color;
      }

      &:checked {
        background-color: rgba($fg_color, 0.08);
        color: $fg_color;
        box-shadow: inset 0 2px $selected_bg_color;
      }
    }
  }
}

// AdwViewSwitcherTitle
viewswitchertitle {
  margin-top: 0;
  margin-bottom: 0;

  viewswitcher {
    margin-left: 12px;
    margin-right: 12px;

    &.narrow {
      margin-top: 0;
      margin-bottom: 0;

      button.toggle {
        > stack > box {
          &.narrow {
            padding-top: 0;
            padding-bottom: 0;
            border-spacing: 0;
          }
        }
      }
    }

    &.wide {
      margin-top: 0;
      margin-bottom: 0;
    }
  }

  windowtitle {
    margin-top: 0;
    margin-bottom: 0;
  }
}

// AdwIndicatorBin
indicatorbin {
  > indicator, > mask {
    min-width: 6px;
    min-height: 6px;
    border-radius: $circular_radius;
  }

  > indicator {
    margin: 1px;
    background: gtkalpha(currentColor, .4);

    > label {
      font-size: 0.6rem;
      font-weight: bold;
      padding: 0 4px;
      color: white;
    }
  }

  > mask {
    padding: 1px;
    background: black;
  }

  &.needs-attention > indicator {
    background: $selected_bg_color;

    > label { color: $selected_fg_color; }
  }
}

//
// tab-view
//

tabbar {
  .box {
    min-height: $menuitem_size;
    padding: 0;
  }

  tabbox {
    padding: 0;

    > tabboxchild {
      @include focus-ring();

      border-radius: 0;
      margin-bottom: 0;
      margin-top: 0;
    }

    > separator {
      margin-top: 9px;
      margin-bottom: 9px;
      transition: opacity 150ms ease-in-out;

      &.hidden {
        opacity: 0;
      }
    }

    > revealer > indicator {
      min-width: 2px;
      border-radius: 2px;
      margin: 9px 6px;
      background: gtkalpha($selected_bg_color, 0.5);
    }
  }

  tab {
    transition: background 150ms ease-in-out;

    &:selected, &:checked {
      background-color: transparent;
      box-shadow: inset 0 -2px $selected_bg_color;
      color: $fg_color;
    }

    &:hover:not(:selected):not(:checked) {
      box-shadow: inset 0 -2px mix($selected_bg_color, $header_bg, 50%);
    }
  }

  .start-action,
  .end-action {
    padding: 5px;
  }

  .start-action:dir(ltr),
  .end-action:dir(rtl) {
    padding-right: 0;
  }

  .start-action:dir(rtl),
  .end-action:dir(ltr) {
    padding-left: 0;
  }

  &:not(.inline) {
    .box {
      background-color: $bg_color;
      color: $alt_fg_color;
      padding-bottom: 0;
      box-shadow: inset 0 -1px $borders_color;
      border: none;
    }

    &:backdrop .box {
      transition: $backdrop_transition;

      > scrolledwindow,
      > .start-action,
      > .end-action {
        filter: opacity(0.5);
        transition: $backdrop_transition;
      }
    }
  }
}

dnd tab {
  background-color: $bg_color;
  color: $alt_fg_color;
  box-shadow: none;
  margin: 24px;
}

tabbar,
dnd {
  tab {
    min-height: $menuitem_size;
    padding: 2px 6px 3px 6px;
    border-radius: 0;

    button.image-button {
      padding: 0;
      margin: 0;
      min-width: 20px;
      min-height: 20px;
      border-radius: $circular_radius;
      border: none;

      &:hover {
        @extend %undecorated_button;
        color: lighten(red, 15%);
        background-color: darken($bg_color, 5%);
      }

      &:active {
        @extend %undecorated_button;
        color: $selected_bg_color;
        background-color: darken($bg_color, 8%);
      }
    }

    indicator {
      min-height: 2px;
      border-radius: 2px;
      background: gtkalpha($selected_bg_color, 0.5);
    }
  }
}

tabview:drop(active),
tabbox:drop(active) {
  box-shadow: none;
}

// Transition shadows
flap,
leaflet,
navigation-view,
overlay-split-view {
  @include transition-shadows($borders_color);
}

toolbarview.undershoot-top scrolledwindow {
  @include undershoot-indication(top);
}

toolbarview.undershoot-bottom scrolledwindow {
  @include undershoot-indication(bottom);
}

// Sidebar
.unfolded stacksidebar.sidebar { border: none; }

$side_border: rgba($side_theme_fg, 0.12);

.sidebar-pane {
  color: $side_theme_fg;
  background-color: $side_theme_bg;

  &:backdrop {
    background-color: $side_theme_bg;
    transition: background-color $longer_duration $deceleration_curve;
  }

  .sidebar,
  headerbar,
  .navigation-sidebar,
  searchbar > revealer > box {
    background-color: transparent;
    box-shadow: none;
    border: none;
  }

  headerbar {
    color: $side_theme_alt_fg;

    button:not(.suggested-action):not(.destructive-action) {
      color: $side_theme_alt_fg;
      border: none;
  
      &:hover {
        color: $side_theme_fg;
        background-color: rgba($side_theme_fg, 0.25);
      }
  
      &:active, &:checked {
        @include button(active);
      }

      &:disabled {
        color: rgba($side_theme_fg, 0.45);
      }
    }
  }

  .navigation-sidebar {
    > separator { background: none; }

    > row {
      @extend %side_views;
    }
  }

  .dim-label { color: rgba($side_theme_fg, 0.45); }

  button { @extend %side_buttons; }

  entry { @extend %side_entry; }

  searchbar { @extend %side_searchbar; }

  list {
    &.boxed-list, &.content {
      background-color: rgba($side_theme_fg, 0.05);
    }

    > separator { background-color: transparent; }

    > row { @extend %side_views; }
  }

  popover {
    modelbutton.flat {
      &:disabled, &:disabled label {
        color: $insensitive_fg_color;
      }
    }
  }

  toolbarview.undershoot-top scrolledwindow {
    @include undershoot-indication(top, $bc: $side_border, $style: 'solid');
  }

  toolbarview.undershoot-bottom scrolledwindow {
    @include undershoot-indication(bottom, $bc: $side_border, $style: 'solid');
  }

  scrolledwindow {
    &.undershoot-top {
      @include undershoot-indication(top, $bc: $side_border, $style: 'solid');
    }

    &.undershoot-bottom {
      @include undershoot-indication(bottom, $bc: $side_border, $style: 'solid');
    }

    &.undershoot-start {
      &:dir(ltr) { @include undershoot-indication(left, $bc: $side_border, $style: 'solid'); }
      &:dir(rtl) { @include undershoot-indication(right, $bc: $side_border, $style: 'solid'); }
    }

    &.undershoot-end {
      &:dir(ltr) { @include undershoot-indication(right, $bc: $side_border, $style: 'solid'); }
      &:dir(rtl) { @include undershoot-indication(left, $bc: $side_border, $style: 'solid'); }
    }
  }

  flap,
  leaflet,
  navigation-view,
  overlay-split-view {
    @include transition-shadows($borders_color);
  }

  banner > revealer > widget {
    background-color: mix($selected_bg_color, $side_theme_bg, 30%);
    color: $text_color;

    &:backdrop {
      background-color: mix($selected_bg_color, $side_theme_bg, 30%);
    }
  }

  &:dir(ltr), &.end:dir(rtl) {
    &, banner > revealer > widget {
      box-shadow: none;
      border-right: 1px solid $borders_color;
    }
  }

  &:dir(rtl), &.end:dir(ltr) {
    &, banner > revealer > widget {
      box-shadow: none;
      border-left: 1px solid $borders_color;
    }
  }
}

/* Middle pane in three-pane setups */
.sidebar-pane .content-pane {
  background-color: $base_color;
  color: $text_color;

  &:backdrop {
    background-color: $bg_color;
    transition: background-color $longer_duration $deceleration_curve;
  }

  flap,
  leaflet,
  navigation-view,
  overlay-split-view {
    @include transition-shadows($borders_color);
  }

  banner > revealer > widget {
    background-color: mix($selected_bg_color, $base_color, 30%);
    color: $text_color;

    &:backdrop {
      background-color: mix($selected_bg_color, $base_color, 30%);
    }
  }

  &:dir(ltr), &.end:dir(rtl) {
    &, banner > revealer > widget {
      box-shadow: none;
      border-right: 1px solid $borders_color;
    }
  }

  &:dir(rtl), &.end:dir(ltr) {
    &, banner > revealer > widget {
      box-shadow: none;
      border-left: 1px solid $borders_color;
    }
  }
}

.content-pane .sidebar-pane,
.sidebar-pane .content-pane,
.content-pane {
  toolbarview.undershoot-top scrolledwindow {
    @include undershoot-indication(top, $style: 'solid');
  }

  toolbarview.undershoot-bottom scrolledwindow {
    @include undershoot-indication(bottom, $style: 'solid');
  }

  scrolledwindow {
    &.undershoot-top {
      @include undershoot-indication(top, $style: 'solid');
    }

    &.undershoot-bottom {
      @include undershoot-indication(bottom, $style: 'solid');
    }

    &.undershoot-start {
      &:dir(ltr) { @include undershoot-indication(left, $style: 'solid'); }
      &:dir(rtl) { @include undershoot-indication(right, $style: 'solid'); }
    }

    &.undershoot-end {
      &:dir(ltr) { @include undershoot-indication(right, $style: 'solid'); }
      &:dir(rtl) { @include undershoot-indication(left, $style: 'solid'); }
    }
  }
}

.sidebar-pane .sidebar-pane {
  background-color: transparent;
  color: inherit;
}

// Gnome >= 45.0
.sidebar-pane,
.content-pane {
  headerbar {
    &, &:backdrop {
      background-color: transparent;
      box-shadow: none;
    }
  }

  .toolbar {
    background-color: transparent;
    border: none;
  }
}

.top-bar {
  background-color: transparent;
  box-shadow: none;
  border: none;

  .collapse-spacing {
    padding: 0;
  }
}

// preferences
preferencespage > scrolledwindow > viewport > clamp > box {
  margin: 24px 12px;
  border-spacing: 24px;
}

preferencesgroup > box {
  &, .labels {
    border-spacing: 6px;
  }

  > box.header:not(.single-line) {
    margin-bottom: 6px;
  }

  > box.single-line {
    min-height: $medium_size;
  }

  button.background-preview-button.toggle {
    padding: 0;
    background: none;
    box-shadow: none;
    outline-color: transparent;
    outline-width: 2px;
    outline-offset: 3px;
    outline-style: solid;
    border: none;

    &, > background-preview {
      border-radius: $bt_radius;
    }

    &:hover {
      outline-color: rgba($fg_color, 0.06);
    }

    &:active {
      outline-color: rgba($fg_color, 0.2);
    }

    &:checked {
      outline-color: $selected_bg_color;
    }
  }
}


themeselector, // EditorThemeSelector
panelthemeselector { // BuilderThemeSelector
  margin: 9px;

  checkbutton {
    padding: 1px;
    min-height: 44px;
    min-width: 44px;
    background-clip: content-box;
    border-radius: $circular_radius;
    box-shadow: inset 0 0 0 1px $borders_color;

    radio {
      min-height: 16px;
      min-width: 16px;
      transform: translate(27px, 14px);
      padding: 3px;

      &, &:hover, &:disabled {
        -gtk-icon-source: none;
        border: none;
        background: none;
        box-shadow: none;
      }

      &:checked, &:checked:hover, &:active, &:active:hover {
        -gtk-icon-source: -gtk-icontheme("object-select-symbolic");
        background-image: image($selected_bg_color);
        background-color: $selected_bg_color;
        color: $selected_fg_color;
      }
    }

    &.follow:checked,
    &.light:checked,
    &.dark:checked {
      box-shadow: inset 0 0 0 2px $selected_bg_color;
    }

    &.light {
      background-color: #ffffff;
    }

    &.dark {
      background-color: #202020;
    }

    &.follow {
      background-image: linear-gradient(to bottom right, #fff 49.99%, #202020 50.01%);
    }
  }
}

// Gnome Console themeswitcher
themeswitcher {
  padding: 6px;

  .check {
    min-height: 16px;
    min-width: 16px;
    background-color: $selected_bg_color;
    color: $selected_fg_color;
    padding: 2px;
    border-radius: $circular_radius;
    margin: 3px;
    -gtk-icon-size: 20px;
    -gtk-icon-source: -gtk-scaled(-gtk-recolor(url("assets/scalable/check-symbolic.svg")),
                                  -gtk-recolor(url("assets/scalable/check-symbolic@2.svg")));

    &:hover {
      background-color: lighten($selected_bg_color, 10%);
      color: $selected_fg_color;
    }

    &:active {
      background-color: $selected_bg_color;
      color: $selected_fg_color;
    }
  }

  checkbutton {
    radio {
      padding: 0;
      margin: 2px;
      min-height: 48px;
      min-width: 48px;

      &, &:active, &:hover {
        outline-color: $borders_color;
        outline-width: 1px;
        outline-offset: -1px;
        outline-style: solid;
        box-shadow: none;
      }

      &, &:hover, &:active, &:checked, &:checked:hover {
        -gtk-icon-source: none;
        transition: none;
        border: none;
      }
    }

    radio:checked, radio:active {
      &, &:hover {
        box-shadow: inset 0 0 0 2px $selected_bg_color;
      }
    }

    &.system radio {
      &, &:hover, &:active, &:checked, &:checked:hover {
        background-image: linear-gradient(-45deg, #242424 49.99%, white 50.01%);
        background-color: transparent;
      }
    }

    &.light radio {
      &, &:hover, &:active, &:checked, &:checked:hover {
        color: rgba(black, 0.8);
        background-color: white;
      }
    }

    &.dark radio {
      &, &:hover, &:active, &:checked, &:checked:hover {
        color: white;
        background-image: image(#242424);
        background-color: transparent;
      }
    }
  }
}

//
// AdwBanner
//

 banner > revealer > widget {
  /* There are 2 more instances in _sidebars.css, keep in sync with that */
  background-color: rgba($selected_bg_color, 0.3);
  color: $fg_color;
  padding: 6px;

  &:backdrop {
    background-color: rgba($selected_bg_color, 0.15);

    > label, > button {
      filter: opacity(.5);
    }
  }
}

//
// AdwDialog
//

floating-sheet {
  > dimming {
    background-color: rgba(black, 0.25);
  }

  > sheet {
    border-radius: $corner_radius;
    outline: none;
    box-shadow: 0 3px 5px 0 if($variant == 'light', rgba(black, 0.15), rgba(black, 0.12)),
                0 8px 8px 0 if($variant == 'light', rgba(black, 0.15), rgba(black, 0.12)),
                0 0 0 1px $borders_color;
  }
}

dialog.bottom-sheet {
  &.landscape sheet {
    margin-left: 30px;
    margin-right: 30px;

    > outline {
      &.flush-left, &.flush-right, &.flush-left.flush-right {
        box-shadow: 0 0 0 1px $borders_color;
      }
    }
  }
}

dialog-host > dialog.background {
  background: none;

  sheet {
    background-color: $bg_color;
    color: $fg_color;
  }
}

dialog-host > dialog.view {
  background: none;

  sheet {
    @extend %view;
  }
}

dialog-host > dialog.osd:not(progressbar):not(button):not(menubutton):not(splitbutton) {
  background: none;

  sheet {
    @extend %osd;
  }
}