// ---------------------------
// GENERAL SHARED STYLES
// ---------------------------

.wrapping {
  margin: 0;
  font-size: 0;
  list-style: none;
  &_box {
    margin: 0;
    text-align: left;
    white-space: normal;
    vertical-align: top;
    font-size: $fontSize;
    display: inline-block;
    box-sizing: border-box;
  }
  &.vmiddle > &_box { vertical-align: middle; }
  &.nowrap {
    overflow: hidden;
    white-space: nowrap;
  }
}

.justified {
  margin: 0;
  font-size: 0;
  list-style: none;
  text-align: justify;
  text-justify: newspaper;
  text-align-last: justify;
  &:after {
    height: 0;
    width: 100%;
    content: '';
    overflow: hidden;
    visibility: hidden;
    display: inline-block;
  }
  &_box {
    margin: 0;
    text-align: left;
    font-size: $fontSize;
    display: inline-block;
    text-align-last: auto;
    vertical-align: middle;
    box-sizing: border-box;
  }
  &.vtop > &_box { vertical-align: top; }
}

.centered {
  margin: 0;
  height: 100%;
  font-size: 0;
  line-height: 0;
  list-style: none;
  word-spacing: -1px;
  text-align: center;
  white-space: nowrap;
  &:before, &:after {
    width: 0;
    content: '';
    height: 100%;
    display: inline-block;
    vertical-align: middle;
  }
  &_content {
    line-height: normal;
    white-space: normal;
    word-spacing: normal;
    font-size: $fontSize;
    display: inline-block;
    vertical-align: middle;
  }
}


// ---------------------------
// GLOBAL BUSY INDICATOR
// ---------------------------

@function svg-spinner($color: #FFF) {
  @return '
  <g fill="none" stroke="#{$color}" stroke-width="4" stroke-linecap="round">
    <line opacity="1.00" x1="24"   y1="4"    x2="24"   y2="12"/>
    <line opacity="0.20" x1="34"   y1="6.7"  x2="30"   y2="13.6"/>
    <line opacity="0.20" x1="41.4" y1="14"   x2="34.4" y2="18"/>
    <line opacity="0.28" x1="44"   y1="24"   x2="36"   y2="24"/>
    <line opacity="0.36" x1="34.4" y1="30"   x2="41.4" y2="34"/>
    <line opacity="0.44" x1="30"   y1="34.4" x2="34"   y2="41.4"/>
    <line opacity="0.52" x1="24"   y1="36"   x2="24"   y2="44"/>
    <line opacity="0.60" x1="18"   y1="34.4" x2="14"   y2="41.4"/>
    <line opacity="0.68" x1="13.6" y1="30"   x2="6.7"  y2="34"/>
    <line opacity="0.76" x1="12"   y1="24"   x2="4"    y2="24"/>
    <line opacity="0.84" x1="6.7"  y1="14"   x2="13.6" y2="18"/>
    <line opacity="0.92" x1="14"   y1="6.7"  x2="18"   y2="13.6"/>
  </g>';
}

@keyframes spinner {
  0%    { transform: rotate(0deg); }
  100%  { transform: rotate(360deg); }
}

.page-busy-overlay {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  z-index: 9999;
  position: fixed;
  visibility: hidden;
  background: rgba(#111, 0.8);
  transform: translate3d(0,0,0);
  transition: opacity 0.3s, visibility 0.3s;
  .page-busy & {
    opacity: 1;
    visibility: visible;
    transition-delay: 2s;
    &:before { display: block; }
  }
  &:before {
    top: 50%;
    left: 50%;
    content: '';
    width: 48px;
    height: 48px;
    display: none;
    position: absolute;
    margin: -24px 0 0 -24px;
    transform-origin: 24px 24px;
    animation: spinner 1s infinite steps(12);
    @include background-svg(48, 48, svg-spinner());
  }
}


// ---------------------------
// IMAGE UPLOAD FORM
// ---------------------------

.image-form {
  label {
    z-index: 1;
    padding: 5px;
    width: 150px;
    height: 150px;
    cursor: pointer;
    background: #FFF;
    position: relative;
    vertical-align: top;
    display: inline-block;
    background-clip: padding-box;
    border: 1px solid rgba(#000, 0.06);
    &:before {
      top: 50%;
      left: 50%;
      z-index: 1;
      color: #BBB;
      display: block;
      line-height: 2;
      padding: 0 0.8em;
      border-radius: 1em;
      position: absolute;
      white-space: nowrap;
      transition: color 0.2s;
      content: attr(data-empty);
      background: rgba(#FFF, 0);
      font-family: $fontFamilyHead;
      transform: translate(-50%, -50%);
    }
    &:hover {
      &:before {
        z-index: 3;
        color: #533;
        content: attr(data-hover);
        background: rgba(#FFF, 0.8);
      }
      img { opacity: 0.5; }
    }
  }
  img {
    z-index: 2;
    position: relative;
    transition: opacity 0.2s;
  }
  input[type=file] {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    opacity: 0;
    outline: none;
    position: absolute;
    clip: rect(0,0,0,0);
  }
  &.busy {
    label { cursor: default; }
    label:before, label:hover:before {
      padding: 0;
      z-index: 3;
      content: '';
      width: 48px;
      height: 48px;
      transform: none;
      background: none;
      margin: -24px 0 0 -24px;
      transform-origin: 24px 24px;
      animation: spinner 1s infinite steps(12);
      @include background-svg(48, 48, svg-spinner(#000));
    }
    img, label:hover img { opacity: 0.3; }
  }
}


// ---------------------------
// TOOLTIP
// ---------------------------

// Subject link accessibility styles
a[data-controller="tooltip"] {
  &:focus {
    outline: 2px solid #0078D4;
    outline-offset: 2px;
    border-radius: 2px;
  }
  
  &:focus:not(:focus-visible) {
    outline: none;
  }
}

.tooltip {
  color: #FFF;
  padding: 15px;
  text-align: left;
  max-width: 400px;
  line-height: 1.2;
  position: absolute;
  border-radius: 5px;
  margin: 6px 0 0 -5px;
  background: rgba(#000, 0.85);
  box-shadow: 0 5px 15px rgba(#000, 0.12);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // Ensure tooltip is properly layered above other content
  z-index: 1000;
  &:before {
    left: 10px;
    content: '';
    bottom: 100%;
    position: absolute;
    border: 6px solid transparent;
    border-top-width: 0;
    border-bottom-color: rgba(#000, 0.8);
  }
  a {
    color: #AAA;
    &:hover { color: #FFF; }
  }
  &_header {
    color: inherit;
    margin: 0 0 0.5em 0;
  }
  &_content {
    margin: 0.5em 0;
    line-height: 1.2;
    p { margin: 0.5em 0; }
    a { color: #FE8; }
  }
  &_footer { margin: 0.8em 0 0 0; }
}

.tippy-box {
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  background-color: rgba(#000, 0.85);
}

.tippy-arrow {
  color: rgba(#000, 0.85);
}


.expanded-abbreviation {
  cursor: help;
  text-decoration: italic;
  background-size: 2px 1px;
  background-repeat: repeat-x;
  background-position: 0 1.1em;
  background-image: linear-gradient(to right, transparent 50%, currentColor 50%);
}



.original-abbreviation {
  /* hide and position tooltip */
/*  top: -0.5em; */
  color: white;
  font-size: 150%;
  color: #FFF;
  padding: 10px;
  text-align: left;
  max-width: 400px;
  line-height: 1.2;
  position: relative;
  border-radius: 5px;
  margin: 6px 0 0 -5px;
  background: rgba(#000, 0.85) !important;
  box-shadow: 0 5px 15px rgba(#000, 0.12);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* border-radius: 5px; */
  opacity: 0;
  position: absolute;
  -webkit-transition: opacity 0.5s;
  -moz-transition: opacity 0.5s;
  -ms-transition: opacity 0.5s;
  -o-transition: opacity 0.5s;
  transition: opacity 0.5s;
}

.expanded-abbreviation:hover .original-abbreviation {
  /* display tooltip on hover */
  opacity: 1;
}


.footnote-marker {
  cursor: help;
  text-decoration: italic;
  background-size: 2px 1px;
  background-repeat: repeat-x;
  background-position: 0 1.1em;
  background-image: linear-gradient(to right, transparent 50%, currentColor 50%);
}



.footnote-body {
  /* hide and position tooltip */
/*  top: -0.5em; */
  color: white;
  font-size: 100%;
  color: #FFF;
  padding: 10px;
  text-align: left;
  max-width: 800px;
  width: 20em;
  line-height: 1.2;
  position: relative;
  border-radius: 5px;
  margin: 6px 0 0 -5px;
  background: rgba(#000, 0.85);
  box-shadow: 0 5px 15px rgba(#000, 0.12);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* border-radius: 5px; */
  opacity: 0;
  position: absolute;
  -webkit-transition: opacity 0.5s;
  -moz-transition: opacity 0.5s;
  -ms-transition: opacity 0.5s;
  -o-transition: opacity 0.5s;
  transition: opacity 0.5s;
}

.footnote-marker:hover .footnote-body {
  /* display tooltip on hover */
  opacity: 1;
}


// ---------------------------
// APPLICATION SHARED STYLES
// ---------------------------

.fgred { color: $fgRed !important; }
.fgfaded { color: $bodyFgFaded; }
.fglight { color: $bodyFgLight; }

.breadcrumbs {
  padding: 0;
  list-style: none;
  color: $bodyFgLight;
  margin: 0 0 $gapSize / 2 0;
  font-size: $fontSizeStrong;
  font-family: $fontFamilyHead;
  &.smaller {
    font-size: $fontSizeSmall;
    margin: 10px 0 0 0;
  }
  li {
    margin: 0;
    display: inline-block;
    &:before { content: ' → '; }
    &:first-child:before { display: none; }
  }
  a { text-decoration: none; }
}

.toolbar {
  width: 100%;
  display: table;
  border-spacing: 0;
  border-collapse: collapse;
  &_group {
    display: table-cell;
    white-space: nowrap;
    padding-left: $gapSize;
    vertical-align: middle;
    &:first-child { padding-left: 0; }
    &.wrap-text {
      line-height: 1.1;
      white-space: normal;
    }
  }
  &.vtop > &_group { vertical-align: top; }
  table.form + & { margin: $gapSize 0 0 0; }
}

.flex-toolbar {
  display: flex;
  align-items: center;

  &.vtop {
    align-items: flex-start;
  }

  &_group {
    display: flex;
    line-height: 1.1;
    align-items: center;

    &:not(:first-child) {
      margin-left: $gapSize;
    }

    & > *:not(:first-child) {
      margin-left: 0.5rem;
    }

    &.page-navigator {
      margin-left: auto;
    }

    &.push-left {
      margin-right: auto;
    }

    &.push-right {
      margin-left: auto;
    }

    &.push-top {
      margin-bottom: auto;
    }

    &.push-bottom {
      margin-top: auto;
    }
  }

  table.form + & {
    margin: $gapSize 0 0 0;
  }
}

.instack {
  margin: 0;
  list-style: none;
  display: inline-block;
  > * {
    margin-left: 0.6em;
    padding-left: 0.6em;
    display: inline-block;
    border-left: 1px solid rgba(#000, 0.15);
    &:first-child {
      border: 0;
      margin: 0;
      padding: 0;
    }
  }
}

.label {
  color: #FFF;
  padding: 0 0.5em;
  line-height: 1.75;
  border-radius: 3px;
  white-space: nowrap;
  display: inline-block;
  text-decoration: none;
  background: rgba(#210, 0.3);
}
a.label:hover {
  color: #FFF;
  background: rgba(#210, 0.5);
}

.legend {
  margin: 1em 0;
  display: block;
  line-height: 1.2;
  overflow: hidden;
  position: relative;
  text-align: center;
  white-space: nowrap;
  &:before, &:after {
    width: 50%;
    height: 1px;
    content: '';
    position: relative;
    display: inline-block;
    vertical-align: middle;
    background: $borderColor;
  }
  &:before {
    left: -0.5em;
    margin: 0 0 0 -50%;
  }
  &:after {
    left: 0.5em;
    margin: 0 -50% 0 0;
  }
  &-left {
    text-align: left;
    &:before { display: none; }
    &:after { width: 100%; }
  }
  .button, button {
    padding: 0 1em;
    margin: 0 -0.5em;
  }
}

.headline {
  width: 100%;
  display: table;
  white-space: nowrap;
  margin-bottom: $gapSize;

  &.fullscreen {
    .headline_aside {
      position: fixed;
      top: 20px;
      z-index: 10000;
      left: 50%;
      transform: translateX(-50%);
    }
  }

  > * {
    padding: 0 $gapSize;
    display: table-cell;
    vertical-align: middle;
    &:first-child { padding-left: 0; }
    &:last-child { padding-right: 0; }
  }
  &_title {
    margin: 0;
    padding: 0;
    width: 100%;
    white-space: normal;
  }
}

.cover {
  display: table;
  &_image {
    display: table-cell;
    vertical-align: top;
  }
  &_caption {
    width: 100%;
    display: table-cell;
    vertical-align: middle;
  }
}

.logo {
  width: 134px;
  height: 50px;
  vertical-align: top;
  display: inline-block;
  text-decoration: none;
  svg {
    width: 100%;
    height: 100%;
    display: block;
  }
}

.icon {
  width: 1em;
  height: 1em;
  font-size: $iconSize;
  vertical-align: -12%;
  display: inline-block;
  text-decoration: none;
  &:first-child { margin-right: $iconMargin; }
  &:last-child { margin-left: $iconMargin; }
  &:only-child { margin: 0; }
  &-big {
    vertical-align: -16%;
    font-size: $iconSize * 1.5;
  }
}
button, .button, .dropdown dd a {
  .icon { vertical-align: -8%; }
}

.review-breadcrumbs{
  padding: 0;
  width: 100%;
  vertical-align: top;
  display: inline-block;
  margin: 0 0 $gapSize * 1.5 0;
}

.tabs {
  $textColor: #322;
  $borderColor: rgba(#000, 0.15);

  padding: 0;
  width: 100%;
  vertical-align: top;
  display: inline-block;
  margin: 0 0 $gapSize * 1.5 0;
  font-family: $fontFamilyHead;
  border-bottom: 1px solid $borderColor;
  a {
    float: left;
    padding: 0 0.8em;
    line-height: 2.4em;
    margin-bottom: -1px;
    text-decoration: none;
    font-size: $fontSizeBig;
    border-radius: 3px 3px 0 0;
    color: rgba($textColor, 0.65);
    border: 1px solid transparent;
    border-width: 1px 1px 0 1px;
    &:hover { color: $textColor; }
    &.active {
      cursor: default;
      color: $textColor;
      border-color: $borderColor;
      background: linear-gradient(to bottom, mix(#FFF, $bodyBg, 50), $bodyBg);
    }
  }
}

.flash {
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  position: fixed;
  text-align: center;
  height: $headerHeight;
  line-height: $headerHeight;
  box-shadow: 0 1px 0 rgba(#000, 0.1);
  &-notice {
    color: $fgGreen;
    background: rgba($bgGreen, 0.9);
  }
  &-info {
    color: $fgBlue;
    background: rgba($bgBlue, 0.9);
  }
  &-alert {
    color: $fgOrange;
    background: rgba($bgOrange, 0.9);
  }
  &-error {
    color: $fgRed;
    background: rgba($bgRed, 0.9);
  }
  &_message {
    display: inline-block;
    line-height: $lineHeight;
  }
  &_close {
    top: 50%;
    right: 18px;
    width: 32px;
    height: 32px;
    font-size: 32px;
    cursor: pointer;
    line-height: 36px;
    margin-top: -16px;
    text-align: center;
    position: absolute;
    text-decoration: none;
    color: rgba(#000, 0.4);
    &:hover { color: #000; }
  }
}

.validation {
  margin: 1em 0;
  padding-left: 1em;
  color: $inputInvalidColor;
  border-left: 3px solid currentColor;
  &.success {
    color: $fgGreen;
  }
  &_title {
    color: inherit;
    margin: 0 0 0.3em 0;
    font-size: $fontSizeBig;
  }
  &_summary {
    margin: 0;
    padding: 0;
    list-style: none;
    li { margin: 0; }
  }
}

.table-responsive {
  overflow: auto;
  width: 100%;
  position: relative;
}

.datagrid {
  border: 0;
  width: 100%;
  line-height: 1.25;
  border-collapse: separate;
  border-bottom: 1px solid rgba(#000, 0.08);
  th, thead td {
    font-weight: bold;
    padding: 15px 10px;
    //white-space: nowrap;
    background: rgba(#000, 0.1);
    &.wrapped { word-wrap: break-word;}
  }

  th.fixed {
    background-color: #e1dcd3;
  }

  td.fixed {
    background-color: #faf5eb;
  }

  td.fixed,
  th.fixed {
    width: 150px;
    min-width: 150px;
    position: -webkit-sticky;
    position: sticky;
    z-index: 3;
    left: 0;
    box-shadow: 2px 0px 0px 0px rgba(0,0,0,0.1);
  }

  td {
    padding: 10px;
    word-wrap: break-word;
    word-break: break-word;
    border-top: 1px solid rgba(#000, 0.08);
    //max-width: 50px;
    //overflow: hidden;
    //text-overflow: ellipsis;
    &.nowrap {
      //max-width: none;
      //overflow: visible;
      word-wrap: normal;
      word-break: normal;
      //text-overflow: none;
    }
    &.overflow {
      max-width: 50px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    &.toleft { padding-left: 0; }
    &.toright { padding-right: 0; }
    &.tocenter { text-align: center; }
  }
  thead + tbody tr:first-child td { border: 0; }
  &.striped tr:nth-child(even) {
    background-clip: padding-box;
    background-color: rgba(#000, 0.03);
  }
}

.nodata {
  margin: $gapSize 0;
  padding: $gapSize * 2;
  background: rgba(#000, 0.02);
  border: 1px solid rgba(#000, 0.05);
  &_title {
    margin: 0;
    color: $fgH1;
  }
  &_text {
    margin: 0.3em 0;
    color: $bodyFgFaded;
  }
}

.litebox-embed {
  margin: $gapSize auto;
  .litebox & { margin: 0; }
}

.counter {
  padding: 0.5em;
  text-align: center;
  display: inline-block;
  box-sizing: border-box;
  font-size: $fontSizeH5;
  font-family: $fontFamilyHead;
  &:before {
    color: $fgH1;
    display: block;
    line-height: 1;
    font-size: 250%;
    font-weight: bold;
    white-space: nowrap;
    letter-spacing: -0.03em;
    font-family: $fontFamily;
  }
}

.userpic {
  width: 1em;
  height: 1em;
  font-size: 40px;
  overflow: hidden;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  background-size: 0.9em 0.9em;
  background-repeat: no-repeat;
  background-color: rgba(#200, 0.2);
  background-position: center bottom;
  @include background-svg(16, 16, '<path fill="#100" opacity="0.5" d="M12.53,11.96c-2.1-0.8-2.77-1.47-2.77-2.91c0-0.87,0.64-0.58,0.92-2.17c0.12-0.66,0.68-0.01,0.79-1.51 c0-0.6-0.31-0.75-0.31-0.75s0.16-0.89,0.22-1.57C11.46,2.19,10.91,0,8,0C5.09,0,4.54,2.19,4.62,3.04c0.06,0.68,0.22,1.57,0.22,1.57 S4.53,4.76,4.53,5.36c0.11,1.5,0.67,0.85,0.79,1.51c0.28,1.59,0.92,1.3,0.92,2.17c0,1.44-0.67,2.12-2.77,2.91 C1.37,12.76,0,13.57,0,14.13S0,16,0,16h16c0,0,0-1.31,0-1.87S14.63,12.76,12.53,11.96L12.53,11.96z"/>');
  img {
    width: 100%;
    height: 100%;
    display: block;
  }
  &.userpic-small { font-size: 30px; }
}

.progress {
  $color: #6C2;
  width: 100%;
  height: 1em;
  font-size: 10px;
  text-align: left;
  overflow: hidden;
  position: relative;
  border-radius: 0.5em;
  display: inline-block;
  background: rgba(#FFF, 0.8);
  &:after {
    top: 0;
    left: 0;
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    box-sizing: border-box;
    border-radius: inherit;
    border: 1px solid rgba(#000, 0.12);
  }
  span {
    height: 100%;
    background: $color;
    vertical-align: top;
    display: inline-block;
    &:nth-child(2) { background: #A3E07A; }
    &:nth-child(3) { background: #F0E68C; }
  }
}

.input-file {
  position: relative;
  padding-right: 80px;
  input[type=text] {
    z-index: 1;
    height: 34px;
    position: relative;
    border-right-width: 0;
  }
  button {
    top: 0;
    right: 0;
    z-index: 1;
    position: absolute;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  input[type=file] {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    opacity: 0;
    outline: none;
    position: absolute;
    &.invalid + input[type=text] {
      color: $inputInvalidColor;
      border-color: rgba($inputInvalidColor, 0.5);
    }
  }
}

.sidemenu {
  margin-top: 0;
  margin-bottom: 0;
  font-size: $fontSizeH5;
  padding: $gapSize / 2 0;
  color: rgba($bodyFgLight, 0.5);
  li {
    margin: 0.5em 0;
  }
  a {
    display: block;
    color: $bodyFgLight;
    text-decoration: none;
    font-family: $fontFamilyHead;
    &:hover {
      color: $bodyFg;
    }
  }
}

.user-label {
  width: 100%;
  color: $fgH1;
  font-size: 0;
  margin: 5px 0;
  line-height: 40px;
  position: relative;
  white-space: nowrap;
  display: inline-block;
  .username {
    line-height: 1;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    font-size: $fontSizeBig;
    padding-left: $gapSize / 2;
    small {
      display: block;
      line-height: 1.2;
      color: $bodyFgLight;
    }
  }
  .remove {
    top: 50%;
    right: 0;
    border: 0;
    width: 1em;
    height: 1em;
    display: none;
    font-size: 20px;
    box-shadow: none;
    position: absolute;
    margin-top: -0.5em;
    border-radius: 50%;
    background-color: $fgLink;
    background-position: center;
    background-repeat: no-repeat;
    @include background-svg(10, 10, '<path fill="none" stroke="#FFF" stroke-width="1.6" d="M0,0 L10,10 M10,0 L0,10"/>');
    &:hover { background-color: $fgHover; }
  }
  &:hover .remove { display: block; }
}

.user-select-form {
  margin: 1em 0;
  position: relative;
  padding-right: 59px;
  select, .select2-container--default .select2-selection--single {
    border-right-width: 0;
    border-radius: $btnBorderRadius 0 0 $btnBorderRadius;
  }
  button {
    top: 0;
    right: 0;
    z-index: 9996;
    position: absolute;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}


// ---------------------------
// PAGINATION
// ---------------------------

.pagination {
  font-size: 0;
  white-space: nowrap;
  color: $bodyFgLight;
  margin: $gapSize / 2 0;
  > * {
    line-height: 2;
    padding: 0 0.5em;
    transition: none;
    margin: 0 1px 0 0;
    font-style: normal;
    text-align: center;
    border-radius: 3px;
    display: inline-block;
    text-decoration: none;
    font-size: $fontSizeBig;
  }
  a:hover {
    background: rgba(#200, 0.1);
  }
  .current {
    color: $fgSelected;
    background: $bgSelected;
  }
  .disabled {
    display: none;
  }
  &_info {
    line-height: 2;
    text-align: right;
    color: $bodyFgFaded;
    margin: $gapSize / 2 0;
  }
}


// ---------------------------
// SPEECH BUBBLE
// ---------------------------

.user-bubble {
  width: 100%;
  padding: 0 0 0 55px;
  display: inline-block;
  box-sizing: border-box;
  margin-bottom: $gapSize / 2;
  .userpic {
    float: left;
    font-size: 40px;
    margin-left: -55px;
  }
  &_content, &_form {
    border-radius: 4px;
    position: relative;
    padding: $gapSize * 0.75;
    background-clip: padding-box;
    border: 1px solid rgba(#000, 0.06);
    background-color: mix(#FFF, $bodyBg, 35%);
    &:before, &:after {
      top: 12px;
      left: -8px;
      content: '';
      font-size: 8px;
      position: absolute;
      border: 8px solid transparent;
      border-left-width: 0;
      border-right-color: mix(#FFF, $bodyBg, 35%);
    }
    &:before {
      left: -9px;
      border-right-color: rgba(#000, 0.12);
    }
  }
  &_content {
    time {
      display: block;
      color: $bodyFgLight;
      margin-bottom: 0.3em;
      font-size: $fontSizeSmall;
    }
    p {
      margin: 0;
      line-height: 1.2;
    }
  }
  &_form {
    padding: 0;
    &:after { border-right-color: mix(#FFF, $bodyBg, 80%); }
    &_editor {
      padding: $gapSize / 4;
      border-top-left-radius: inherit;
      border-top-right-radius: inherit;
      background: mix(#FFF, $bodyBg, 80%);
      border-bottom: 1px solid rgba(#000, 0.06);
    }
    &_footer {
      line-height: 30px;
      text-align: right;
      padding: $gapSize / 2;
      font-size: $fontSizeSmall;
      a {
        color: $bodyFgLight;
        display: inline-block;
        vertical-align: middle;
        margin-right: $gapSize / 2;
        &:hover { color: $bodyFg; }
      }
    }
    &_error {
      float: left;
      color: $fgRed;
    }
    textarea {
      border: 0;
      background: none;
      box-shadow: none;
    }
  }
  &_actions {
    float: right;
    margin: -5px -5px 0 0;
    display: flex;
    align-items: center;
    gap: 2px;
    a, button {
      margin-left: 8px;
      vertical-align: top;
      display: inline-block;
      color: rgba($bodyFg, 0.3);
      &:hover { color: rgba($bodyFg, 0.6); }

      padding: 0;
      border: none;
      background: none;
      box-shadow: none;
    }
  }
}

.comment-bubble {
  display: flow-root;
  width: 70%;
}

// ---------------------------
// VERSION COMPARE
// ---------------------------

.diff-help {
  color: $bodyFgLight;
  padding-bottom: $gapSize;
  margin: -$gapSize / 2 0 $gapSize / 2 0;
  border-bottom: 1px solid rgba(#000, 0.1);
  ins {
    color: $bodyFg;
    background: #CEC;
    text-decoration: none;
  }
  del {
    color: $bodyFg;
    background: #FCC;
  }
  span {
    color: $bodyFg;
    background: #FFF;
  }
}

.diff-versions {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  .diff-title {
    padding: 10px 0;
    line-height: 30px;
    color: $bodyFgFaded;
    height: 35px;

    form {
      position: relative;
      padding-left: 115px;
      label {
        left: 0;
        top: 50%;
        line-height: 1;
        margin-top: -0.5em;
        position: absolute;
      }

      select {
        max-width: 250px;
      }
    }
  }
  td {
    vertical-align: top;
    border-style: solid;
    border-color: rgba(#000, 0.06);
  }
}

.diff-list {
  height: 100%;
  width: 15%;
  border-width: 0 1px 0 0;
  .scroll-container {
    //max-height: 100%;
    overflow-y: auto;
    padding-right: $gapSize / 2;
  }
  a {
    display: flex;
    overflow: hidden;
    line-height: 2.4;
    color: $bodyFgLight;
    white-space: nowrap;
    text-decoration: none;
    text-overflow: ellipsis;
    padding: 0 $gapSize / 2;
    &:hover { color: $bodyFg; }
    &.selected {
      color: $bodyFg;
      background-color: rgba(#000, 0.06);
    }
    time {
      width: 8em;
      display: inline-block;
    }
  }
  .image-wrap {
    margin: 0px 10px;
  }
}

.diff-layout {
  display: flex;
  justify-content: center;
  background: transparent;
  width: fit-content;
  padding: 5px;
  margin-left: auto;
  column-gap: 10px;

  div {
    display: flex;

    &.divider {
      width: 1px;
      height: 30px;
      background-color: #d5d0c8;
    }
  }

  span {
    // code & document icons
    &.view-code,
    &.view-document {
      svg {
        height: 25px;
        fill: mix($btnColor, #FFF, 30%);
      }
      &.active {
        svg {
          fill: white;
        }
      }
    }

    background-color: $btnBackground;
    width: 2em;
    height: 2em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    column-gap: 5px;
    row-gap: 5px;

    &::after,
    &::before {
      content: '';
      display: block;
      border-radius: 2px;
      background-color: mix($btnColor, #FFF, 30%);
    }

    &.active::after,
    &.active::before {
      content: '';
      display: block;
      border-radius: 2px;
      background-color: $btnBackground;
    }

    &.diff-vertical {
      &::after,
      &:before {
        width: 4px;
        height: 1.2em;
      }
    }

    &.diff-horizontal {
      flex-direction: column;
      &::before,
      &::after {
        height: 4px;
        width: 1.2em;
      }
    }

    &.active {
      background-color: $btnColor;
    }
  }
}

.diff-version {
  width: 50%;
  padding-left: $gapSize;
  // border-width: 1px 0;
  border: none !important;
  background-clip: padding-box;
  // background-color: mix($bodyBg, #FFF, 30%);

  .versions-wrapper {
    display: flex;
    column-gap: $gapSize;
    row-gap: $gapSize;

    &.horizantal {
      flex-direction: column;
    }

    .version-col {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;

      .version-content {
        padding: 20px;
        flex: 1;
        background-color: mix($bodyBg, #FFF, 30%);

        div.source-code {
          display: none;
        }

        table {
          th {
            border: solid 1px #eeddbb;
            opacity: 0.6;
            font-weight: bold;
            max-width: 150px;
            background-color: #eeddbb;
          }

          td {
            border-color: #eeddbb;
            height: 40px;
            vertical-align: middle;
          }
        }
      }

      &.right {
        .version-content {
          background-color: mix($bodyBg, #000, 96%);
        }
      }
    }
  }

  &:last-child {
    // border-right-width: 1px;
    // background-color: mix($bodyBg, #000, 96%);
  }
  p {
    margin: $lineHeight+em 0 0 0;
    &:first-child { margin-top: 0; }
  }
  .original { display: none; }
  ins {
    background: #CEC;
    text-decoration: none;
  }
  del { background: #FCC; }
  span { background: #FFF; }
  [data-empty]:empty:before {
    opacity: 0.5;
    content: attr(data-empty);
  }
}


.notice {
  display: flex;
  padding: 2rem;
  margin: 1.5em 0;
  border-radius: 5px;
  align-items: center;
  background: rgba(#000, 0.1);
  justify-content: space-between;

  &_content {
    color: $bodyFgLight;
  }

  &_aside {
    margin-left: 2rem;
  }
}


.tagcloud {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 5rem 0;
  line-height: 2.5em;
  align-items: center;
  justify-content: center;

  li {
    --size: 9;
    margin: 0;
    font-family: $fontFamilyHead;
    font-size: calc(var(--size) * 0.125em + 0.875em);
    opacity: calc((20 - (9 - var(--size))) / 20);

    &[data-weight="0"] { --size: 0; }
    &[data-weight="1"] { --size: 1; }
    &[data-weight="2"] { --size: 2; }
    &[data-weight="3"] { --size: 3; }
    &[data-weight="4"] { --size: 4; }
    &[data-weight="5"] { --size: 5; }
    &[data-weight="6"] { --size: 6; }
    &[data-weight="7"] { --size: 7; }
    &[data-weight="8"] { --size: 8; }
    &[data-weight="9"] { --size: 9; }
  }

  a {
    display: block;
    padding: 0 0.75rem;
    text-decoration: none;

    &:hover {
      color: $fgHover;
    }
  }
}
