/* Shared drug identifier treatment for entry, edit, and read-only views. */
.drug-identity-capsules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 38px;
  padding: 4px;
  border: 0;
  border-radius: .375rem;
  transition: border-color .15s, box-shadow .15s;
  align-items: center;
}
.drug-identity-capsules:focus-within {
  box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--blue) 15%, transparent);
}
.drug-identity-capsule {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: fit-content;
  border: 0;
  border-radius: .375rem;
  background: var(--brand-surface);
  color: var(--blue);
  overflow: hidden;
  font-size: 10px;
  font-weight: normal;
  line-height: normal;
  transition: width .2s ease, border-color .15s, box-shadow .15s;
}
.drug-identity-capsule:not(.is-editing):not(.drug-identity-capsule--readonly) { cursor: pointer; }
.drug-identity-capsule:not(.is-editing):not(.drug-identity-capsule--readonly):hover { background: color-mix(in srgb, var(--brand-surface) 85%, var(--blue)); color: var(--blue-hover); }
.drug-identity-capsule.is-add {
  justify-content: center;
  background: var(--surface-subtle);
  color: var(--blue);
}
.drug-identity-capsule.is-editing {
  max-width: 100%;
  background: var(--surface-subtle);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 10%, transparent);
}
.drug-identity-capsule-text {
  display: block;
  max-width: 20ch;
  padding: 0 .375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.drug-identity-capsule-input {
  flex: 0 1 auto;
  min-width: 1ch;
  max-width: min(20ch, calc(100vw - 150px));
  height: 100%;
  padding: 0 8px 0 10px;
  border: 0;
  outline: 0;
  color: inherit;
  font-size: 10px;
  field-sizing: content;
}
.drug-identity-capsule-delete {
  flex: 0 0 27px;
  align-self: stretch;
  border: 0;
  background: transparent;
  color: var(--text-sub);
  transition: color .15s;
}
.drug-identity-capsule-delete:hover { color: var(--red); }

.drug-identity-capsules--readonly {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: .375rem;
}

/* Result-card identifiers: CAS is neutral, while one-bottle-one-code is purple. */
.drug-identifier {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: var(--bs-font-monospace, 'Courier New', monospace);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.drug-identifier--cas { font-weight: 600; background: var(--surface-muted); color: var(--text-sub); }
.drug-identifier--qrtext { font-weight: 700; background: var(--purple-bg); color: var(--purple); letter-spacing: .5px; cursor: help; }
.drug-identifier-tooltip { min-width: 176px; --surface: var(--purple-bg);}
.drug-identifier-tooltip .tooltip-inner { max-width: none; padding: 10px; background: var(--surface, #fff); color: var(--text); box-shadow: 0 5px 18px color-mix(in srgb, var(--shadow) 20%, transparent); }
.drug-identifier-tooltip .tooltip-arrow{--bs-tooltip-bg:var(--surface, #fff);}
.drug-identifier-preview { display: grid; justify-items: center; gap: 8px; }
.drug-identifier-preview__qr { width: 152px; height: 152px; background: var(--purple-bg); }
.drug-identifier-preview__barcode { width: 152px; min-height: 30px; background: var(--purple-bg); color: var(--purple); }
.drug-identifier-preview__barcode svg { display: block; max-width: 100%; }
