// See COPYRIGHT.md for copyright information

@import url("core.less");
@import url("fonts.less");
@import url("colours.less");
@import url("colours-dark-mode.less");
@import url("common.less");
@import url("components.less");
@import url("form-controls.less");
@import url("chart.less");
@import url("dialog.less");
@import url("menu.less");
@import url("accordian.less");
@import url("loader.less");
@import url("tabs.less");
@import (reference) "text-mixins.less";
@import url("block-list.less");
@import url("validation-report.less");
@import url("calculation-inspector.less");
@import url("text-block-viewer.less");
@import url("summary.less");

@top-bar-height: 5.5rem;

:root {
  --colour-bg-selected: @colour-bg-selected;
  --colour-bg-tag: @colour-bg-tag;
  --colour-bg: @colour-bg;
  --colour-bg-fade: @colour-bg-fade;
  --colour-border-grey: @colour-border-grey;
  --colour-button-bg: @colour-button-bg;
  --colour-button-primary-text: @colour-button-primary-text;
  --colour-button-primary-bg: @colour-button-primary-bg;
  --colour-button-primary-bg-hover: @colour-button-primary-bg-hover;
  --colour-button-primary-border: @colour-button-primary-border;
  --colour-button-secondary-text: @colour-button-secondary-text;
  --colour-button-secondary-bg: @colour-button-secondary-bg;
  --colour-button-secondary-bg-hover: @colour-button-secondary-bg-hover;
  --colour-button-secondary-border: @colour-button-secondary-border;
  --colour-calculation-icon-bg: @colour-calculation-icon-bg;
  --colour-foreground: @colour-foreground;
  --colour-highlight-1: @colour-highlight-1;
  --colour-highlight-2: @colour-highlight-2;
  --colour-highlight-3: @colour-highlight-3;
  --colour-highlight-4: @colour-highlight-4;
  --colour-highlight-5: @colour-highlight-5;
  --colour-highlight-default: @colour-highlight-default;
  --colour-inactive-bg: @colour-inactive-bg;
  --colour-active-bg: @colour-active-bg;
  --colour-table-header-bg: @colour-table-header-bg;
  --colour-icon-grey: @colour-icon-grey;
  --colour-linked-fact: @colour-linked-fact;
  --colour-loader: @colour-loader;
  --colour-primary-focus: @colour-primary-focus;
  --colour-primary: @colour-primary;
  --colour-primary-light: @colour-primary-light;
  --colour-related-fact: @colour-related-fact;
  --colour-row-odd: @colour-row-odd;
  --colour-row-hover: @colour-row-hover;
  --colour-text-form-value: @colour-text-form-value;
  --colour-text-light: @colour-text-light;
  --colour-text-title: @colour-text-title;
  --colour-text: @colour-text;
  --colour-warning: @colour-warning;
  --top-bar-height: @top-bar-height;
  --button-padding-x: 0.8rem;
  --button-padding-y: 0.8rem;

  .only-dark {
    display: none;
  }

}

:root[data-ixbrl-viewer-theme="dark"] {
  --colour-active-bg: @colour-active-bg-d;
  --colour-bg-selected: @colour-bg-selected-d;
  --colour-bg-tag: @colour-bg-tag-d;
  --colour-bg: @colour-bg-d;
  --colour-bg-fade: @colour-bg-fade-d;
  --colour-border-grey: @colour-border-grey-d;
  --colour-button-bg: @colour-button-bg-d;
  --colour-button-primary-text: @colour-button-primary-text-d;
  --colour-button-primary-bg-hover: @colour-button-primary-bg-hover-d;
  --colour-button-primary-bg: @colour-button-primary-bg-d;
  --colour-button-primary-border: @colour-button-primary-border-d;
  --colour-button-secondary-text: @colour-button-secondary-text-d;
  --colour-button-secondary-bg-hover: @colour-button-secondary-bg-hover-d;
  --colour-button-secondary-bg: @colour-button-secondary-bg-d;
  --colour-button-secondary-border: @colour-button-secondary-border-d;
  --colour-calculation-icon-bg: @colour-calculation-icon-bg-d;
  --colour-foreground: @colour-foreground-d;
  --colour-highlight-1: @colour-highlight-1-d;
  --colour-highlight-2: @colour-highlight-2-d;
  --colour-highlight-default: @colour-highlight-default-d;
  --colour-icon-grey: @colour-icon-grey-d;
  --colour-inactive-bg: @colour-inactive-bg-d;
  --colour-linked-fact: @colour-linked-fact-d;
  --colour-loader: @colour-loader-d;
  --colour-primary-focus: @colour-primary-focus-d;
  --colour-primary: @colour-primary-d;
  --colour-related-fact: @colour-related-fact-d;
  --colour-row-odd: @colour-row-odd-d;
  --colour-row-hover: @colour-row-hover-d;
  --colour-table-header-bg: @colour-table-header-bg-d;
  --colour-text-form-value: @colour-text-form-value-d;
  --colour-text-light: @colour-text-light-d;
  --colour-text-title: @colour-text-title-d;
  --colour-text: @colour-text-d;
  --colour-warning: @colour-warning-d;
  --top-bar-height: @top-bar-height;

  .only-dark {
    display: initial;
  }

  .only-light {
    display: none;
  }
}

body,
table,
dialog,
button {
  .default-font();
  .text-md();
}

a {
  text-decoration: none;
  color: var(--colour-primary);

  &:hover {
    text-decoration: underline;
  }
}

#panes {
  display: flex;
  flex-direction: row; 
  position: fixed;
  inset: 0;

  & > * {
    height: 100%;
  }
}

#pane-left {
  display: flex;
  flex-direction: column;
  flex-grow: 6;
  position: relative;

  .resize {
    position: absolute;
    top: 0;
    width: 5px;
    right: -5px;
    bottom: 0;
    z-index: 20;
  }

  /* This spacer stops drag events getting lost to the iframe */
  .resize-spacer {
    position: absolute;
    top: 0;
    width: 3px;
    right: 0;
    bottom: 0;
    z-index: 20;
  }
}

#pane-right {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  width: 400px;
  border-left: solid 0.1rem var(--colour-border-grey);
}

#viewer-pane {
  z-index: 1;
  flex-grow: 1;
  display: flex;
  flex-flow: column;

  .ixds-tabs {
    display: none;
    flex: 0 1 auto;
  }

  #iframe-container {
    background-color: white;
    color: black;
    position: relative;
    flex: 1 1 auto;

    & > iframe {
      width: 100%;
      height: 100%;
      box-sizing: border-box;
      border: none;
    }
  }
}

#top-bar {
  .default-font();
  .text-md();

  position: relative;
  flex-grow: 0;
  display: flex;
  align-items: center;
  color: var(--colour-text);
  height: var(--top-bar-height);
  border-bottom: solid 0.1rem var(--colour-border-grey);
  z-index: 5;

  .logo {
    font-size: 1.8rem;
    margin-left: 1.8rem;
    color: var(--colour-text);
    flex: 1 0 0;
  }

  .home-link {
    font-size: 1.8rem;
    margin-left: 1.8rem;
    color: var(--colour-text);
    flex: 1 0 0;
  }

  .zoom-controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.8rem;

    button#zoom-in {
      &::before {
        .icon-zoom-in();

        font-size: 1.8rem;
      }
    }

    button#zoom-out {
      &::before {
        .icon-zoom-out();

        font-size: 1.8rem;
      }
    }

    & > button {
      .icon-button();
    }
  }

  .top-bar-controls {
    display: flex;
    align-items: center;
    line-height: var(--top-bar-height);
    height: var(--top-bar-height);
    background: var(--colour-bg);
    gap: 0.8rem;
    margin-right: 1.4rem;
    justify-content: right;
    flex: 1 0 0;

    & > button {
      .icon-button();
    }

    .validation-warning {
      font-size: 1.6rem;
      display: none;

      &::before {
        .icon-warning();
      }
    }

    #print {
      &::after {
        .icon-print();

        font-size: 1.8rem;
      }
    }

    #highlight-tags {
      &::after {
        .icon-tag();

        font-size: 2rem;
      }

      &.checked {
        background-color: var(--colour-highlight-default);
      }
    }

    #highlight-untagged-numbers {
      &::after {
        .icon-numbers();

        font-size: 2rem;
      }

      &.checked {
        background-color: var(--colour-highlight-1);
      }
    }

    #highlight-untagged-dates {
      &::after {
        .icon-calendar();

        font-size: 2rem;
      }

      &.checked {
        background-color: var(--colour-highlight-2);
      }
    }

    #settings-button::before {
      .icon-cog();

      font-size: 2rem;
    }
  }
}

#inspector-tabs {
  display: flex;
  flex-direction: row;
  height: var(--top-bar-height);
  flex: 0 0 auto;
  border-bottom: solid 0.1rem var(--colour-border-grey);

  .show-filters &,
  .settings-mode & {
    display: none;
  }

  button {
    flex: 1 0 auto;
    border: none;
    height: 100%;
    border-radius: 0;
    outline-offset: -0.2rem;
    color: var(--colour-text-light);
    margin: 0 2rem;
    border-bottom: solid 0.2rem rgb(0 0 0 / 0%);

    &.selected {
      border-bottom: solid 0.2rem var(--colour-primary);
      color: var(--colour-text);
    }

    &.always-selectable, 
    &:not(.selected) {
      cursor: pointer;

      &:hover {
        background-color: var(--colour-row-hover);
        color: var(--colour-text);
      }
    }

  }
}

#inspector {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;

  h1,
  h2,
  h3 {
    font-weight: normal;
    width: 100%;
    box-sizing: border-box;
    color: var(--colour-text-title);
  }

  h2 {
    text-align: left;
    font-size: 1.6rem;
    font-weight: bold;
    line-height: 2.6rem;
  }

  h3 {
    .text-md();

    margin-top: 2.2rem;
    margin-bottom: 2.2rem;
    font-weight: bold;
  }

  h4 {
    font-weight: bold;
    color: var(--colour-text-title);
    margin-bottom: 1.4em;
  }

  .inspector-container {
    flex: 1 1 0;
    overflow: hidden;
    display: none;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;


    h2.inspector-title {
      .section();

      line-height: var(--top-bar-height);
      margin-block: 0;
    }

    .tag-nav {
      margin-top: 1.8rem;
      margin-bottom: 1.8rem;

      &.tag-nav-duplicates {
        margin-top: 0;
      }

      & > div {
        .bordered-section();

        padding: 0.2rem;
        display: flex;
        flex-direction: row;
        align-items: center;

        div:first-child {
            flex: 1 0 auto;
        }

        div:last-child {
            flex: 1 0 auto;
            text-align: right;
        }

        button {
          border: none;
          cursor: pointer;
          padding-top: 1.4rem;
          padding-bottom: 1.4rem;

          &:hover {
            background-color: var(--colour-row-hover);
            transition: all 0.25s ease;
          }

          &.prev-tag {
            padding-right: 2rem;
          
            &::before {
              .icon-chevron-left();

              font-size: 2rem;
              vertical-align: bottom;
              padding-right: 0.4rem;
            }
          }

          &.next-tag {
            padding-left: 2rem;
          
            &::after {
              .icon-chevron-right();

              font-size: 2rem;
              vertical-align: bottom;
              padding-left: 0.4rem;
            }
          }
        }
      }
    }

    .modal-inspector {
      display: flex;
      flex-direction: column;
      height: 100%;

      .modal-inspector-header {
        display: flex;
        flex: 0 0 auto;

        .close {
          border: none;
          padding: 0;
          position: absolute;
          right: 1.8rem;
          font-size: 3rem;
          z-index: 20;
          cursor: pointer;
          top: -0.4rem;
          line-height: var(--top-bar-height);
          color: var(--colour-text);

          &::before {
            content: "\00d7";
          }
        }
      }

      .modal-inspector-body {
        overflow-y: auto;
        flex: 1 1 auto;
      }
    }

    &.search-inspector {
      .search-controls {
        .show-filters & {
          display: none;
        }

        & > * {
          display: block;
          width: 100%;
          margin-top: 1.2rem;
          margin-bottom: 1.2rem;
        }

        .search-input-group {
          position: relative;

          &::before {
            .icon-search();

            position: absolute;
            line-height: 4rem;
            font-size: 1.6rem;
            left: 1.4rem;
            color: var(--colour-tex-light);
          }
           
          input {
            width: 100%;
            padding-left: 4.0rem;

            ::placeholder {
              font-size: 1.2rem;
              color: var(--colour-text-light);
            }
          }
        }
        
        button.filter-toggle {
          .secondary-button();

          &::before {
            .icon-filter();

            padding-right: 0.8rem;
            vertical-align: bottom;
          }
        }

        &.active-filters button.filter-toggle {
          .primary-button();
        }

        .filter-info {
            color: var(--colour-text-light);
            text-align: center;
        }
      }


      .search-filters {
        display: none;

        .show-filters & {
          display: flex;
        }

        .search-filter-buttons {
          .panel-indent();

          display: flex;
          flex-direction: row;
          flex: 0 0 auto;
          gap: 1.4rem;
          padding-top: 1.4rem;
          padding-bottom: 1.4rem;
          border-top: solid 1px var(--colour-border-grey);

          & > button {
            flex: 1 1 auto;
          }

          button.search-apply-filters {
            .primary-button();
          }
        }


        h2 {
          text-align: left;
          font-weight: bold;
          font-size: 1.6rem;
          line-height: var(--top-bar-height);
          margin: 0;
        }



        h3 {
          border: none;
          font-weight: bold;
          padding-bottom: 0;

          button {
            font-weight: inherit;
          }
        }

        .filter-group {
          .panel-indent();

          margin-top: 0.8em;
          margin-bottom: 0.8em;
          border-bottom: solid 1px var(--colour-border-grey);

          h3 {
            margin-top: 1.8rem;
            margin-bottom: 1.8rem;
          }

          .checkbox-row {
            margin-top: 0.8rem;
            margin-bottom: 0.8rem;

            & > :first-child {
              margin-left: 0;
            }

            &:last-of-type {
              margin-bottom: 1.8rem;
            }
          }

          input,
          select,
          textarea {
            flex-basis: 12em;
            flex-grow: 2;
          }
        }

        select {
          width: 100%;
        }

      }

      .search-results {
        overflow-y: auto;
        height: 100%;
        .panel-indent();

        .show-filters & {
          display: none;
        }

        .search-overlay {
          transform: translate(-50%, -50%);
          position: absolute;
          top: 50%;
          left: 50%;
          color: var(--colour-text-light);
          width: 85%;

          .search-overlay-icon {
            text-align: center;
            font-size: 10rem;
            line-height: normal;

            &::before {
              .icon-search();
            }
          }

          .search-overlay-text {
            text-align: center;
            font-size: medium;
            line-height: normal;

            .title {
              font-size: x-large;
              line-height: normal;
            }
          }
        }


        .more-results {
          .clickable();

          padding: 1rem;
          text-align: center;
        }
      } /* search results */
    } /* search inspector */

    .inspector-body {
      width: 100%;
      position: relative;
      overflow-y: auto;
      flex-grow: 1;

      h2.concept-name-title {
        .panel-indent();
      }

      .no-fact-overlay {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 80%;
        text-align: center;
        color: var(--colour-text-light);

        .no-fact-overlay-icon::before {
          .icon-tag();

          font-size: 10rem;
          line-height: normal;
        }

        .title {
          font-size: x-large;
          line-height: normal;
        }
      }

      .inspector-body {
        overflow-y: auto;
        height: 100%;
        position: relative;
      }

      .summary {
        overflow-y: auto;
        height: 100%;
      }

    } /* inspector body */
  } /* inspector container */

  .nested-item-select {
    .section();

    .description {
      text-align: left;
      color: var(--colour-text-light);
      margin-top: 1.8rem;
      margin-bottom: 0.8rem;
    }

    & > select {
      width: 100%;
      margin-bottom: 1.8rem;
    }
  }

  .std-label {
    margin-left: 30px;
    min-height: 20px;
    position: relative;

    &::before {
      color: var(--colour-primary);
      content: "\2022";
      position: absolute;
      left: -20px;
      font-size: x-large;
    }
  }

  dt {
    font-weight: bold;
    color: var(--colour-text-title);
    margin-bottom: 1.4rem;
    margin-top: 1.4rem;
  }

  dd {
    margin-inline-start: 0;
  }

  #concept {
    margin-top: 20px;
    font-size: small;
    min-height: 25px;
  }

  #dimensions {
    margin-left: 2rem;
    margin-right: 2rem;
    margin-bottom: 1rem;

    .dimension {
      position: relative;
      margin: 1.5rem 0 1.5rem 1rem;

      &::before {
        .icon-dimension();

        color: var(--colour-primary);
        position: absolute;
        top: 0;
        left: -2.3rem;
        font-size: 120%;
      }
    }

    .dimension-value {
      position: relative;
      margin: 1.5rem 0 1.5rem 3.5rem;

      &::before {
        .icon-dimension-member();

        position: absolute;
        color: var(--colour-primary);
        top: 0;
        left: -2.3rem;
        font-size: 120%;
      }
    }
  }


  .analyse {
    margin-left: 0.4rem;
  }

  .analyse::before {
    .icon-graph();

    position: relative;
    top: 1px;
  }

  .inspector-body .tags {
    position: absolute;
    top: 1.5rem;
    right: 0.9rem;
  }

  .target-document-tag {
    .tag();
  }

  .hidden-fact-tag,
  .html-hidden-fact-tag {
    .tag();

    &.html-hidden-fact-tag {
      background-color: #c63018;
    }
  }

  .concept td > div {
    display: flex;
    align-items: center;

    span.text {
      white-space: nowrap;
      position: relative;
      flex-shrink: 1;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    span.filler {
      width: 0.7rem;
      display: inline-block;
      flex-shrink: 1000;
    }

    span.copy-icon {
      flex-shrink: 0;
    }
  }

  .collapsible-section {
    .collapsible-body {
      .panel-indent();

      & > * {
        margin-bottom: 1.2rem;
      }

      & > table.property-table:first-child,
      & > .plain-list {
        margin-top: -0.9rem;
      }
    }

    .collapsible-header {
      .panel-indent();

      position: relative;
      cursor: pointer;
      user-select: none;
      margin-top: 1.4rem;
      margin-bottom: 1.4rem;

      button:first-of-type {
          .text-md();

          font-weight: bold;
          border: none;
          color: var(--colour-text-title);
          text-align: left;
          position: relative;
          margin: 0 calc(-1 * var(--button-padding-x));
          width: calc(100% + 2 * var(--button-padding-x));
          padding: var(--button-padding-y) var(--button-padding-x);
          cursor: pointer;
          transition: all 0.25s ease;

          &::before {
            .icon-chevron-up();

            font-size: 1.8rem;
            position: absolute;
            top: var(--button-padding-y);
            right: var(--button-padding-x);
            transform: rotate(0deg);
            transition: all 0.25s ease;
            display: inline-block;
          }

          &:hover {
            background-color: var(--colour-row-hover);
            transition: all 0.25s ease;
          }
      }
    }

    &.collapsed {
      .collapsible-header button::before {
        transform: rotate(180deg);
      }
    }

    .footnote-details {
      display: none;
    }

    .calculations {
      .calculation-row {
        display: flex;
        flex-direction: row;
        padding-right: 0.8rem;
        margin-top: 0;
        margin-bottom: 0;

        .icon-box {
          width: 5.2rem;
          flex: 0 0 auto;
          position: relative;

          .icon-bar {
            position: absolute;
            left: 2.9rem;
            top: 0;
            bottom: 0;
            border-left: solid 2px var(--colour-calculation-icon-bg);
          }
          
          .icon {
            position: absolute;
            top: 0.3rem;
            left: 1.7rem;
            width: 2.4rem;
            height: 2.4rem;
            font-size: 2rem;
            text-align: center;
            border-radius: 1.2rem;
            background-color: var(--colour-calculation-icon-bg);

            &.plus::before {
              content: "+";
            }

            &.minus::before {
              position: relative;
              top: 0.1rem;
              content: "–";
            }

            &.equals::before {
              content: "=";
            }
          }
        }

        &:first-of-type {
          margin-top: 1.2rem;

          .icon-box .icon-bar {
              top: 1.5rem;
          }

        }

        &:last-of-type {
          margin-bottom: 1.2rem;

          .icon-box .icon-bar {
            bottom: 1.5rem;
          }
        }

        .calculation-details {
          flex: 1 1 auto;
          margin-bottom: 1rem;
          padding-left: 0.6rem;

          & > div {
            line-height: 3rem;

            &.not-reported {
              font-style: italic;
              color: var(--colour-text-light);
            }
          }


          &.linked-highlight,
          &.calc-fact-link:hover {
            .linked-highlight-text();
          }
        }
      }

      .property-table {
        th {
          padding-left: 1.7rem;
        }
      }
    }

    border-bottom: solid 1px var(--colour-border-grey);
  }

  .section {
    .panel-indent();

    border-bottom: solid 1px var(--colour-border-grey);

    .header-with-setting {
        display: flex;
        flex-direction: row;
        width: 100%;
        align-items: center;

        h3 {
            flex: 1 0 0;
        }

        .setting {
            flex: 0 0 50%;
        }
    }
    
  }

  &:not(.no-fact-selected),
  &.show-facts-by-group {
    .no-fact-overlay {
      display: none;
    }
  }

  &.no-fact-selected,
  &.show-facts-by-group {
    .fact-selected-only {
      display: none;
    }
  }

  &:not(.show-facts-by-group) {
    .facts-by-group {
        display: none;
    }
  }

  &:not(.hidden-fact) {
    .hidden-fact-tag {
      display: none;
    }
  }

  &:not(.html-hidden-fact) {
    .html-hidden-fact-tag {
      display: none;
    }
  }



  .powered-by {
    .text-sm();

    text-align: center;
    flex-shrink: 0;
    background: var(--colour-bg);
    width: 100%;
    height: 3rem;
    margin: 0;
    box-sizing: border-box;
    border-top: solid 0.1rem var(--colour-border-grey);
    position: relative;

    img {
      box-sizing: border-box;
      height: 3rem;
      padding: 0.5rem;
    }

    .version {
      position: absolute;
      top: 0;
      right: 5px;
      font-size: small;
      line-height: 3rem;
      color: var(--colour-text-light);
    }
  }

  &:not(.footnote-mode) .footnote-mode-only {
    display: none;
  }

  &.footnote-mode .footnote-mode-off {
    display: none;
  }

  .failed-to-load-mask {
    display: none;
  }

  &.failed-to-load .failed-to-load-mask {
    display: block;
    background-color: var(--colour-bg-fade);
    position: absolute;
    width: 100%;
    height: 100%;
  }

  &.search-ready {
    .search-not-ready-only {
      display: none;
    }
  }

  &:not(.search-ready) {
    .search-ready-only {
      display: none;
    }

    .search-results {
      background-color: rgb(0 0 0 / 50%);
    }
  }

  table.property-table {
    &:not(.numeric, .numeric-full-width) {
      table-layout: fixed;
    }

    td, th {
      padding: 0.5rem 0;
      line-height: 2.6rem;
      vertical-align: top;
    }

    th {
      width: 16rem;
      text-align: left;
      box-sizing: border-box;
      padding-right: 3rem;
      font-weight: normal;
      color: var(--colour-text-light);

      &.has-tooltip {
        padding-right: 10px;
      }
    }

    &.narrow-header th {
      width: 10rem;
      padding-right: 1rem;
    }

    tr.value {
      .show-all {
        color: var(--colour-primary);
        cursor: pointer;
      }

      &:not(.truncated) .show-all {
        display: none;
      }

      &.text-block .expand-text-block {
        color: var(--colour-primary);
        cursor: pointer;

        &::before {
          .icon-text-block();
        }
      }
    }

    td:not(.contains-button) {
      overflow: clip visible;
      text-overflow: ellipsis;
      color: var(--colour-text);
    }

    tr.uri > td {
      white-space: nowrap;
    }

    &.numeric td,
    &.numeric-full-width td {
      text-align: right;
    }

    &.key {
      th {
        .sample {
          display: block;
          width: 2.4rem;
          height: 2.4rem;
          border-radius: 0.5rem;
        }

        padding: 0.6rem 1.2rem 0.6rem 0;
        width: 3.4rem;
      }
    }

    td > span.key {
      display: inline-block;
      width: 2.4rem;
      height: 2.4rem;
      border-radius: 0.5rem;
      margin-right: 0.6rem;
      position: relative;
      top: -0.2rem;
      vertical-align: middle;

    }

    tr.with-select {
      th {
        line-height: 3.6rem;
      }
    }

    width: 100%;
    border-collapse: collapse;
  }

  .bordered-section {
    h4 {
      margin: 0;
      padding: 1.2rem 1.4rem;
      border-bottom: solid 1px var(--colour-border-grey);
    }

    .content {
      padding: 0 1.4rem;

      & > * {
        margin-top: 0.7rem;
        margin-bottom: 0.7rem;
      }

      & > .bordered {
        margin-top: 1.4rem;
        margin-bottom: 1.4rem;
      }
    }

    border: solid 1px var(--colour-border-grey);
    border-radius: 0.8rem;
  }
}

#ixv {
  &.fact-mode {
    .fact-inspector {
      display: flex;
    }
  }

  &.search-mode {
    .search-inspector {
      display: flex;
    }
  }
  
  &.overview-mode {
    .overview-inspector {
      display: flex;
    }
  }

  &.settings-mode {
    .settings-inspector {
      display: flex;
    }
  }
}

.review-mode-only {
  display: none;
}

.fact-link {
  cursor: pointer;
  color: var(--colour-primary);

  &:hover {
    outline: solid 0.125em var(--colour-linked-fact);
    outline-offset: 0.0625em;
  }
}

.fact-list {
  .fact-list-item {
    .block-list-item();

    .title {
      .link-style();
    }

    .dimension {
      color: var(--colour-text);
      margin: 0.6rem 0;
    }

    .datatype {
      display: none;
    }

    .hidden {
      .tag();
    }

    &.selected {
      .dimension {
        color: var(--colour-text);
      }
    }
  }

  .show-more {
    .block-list-item();

    text-align: center;
  }
}


.dialog-mask {
  background-color: var(--colour-bg-fade);
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
}

.popup-content {
  display: none;
}

.copy-icon {
  color: var(--colour-primary);
  border-radius: 0.3rem;

  &:active {
    background-color: var(--colour-primary);
    color: var(--colour-bg);
  }

  &::before {
    .icon-clipboard();

    cursor: pointer;
  }
}

.has-tooltip {
  white-space: nowrap;
  
  & > * {
    vertical-align: middle;
  }

  .tooltip-icon {
    .inline-button();

    cursor: help;
    margin-left: -0.3rem;
    vertical-align: middle;

    &::after {
      content: "\24d8"; 
      position: relative;
      top: -0.2rem;
    }
  }
}

.collapsible-header.has-tooltip {
  button + .tooltip-icon {
    position: absolute;
    top: 0.4rem;
    right: 4rem;
  }
}

.tooltip {
  position: fixed;
  visibility: hidden;
  transition: all 0.5s ease;
  background-color: var(--colour-bg);
  z-index: 1;
  border: solid 0.1rem var(--colour-border-grey);
  border-radius: 0.4rem;
  padding: 0.8rem;
  box-shadow: rgb(0 0 0 / 30%) 0.2rem 0.2rem 0.2rem;
  font-weight: normal;
  opacity: 0;
  cursor: default;
  color: var(--colour-text);
  text-align: left;

  &.show,
  &.hover-show {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.5s ease;
  }

  &.with-glossary-link .glossary-link {
    display: block;
  }

  .glossary-link {
    margin-top: 0.8rem;
    font-size: smaller;
    display: none;
  }
}

.fact-value {
  &.fact-value-invalid {
    font-style: italic;
    color: #f00;
  }

  &.fact-value-nil {
    font-style: italic;
  }

  .measure {
    border-bottom: 1px dotted @colour-text-form-value;
    cursor: help;
  }
}

ul.plain-list {
  padding: 0;
  margin: 0;

  li {
    display: block;
    line-height: 2.6rem;
    padding: 0.8rem 0;
  }
}

.download-link {
  .link-style();

  margin-left: 2.8rem;
  position: relative;

  &::before {
    .icon-download();

    top: 0.2rem;
    position: absolute;
    left: -2.8rem;
    font-size: 1.8rem;
  }
}

.external-link {
  .link-style();

  margin-left: 2.8rem;
  position: relative;

  &::before {
    .icon-link();

    top: 0.2rem;
    position: absolute;
    left: -2.8rem;
    font-size: 1.8rem;
  }

}

.sample-0 {
  background: var(--colour-highlight-default);
}

.sample-1 {
  background: var(--colour-highlight-1);
}

.sample-2 {
  background: var(--colour-highlight-2);
}

.sample-3 {
  background: var(--colour-highlight-3);
}

.sample-4 {
  background: var(--colour-highlight-4);
}

.sample-5 {
  background: var(--colour-highlight-5);
}
