/* research-institute */
        /* Give the heading the dark theme text colour explicitly. */
        #unit-banner .heading-row,
        #unit-banner .heading-row h1 {
          color: var(--bs-body-color);
        }
        /* Heading weight slightly lighter than the design system default. */
        #unit-banner .heading-row h1 {
          font-weight: 600;
        }

        /* Banner image shows in full, cropped from the centre below 12rem. */
        #unit-banner .banner-image img {
          height: auto;
          min-height: 12rem;
        }

/* research-institute */
/* posts-v6: spacing and dividers between second-column items. */

        #block-posts6 .col-second .col-item {
          padding-block: 1rem;
        }
        #block-posts6 .col-second .col-item:first-child {
          padding-top: 0;
        }
        #block-posts6 .col-second .col-item:last-child {
          padding-bottom: 0;
        }
        #block-posts6 .col-second .col-item:not(:last-child) {
          border-bottom: var(--bs-border-width) solid var(--bs-border-color);
        }

/* research-institute */
/* Background: two-stop blue gradient. */

        #block-links {
          background-image: linear-gradient(180deg, #2f7cb8 0%, rgb(var(--pro-brand-deep-rgb)) 100%);
        }

        /* Hover: darken the image and turn the title gold. */
        #block-links .card-item .item-image img {
          transition: filter .4s ease-in-out;
        }
        #block-links .card-item:hover .item-image img {
          filter: brightness(.6);
        }
        #block-links .card-item:hover .item-title,
        #block-links .card-item:hover .item-title > a {
          /* Colour the h4 too, so the line-clamp ellipsis matches. */
          color: var(--bs-gold) !important;
        }

        /* From xl, six posts in one row with a 3/12 title column. */
        /* At 130% zoom, the title column takes 3/12 of the row. */
        @media (min-width: 1200px) {
          html.a11y-zoom-130 #block-links .col-first { width: 25%; }
          html.a11y-zoom-130 #block-links .col-second { width: 75%; }
        }

/* tsagiin-huwair */
/* Office widgets in a masonry layout of columns. */
#sched-offices {
  column-count: 1;
  column-gap: 1rem;
}
@media (min-width: 768px) {
  #sched-offices { column-count: 2; }
}
@media (min-width: 1200px) {
  #sched-offices { column-count: 3; }
}
@media (min-width: 1400px) {
  #sched-offices { column-count: 4; }
}
#sched-offices > .sched-office-col {
  break-inside: avoid;
  margin-bottom: 1rem;
}

/* uepg-structure */
/* Stage: the chart scales to fit; hovering shows a magnifier lens. */
        #block-uepg-org .otree-stage {
          position: relative;
          overflow: hidden;
          border-radius: 1rem;
          cursor: crosshair;
          touch-action: none;   /* a finger drags the lens instead of scrolling the page */
        }
        #block-uepg-org .otree-lens {
          position: absolute;
          left: 0;
          top: 0;
          z-index: 2;
          width: 16rem;
          height: 16rem;
          overflow: hidden;
          border: .25rem solid var(--bs-white);
          border-radius: 50%;
          background-color: var(--bs-body-bg);
          box-shadow: var(--bs-box-shadow-lg);
          pointer-events: none;
          opacity: 0;
          transition: opacity .2s ease-in-out;
        }
        #block-uepg-org .otree-lens > .otree-tree {
          position: absolute;
          left: 0;
          top: 0;
          transform-origin: 0 0;
        }
        #block-uepg-org .otree-fit { transform-origin: top left; width: max-content; }
        #block-uepg-org .otree-hint {
          position: absolute;
          right: .75rem;
          top: .75rem;
          pointer-events: none;
          transition: opacity .2s ease-in-out;
        }
        #block-uepg-org .otree-tree {
          --v: 1.25rem;            /* Vertical gap between parent and child (connector height). */
          --h: .1875rem;           /* Gap between columns. */
          --leaf: 5rem;            /* Leaf column width. */
          --line: rgba(var(--bs-primary-rgb), .45);
          width: max-content;
          padding: .25rem;
        }
        #block-uepg-org .otree-tree ul {
          display: flex;
          justify-content: center;
          position: relative;
          margin: 0;
          padding: var(--v) 0 0;
          list-style: none;
        }
        #block-uepg-org .otree-tree > ul { padding-top: 0; }
        #block-uepg-org .otree-tree li {
          display: flex;
          flex-direction: column;
          align-items: center;
          flex-shrink: 0;
          position: relative;
          min-width: var(--leaf);
          padding: var(--v) var(--h) 0;
        }
        #block-uepg-org .otree-tree > ul > li { padding-top: 0; }
        /* Leaf columns keep the --leaf width so their text wraps inside. */
        #block-uepg-org .otree-tree li:not(:has(ul)) { width: min-content; }
        #block-uepg-org .otree-card { min-width: min-content; }
        /* Connector from the row above: sibling line plus a short vertical tick. */
        #block-uepg-org .otree-tree li::before,
        #block-uepg-org .otree-tree li::after {
          content: "";
          position: absolute;
          top: 0;
          right: 50%;
          width: 50%;
          height: var(--v);
          border-top: 2px solid var(--line);
        }
        #block-uepg-org .otree-tree li::after {
          right: auto;
          left: 50%;
          border-left: 2px solid var(--line);
        }
        #block-uepg-org .otree-tree li:first-child::before { border-top: 0; }
        #block-uepg-org .otree-tree li:last-child::after { border-left: 0; border-top: 0; }
        #block-uepg-org .otree-tree li:last-child::before { border-right: 2px solid var(--line); border-top-right-radius: .375rem; }
        #block-uepg-org .otree-tree li:first-child::after { border-top-left-radius: .375rem; }
        #block-uepg-org .otree-tree li:only-child::before { display: none; }
        #block-uepg-org .otree-tree li:only-child::after { border-top: 0; border-radius: 0; }
        #block-uepg-org .otree-tree > ul > li::before,
        #block-uepg-org .otree-tree > ul > li::after { display: none; }
        /* Vertical line from a parent card down to its children. */
        #block-uepg-org .otree-tree ul ul::before {
          content: "";
          position: absolute;
          top: 0;
          left: 50%;
          height: var(--v);
          border-left: 2px solid var(--line);
        }

        /* Card */
        #block-uepg-org .otree-card {
          width: 100%;
          margin: 0;
          padding: .375rem .375rem;
          border: 1px solid rgba(var(--bs-primary-rgb), .35);
          border-radius: .5rem;
          background: var(--bs-body-bg);
          color: var(--bs-body-color);
          font-size: .6875rem;
          font-weight: 500;
          line-height: 1.25;
          text-align: center;
          white-space: normal;
          box-shadow: 0 .25rem .625rem rgba(var(--bs-primary-rgb), .07);
        }
        #block-uepg-org .otree-l2 > .otree-card {
          max-width: 7.5rem;
          min-height: 3.75rem;
          display: flex;
          align-items: center;
          justify-content: center;
          padding: .5rem .375rem;
          border: 1px solid rgba(var(--bs-primary-rgb), .45);
          border-top: .1875rem solid var(--bs-primary);
          background: linear-gradient(180deg, var(--bs-body-bg) 0%, rgba(var(--bs-primary-rgb), .06) 100%);
          color: var(--bs-primary);
          font-weight: 700;
        }
        #block-uepg-org .otree-l1 > .otree-card {
          max-width: 11rem;
          min-height: 3rem;
          display: flex;
          align-items: center;
          justify-content: center;
          padding: .5rem .75rem;
          border: 1px solid rgba(var(--bs-gold-rgb), .8);
          border-top: .1875rem solid var(--bs-gold);
          background: linear-gradient(180deg, var(--bs-body-bg) 0%, rgba(var(--bs-gold-rgb), .14) 100%);
          color: var(--bs-primary);
          font-size: .75rem;
          font-weight: 700;
        }
        #block-uepg-org .otree-l4 > .otree-card {
          border-style: dashed;
          color: var(--bs-secondary-color);
          box-shadow: none;
        }
        #block-uepg-org .otree-root > .otree-card {
          width: auto;
          min-width: 22rem;
          padding: .75rem 1.5rem;
          border: 2px solid var(--bs-gold);
          border-radius: .75rem;
          background: linear-gradient(135deg, var(--bs-primary) 0%, rgb(var(--pro-brand-deep-rgb)) 100%);
          color: var(--bs-white);
          font-size: .9375rem;
          font-weight: 700;
          letter-spacing: .03em;
          text-transform: uppercase;
          box-shadow: 0 .625rem 1.5rem rgba(var(--bs-primary-rgb), .3);
        }
        /* Pass-through node: no card, a vertical line crosses the deputy row. */
        #block-uepg-org .otree-pass > .otree-gap {
          display: block;
          width: 2px;
          height: 3rem;
          background: var(--line);
        }
        #block-uepg-org .otree-pass > ul { padding-top: 0; }
        #block-uepg-org .otree-pass > ul::before { display: none; }
        #block-uepg-org .otree-pass > ul > li { padding-top: var(--v); }

        /* Council note with a dashed border. */
        #block-uepg-org .otree-note {
          max-width: 24rem;
          border: 1px dashed rgba(var(--bs-primary-rgb), .45);
        }

/* urgudul-gomdol */
/* Login card: brand panel on the left, text and button on the right. */
                  #block-sso .sso-card {
                    border: 1px solid rgba(var(--bs-primary-rgb), .15);
                    box-shadow: 0 1rem 2.5rem rgba(var(--bs-primary-rgb), .1);
                  }
                  #block-sso .sso-brand {
                    background-image: linear-gradient(160deg, var(--bs-primary) 0%, rgb(var(--pro-brand-deep-rgb)) 100%);
                  }
                  #block-sso .sso-brand .sso-icon {
                    width: 5.5rem;
                    height: 5.5rem;
                    background: rgba(255, 255, 255, .12);
                    border: 1px solid rgba(255, 255, 255, .25);
                    color: var(--bs-gold);
                    font-size: 2.5rem;
                  }
                  #block-sso .sso-brand .sso-mark {
                    letter-spacing: .12em;
                    font-size: .75rem;
                    color: rgba(255, 255, 255, .75);
                  }
                  #block-sso .sso-steps li + li { border-top: 1px solid var(--bs-border-color); }
                  #block-sso .sso-steps .sso-num {
                    width: 1.75rem;
                    height: 1.75rem;
                    font-size: .8125rem;
                    background: rgba(var(--bs-primary-rgb), .1);
                  }

/* Page blocks: the icon a card shows instead of a picture. */
.features-v1 .feature-item .item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: .75rem;
  font-size: 1.375rem;
  color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), .1);
}
