.annotation-content, .annotation-contents {
  font-family: 'Inter', sans-serif;
  font-size: 1.5em;

  & > * > .title {
    display: flex;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    background-color: #000100;
    color: white;
    border: 5px solid #000000;

    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 15px;

    .icon {
      flex: 0;
      height: 32px;
      margin-right: 5px;
    }
  }

  & > * > .content {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 300px;
    background-color: transparent;
    color: white;
    border: 5px solid #000000;

    padding: 0 15px 15px 15px;

    /* Tag defaults: `:where(&)` keeps this whole ancestor chain at zero specificity, so any
       utility class below (.text-lg, .text-sm, .text-center, ...) reliably overrides it. */
    :where(&) {
      h1, h2, h3 {
        font-size: 1.5em;
        padding: 0;
        margin: 0;
      }

      h4 {
        font-size: 1em;
        padding: 0;
        margin: 0;
      }

      p {
        font-size: 0.8em;
        line-height: 1.5em;
        padding: 0;
        margin: 0;
      }

      blockquote {
        font-size: 0.85em;
        line-height: 1.4em;
        margin: 10px 0;
        padding: 8px 12px;
        border-left: 3px solid rgba(255, 255, 255, 0.3);
      }
    }

    .separator-1 {
      height: 1px;
      background: rgba(255, 255, 255, 0.2);
      margin: 10px 0;
    }

    .separator-2 {
      height: 1px;
      background: rgba(255, 255, 255, 0.8);
      margin: 10px 0;
    }
  }

  .warning, .caution, .note {
    background-color: #000000;
    border-color: #000000;
    border-radius: 0;
    border-width: 5px;
    font-size: 0.8vw;

    & > .title {
      font-weight: bold;
      font-size: 3em;
      line-height: 1em;

      & > * {
        margin: 0;
        padding: 0;
        font-size: 1em;
      }

      .icon {
        flex: 0;
        width: auto;
        height: 1em;
        margin-right: 5px;
      }
    }

    & > .content {
      font-size: 1.2em;
    }

    .bordered-table {
      border: 2px solid black;
      border-collapse: collapse;
      width: 100%;
      background-color: #eee;
      color: black;

      :where(&) {
        th, td {
          border: 1px solid black;
          padding: 5px;
          text-align: left;
          font-size: 0.8vw;
        }
      }

      &.text-center {
        text-align: center;

        :where(&) {
          th, td {
            text-align: center;
          }
        }
      }
    }

    .separator-1 {
      height: 1px;
      background: rgba(255, 255, 255, 0.2);
      margin: 10px 0;
    }

    .separator-2 {
      height: 1px;
      background: rgba(255, 255, 255, 0.8);
      margin: 10px 0;
    }
  }

  /* Utilities usable anywhere inside annotation popup content. Plain classes, so they always
     outrank the :where()-wrapped tag defaults above regardless of nesting depth. */
  .text-lg {
    font-size: 1em;
    line-height: 1.5em;
  }

  .text-sm {
    font-size: 0.7em;
    line-height: 1.5em;
  }

  .text-center {
    text-align: center;
  }

  .cell-label {
    font-weight: bold;
    text-align: center;
  }

  .col-50 {
    width: 50%;
  }

  .align-top {
    vertical-align: top;
  }

  .reference {
    color: var(--kia-ev6-color-danger);
  }
}

/*
 * Shared OverlayPopup content helpers, used inside `.popup-content` across every
 * annotation-video-player layout (default / PRPO / kia-ev6). Single source instead of the
 * identical `:global(...)` blocks that used to be duplicated in each layout's OverlayPopup.svelte.
 */
.popup-content > div {
  flex: 1 1 auto;
  width: auto;
  position: relative;
}

.popup-content .link-url {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  text-align: center;
  font-size: 25px;
  font-weight: bold;
  color: black;
  background-color: #eee;
}

.popup-content .fit-container {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: auto;
  vertical-align: bottom;
  object-fit: contain;
}

.popup-content .info {
  white-space: break-spaces;
  padding: 20px 5px;
}

.popup-content .zoomable {
  width: 100%;
  height: auto;
  vertical-align: bottom;
  object-fit: contain;
  transform-origin: 0 0;
}

.popup-content .note {
  display: block;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
}

.popup-content iframe {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/*
 * Tab view (image/video switcher) for named-part popups.
 * This markup does NOT sit inside .annotation-content/.annotation-contents — these files are a bare
 * `<div class="tabview-container">` fragment. `nav.tab-nav`/`button.tab-button` are synthesized at
 * runtime by OverlayPopup.svelte's generateTabNav() from the `.tab`/`.tabview-container` structure
 * that originates in the annotation HTML, so they live here rather than as component :global CSS.
 */
.tabview-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;

  nav.tab-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid #ccc;
    background-color: #f9f9f9;

    button.tab-button {
      flex: 1 1 auto;
      padding: 8px 12px;
      border: none;
      background: none;
      cursor: pointer;
      font-size: 14px;

      &.active {
        border-bottom: 2px solid #333;
        font-weight: bold;
      }

      &:hover {
        background-color: #eee;
      }

      img {
        width: 16px;
        height: 16px;
      }
    }
  }

  .tabview-contents {
    margin-top: 40px;
    width: 100%;
    height: calc(100% - 40px);
    overflow-y: auto;
  }
}
