/* =========================================================
   ANATOMARK — STRUCTURE PICKER
   Shared overlay, injected on demand by js/picker.js.
   Mobile: bottom sheet. Desktop (>=768px): centered modal.
   ========================================================= */

.picker-scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(1, 6, 7, 0.68);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.picker-scrim.open { opacity: 1; pointer-events: auto; }

.picker-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 201;
  background: var(--color-bg-deep);
  border: 1px solid rgba(0, 229, 199, 0.18);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 14px 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  /* visibility removes the closed sheet from the Tab order and from screen
     readers; the delay lets the slide-out finish before it switches off. */
  visibility: hidden;
  transition: transform 260ms cubic-bezier(.2,.8,.2,1), visibility 0s linear 260ms;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}
.picker-sheet.open { transform: translateY(0); visibility: visible; transition-delay: 0s; }

.picker-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.18);
  margin: 4px auto 16px;
}

.picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.picker-header h3 {
  margin: 0;
  color: var(--color-white);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}
.picker-close {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  color: var(--color-white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 229, 199, 0.28);
  border-radius: var(--radius-md);
  background: rgba(0, 229, 199, 0.04);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.picker-row:hover {
  border-color: rgba(0, 229, 199, 0.6);
  background: rgba(0, 229, 199, 0.08);
}

.picker-row-thumb {
  width: 52px; height: 52px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.picker-row-thumb img {
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0.85;
}

.picker-row-body { flex: 1; min-width: 0; }
.picker-row-body .tag {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid rgba(0, 229, 199, 0.3);
  border-radius: 4px;
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}
.picker-row-body h4 {
  margin: 0;
  color: var(--color-white);
  font-size: 16px;
  font-weight: 700;
}

.picker-row-arrow {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 199, 0.4);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}

.picker-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--color-text-muted);
  font-size: 12.5px;
  text-align: center;
}

/* ---------------- Desktop: centered modal ---------------- */
@media (min-width: 768px) {
  .picker-sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    transform: translate(-50%, -46%);
    width: min(720px, calc(100% - 48px));
    max-height: 80vh;
    border-radius: var(--radius-lg);
    border-bottom: 1px solid rgba(0, 229, 199, 0.18);
    padding: 28px 32px 32px;
  }
  .picker-sheet.open { transform: translate(-50%, -50%); }
  .picker-handle { display: none; }
  .picker-header h3 { font-size: 24px; }
  /* many bones: a wrapping grid inside the scrolling dialog */
  .picker-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
  .picker-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 10px;
    gap: 6px;
  }
  .picker-row-thumb { width: 64px; height: 64px; }
  .picker-row-arrow { display: none; }
}

.picker-row-thumb img { mix-blend-mode: screen; }
