.openings-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(2px);
  z-index: 4000;
  align-items: center;
  justify-content: center;
  padding: 16px
}

.openings-popup.active {
  display: flex;
}

.openings-card {
  background: #ffffff;
  border-radius: 20px;
  max-width: 760px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 18px 45px rgba(2, 6, 23, .18);
  padding: 26px;
  position: relative;
  border: 1px solid #eef2f7
}

.openings-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #444
}

.openings-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 20px
}

.openings-updated {
  text-align: right;
  color: #6c757d;
  font-size: 12px;
  margin-top: 6px
}

.openings-header {
  margin-bottom: 14px;
  text-align: center
}

.openings-header .title {
  font-weight: 700;
  font-size: 18px;
  color: #0f172a
}

.openings-header .subtitle {
  color: #64748b;
  font-size: 13px
}

.openings-meta {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px
}

.openings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px
}

.openings-item {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  background: #f9fafb;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit
}

.openings-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .08)
}

.openings-item:focus {
  outline: 3px solid rgba(25, 135, 84, .25);
  outline-offset: 3px
}

.item-title {
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px
}

.item-count {
  font-weight: 700;
  font-size: 30px;
  color: #111
}

.openings-chart {
  height: auto;
  margin: 8px 0 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(2, 6, 23, .04);
  overflow: hidden;
}

.openings-popup .openings-chart {
  display: flex;
  align-items: center;
  justify-content: center;
}

.openings-popup .openings-chart svg {
  display: block;
  width: 220px;
  height: 180px;
}

.openings-popup .pie-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 6px 6px 4px;
}

.openings-popup .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 6px 10px;
}

.openings-popup .legend-item:hover {
  background: #f1f5f9;
}

.openings-popup .legend-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.openings-popup .legend-item strong {
  font-weight: 700;
  color: #0f172a;
}

.openings-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.openings-updated {
  text-align: left;
  color: #6b7280;
  font-size: 12px
}

.item-actions {
  margin-top: 6px;
  color: #198754;
  font-weight: 600
}

.openings-fab {
    position: fixed;
    right: 32px;
    bottom: 16px;
  background: #198754;
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
  z-index: 100002;
  cursor: pointer
}

.openings-fab:hover {
  filter: brightness(1.05)
}

.openings-fab .fab-text {
  font-weight: 600
}

@media(max-width:576px) {
  .openings-grid {
    grid-template-columns: 1fr
  }

  .item-count {
    font-size: 24px
  }




  @media(max-width:576px) {
    .openings-card {
      border-radius: 18px;
      padding: 18px;
      max-width: 92%;
      margin: auto;
    }

    .openings-popup .openings-chart svg {
      width: 180px;
      height: 150px;
    }

    .openings-popup .pie-legend {
      justify-content: space-between;
      gap: 10px;
    }

    .openings-popup {
      padding: 10px;
    }

    .openings-card {
      padding: 16px;
      max-width: 95%;
      border-radius: 16px;
    }

    .openings-popup .openings-chart svg {
      width: 160px !important;
      height: 140px !important;
    }

    .openings-popup .pie-legend {
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
    }

    .openings-popup .legend-item {
      font-size: 12px;
      padding: 6px 8px;
    }

    .openings-popup .legend-item strong {
      font-size: 14px;
    }

    .openings-footer {
      flex-direction: column;
      gap: 8px;
      align-items: stretch;
    }

    .openings-footer .btn {
      width: 100%;
    }

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

  @keyframes openings-slide-up {
    from {
      transform: translateY(24px);
      opacity: .0;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @media(min-width:576px) and (max-width:991.98px) {
    .openings-grid {
      grid-template-columns: repeat(2, 1fr)
    }

    .item-count {
      font-size: 28px
    }
  }

  @media(min-width:992px) {
    .openings-grid {
      grid-template-columns: repeat(3, 1fr)
    }

    .item-count {
      font-size: 32px
    }
  }

  @supports (padding: env(safe-area-inset-bottom)) {
    .openings-fab {
      bottom: calc(16px + env(safe-area-inset-bottom));
      right: calc(32px + env(safe-area-inset-right))
    }

    .openings-popup {
      padding-bottom: calc(16px + env(safe-area-inset-bottom));
      padding-top: calc(16px + env(safe-area-inset-top))
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .openings-item {
      transition: none
    }

    .openings-fab {
      transition: none
    }
  }
}

@media(max-width:600px){
  .openings-fab { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
