/* 3D viewer engine - shared styles. Served from the same site as viewer.js. */
  .model-set, .kicad-set { display: none; }
  .parent-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .model-container {
    width: 100%;
    height: 80vh;
    max-height: 640px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 0px solid #ccc;
  }
  model-viewer {
    width: 100%;
    height: 100%;
    --progress-bar-color: #a93e33;
  }
  .slider {
    width: 100%;
    max-width: 640px;
    text-align: center;
    overflow: visible;
    background-color: transparent;
  }
  .slides {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    overflow: visible;
    padding-bottom: 10px;
  }
  .slide {
    cursor: pointer;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    margin: 0;
    border-radius: 10px;
    border: 2px solid #a93e33;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .slide-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    text-align: center;
    color: #333;
    font-size: 1px;
    opacity: 0;
  }
  .slide.selected {
    border: 2px solid #000000;
  }
  @media (orientation: portrait) {
    .model-container-wide {
      height: 32vh;
      width: 95vw;
    }
  }
  .dropdown {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 20px;
    z-index: 2;
  }
  .dropdown-btn {
    background: rgba(255, 255, 255, 0.3);
    color: #333;
    padding: 7px 18px;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    border-radius: 10px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 180px;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    will-change: background-color, color, font-weight;
  }
  .dropdown-btn:hover {
    background: rgba(248, 236, 198, 0.4);
    color: #a93e33;
    font-weight: 600;
  }
  .arrow {
    transition: transform 0.3s ease;
    margin-left: 20px;
    font-size: 22px;
  }
  .dropdown.open .arrow {
    transform: rotate(180deg);
  }
  .dropdown-content {
    display: none;
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    width: 180px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    z-index: 1000;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 100%;
  }
  .dropdown-content a {
    color: black;
    padding: 12px 16px;
    display: block;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    will-change: background-color, color, font-weight;
  }
  .dropdown-content a:hover {
    background: rgba(248, 236, 198, 0.4);
    color: #a93e33;
    font-weight: 600;
  }
  .dropdown.open .dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }
  .kc-wrap {
    position: relative;
    width: 100%;
    max-width: 900px;
    min-height: 600px;
    margin: 0 auto;
  }
  .kc-wrap web-circuit-viewer {
    display: block;
    width: 100%;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    background: #001023;
  }
  .kc-wrap .kc-fail {
    padding: 40px 20px;
    text-align: center;
    color: #888;
  }
  .kc-wrap:fullscreen {
    max-width: none;
    margin: 0;
    background: #000;
  }
  .kc-wrap:fullscreen web-circuit-viewer {
    height: 100vh;
    border-radius: 0;
  }
  .kc-fs-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    padding: 6px 12px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: none;
  }
  .kc-fs-btn:hover {
    background: rgba(0,0,0,0.85);
  }
  /* "Load" poster: model-viewer's own lazy loading — nothing downloads until the button is pressed */
  .mv-poster {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .mv-load-btn {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: rgba(255, 255, 255, 0.55);
    color: #333;
    padding: 10px 22px;
    font-size: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mv-load-btn:hover {
    background: rgba(248, 236, 198, 0.8);
    color: #a93e33;
    font-weight: 600;
  }
  .mv-load-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .kc-wrap .mv-poster {
    position: absolute;
    inset: 0;
    border-radius: 8px;
  }
  /* full-screen button on the 3D viewers */
  .mv-fs-host {
    position: relative;
  }
  .mv-fs-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  }
  .mv-fs-btn:hover {
    background: #f8ecc6;
    color: #a93e33;
    transform: scale(1.06);
  }
  .mv-fs-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mv-fs-host:fullscreen {
    width: 100vw;
    height: 100vh;
    max-height: none;
    background: #f5f2ea;
  }
  .mv-fs-host:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-height: none;
    background: #f5f2ea;
  }
  /* phones without real full screen (iPhone): the viewer simply covers the whole screen */
  .mv-fs-host.mv-fs-on {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    width: 100vw;
    height: 100vh;
    max-height: none;
    background: #f5f2ea;
  }
  body.mv-fs-lock {
    overflow: hidden;
  }
  body.mv-fs-lock .main-area {
    isolation: auto;
    z-index: auto;
  }
