/* Safari/iOS paints native <select> as a system menulist (double caret, extra chrome).
   Strip it so every dropdown matches the rest of the form. */
select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  font: inherit;
  color: inherit;
  line-height: 1.25;
  cursor: pointer;
  vertical-align: middle;
}
select:not([multiple]):not([size]),
select[size="1"] {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6660' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.7rem center !important;
  background-size: 0.9rem 0.9rem !important;
  padding-right: 2.1rem !important;
}
.dark select:not([multiple]):not([size]),
.dark select[size="1"] {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a39b90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}
select[multiple],
select[size]:not([size="1"]) {
  background-image: none !important;
  cursor: default;
  overflow: auto;
}
select:disabled {
  cursor: default;
  opacity: 0.65;
}
select::-ms-expand {
  display: none;
}

/* New KPI: name takes the row, weightage + qualifier stay compact. */
.kpi-add-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 0;
}
.kpi-add-row .kpi-add-name {
  flex: 1 1 auto;
  min-width: 0;
}
.kpi-add-row .kpi-add-wt {
  flex: 0 0 4.5rem;
  width: 4.5rem;
}
.kpi-add-row .kpi-add-wt input {
  width: 100%;
}
.kpi-add-row .kpi-add-qual {
  flex: 0 0 auto;
  height: 2.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
}

/* View as: real max-height so the 190-person list scrolls. */
.view-as-menu {
  display: flex;
  flex-direction: column;
  max-height: min(36rem, calc(100dvh - 7rem));
  overflow: hidden;
}
.view-as-search {
  flex: none;
  background: var(--card, inherit);
}
.view-as-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Improve: screenshot thumbs + lightbox */
.improve-thumbs { display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:0.5rem; }
.improve-thumb {
  position: relative;
  width: 5.5rem; height: 5.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  padding: 0; margin: 0;
  background: transparent;
  cursor: zoom-in;
}
.improve-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.improve-thumb-x {
  position:absolute; top:3px; right:3px;
  width:1.25rem; height:1.25rem; border-radius:999px;
  background: rgba(0,0,0,.72); color:#fff; border:0; cursor:pointer;
  font-size:14px; line-height:1.25rem; padding:0;
}
.improve-lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.72); padding: 1.5rem;
}
.improve-lightbox-img {
  max-width: min(1100px, 92vw);
  max-height: min(86vh, 900px);
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.improve-lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  height: 2rem; padding: 0 0.75rem;
  border-radius: 0.5rem; border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer;
}

/* Picker: Select all / Deselect all stay pinned while the list scrolls. */
.picker-actions {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.2rem 0.25rem 0.4rem;
  margin: -0.25rem -0.25rem 0.35rem;
  background: inherit;
  border-bottom: 1px solid var(--border, rgba(26, 22, 18, 0.12));
}
