/* Match photos: the step that pairs an Analyst's Notebook chart's pictures with entities on import. */
.pm-dialog {
  width: min(1040px, calc(100% - 32px)); max-height: calc(100vh - 48px); margin: auto; padding: 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 48px rgba(36, 36, 36, .25); font-family: var(--font-ui); color: var(--text);
}
.pm-dialog:not([open]) { display: none; }
.pm-dialog::backdrop { background: rgba(36, 36, 36, .4); }
.pm-head { padding: 20px 22px 12px; border-bottom: 1px solid var(--line-soft); }
.pm-title { margin: 0 0 6px; font-family: var(--font-head); font-size: 20px; color: var(--navy); }
.pm-intro { margin: 0 0 12px; max-width: 72ch; line-height: 1.45; font-size: 14px; }
.pm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.pm-find {
  width: min(260px, 100%); height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); font: inherit; font-size: 13.5px; color: var(--navy);
}
.pm-find:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--sky); }
.pm-check { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.pm-link { padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--blue); cursor: pointer; }
.pm-link:hover { text-decoration: underline; }
.pm-status { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.pm-grid {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 22px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; align-content: start;
}
.pm-card { margin: 0; min-width: 0; padding: 8px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--white); }
.pm-card[hidden] { display: none; }
.pm-frame {
  height: 132px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: 8px; background: var(--paper);
}
.pm-frame img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pm-broken { font-size: 12.5px; color: var(--muted); }
.pm-cap { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; min-width: 0; }
.pm-num { font-size: 12px; color: var(--muted); }
.pm-select {
  width: 100%; min-width: 0; height: 32px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); font: inherit; font-size: 13px; color: var(--navy); text-overflow: ellipsis;
}
.pm-select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--sky); }
.pm-flash { animation: pm-flash 1.2s ease-out; }
@keyframes pm-flash { from { border-color: var(--blue); box-shadow: 0 0 0 3px var(--sky); } }
.pm-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line-soft); }
.pm-spacer { flex: 1 1 auto; }
@media (max-width: 560px) {
  .pm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 10px; }
  .pm-head, .pm-foot { padding-left: 14px; padding-right: 14px; }
  .pm-intro { font-size: 13px; }
  .pm-frame { height: 104px; }
  .pm-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pm-foot .pm-spacer { display: none; }
  .pm-foot .btn { min-width: 0; height: auto; min-height: 32px; padding: 6px 8px; white-space: normal; }
  .pm-foot .primary { grid-column: 1 / -1; }
}

.pm-replace {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; max-width: 80ch; padding: 10px 12px;
  border: 1px solid var(--line-soft); border-radius: 8px; background: var(--paper); font-size: 13.5px; line-height: 1.4; cursor: pointer;
}
.pm-replace[hidden] { display: none; }
.pm-replace input { margin-top: 2px; flex: none; }
.pm-replace strong { color: var(--navy); font-weight: 600; }
