/* Strata Platform -- Reference Picker helper styles.
   Self-contained, token-only. Card treatment mirrors the Concept Tray
   reference picker (ct-refpick): background-image thumbs with a min-height
   (NOT aspect-ratio on an <img>, which collapses to strips in a CSS grid).
   Consumers mount .strata-refpick into any flex/height-bounded container. */

.strata-refpick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  height: 100%;
  padding: 10px;
  box-sizing: border-box;
}

.strata-refpick-search {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.strata-refpick-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.strata-refpick-search::placeholder {
  color: var(--text-tertiary);
}

.strata-refpick-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.strata-refpick-select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  padding: 0 8px;
  outline: none;
  cursor: pointer;
}

.strata-refpick-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.strata-refpick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 84px;
  overflow-y: auto;
}

.strata-refpick-chip {
  flex: 0 0 auto;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text-secondary);
  padding: 0 10px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}

.strata-refpick-chip:hover,
.strata-refpick-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.strata-refpick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 2px 2px 8px 0;
  flex: 1;
  min-height: 0;
  align-content: start;
}

.strata-refpick-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: var(--panel-2);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.strata-refpick-tile:hover {
  border-color: var(--accent);
  background: var(--panel);
}

.strata-refpick-thumb {
  display: block;
  width: 100%;
  min-height: 96px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
}

.strata-refpick-thumb.placeholder {
  border: 1px dashed var(--border);
}

.strata-refpick-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.strata-refpick-meta strong,
.strata-refpick-meta span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strata-refpick-meta strong {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.strata-refpick-meta span {
  font-size: 10.5px;
  color: var(--text-tertiary);
}

.strata-refpick-more {
  grid-column: 1 / -1;
  min-height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.strata-refpick-more:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.strata-refpick-empty {
  grid-column: 1 / -1;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  color: var(--text-tertiary);
  font-size: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--panel-2);
}

.strata-refpick-status {
  min-height: 14px;
  color: var(--text-tertiary);
  font-size: 11px;
}
